首页 > 解决方案 > 如何在 react-native 中安装 wsdl 连接

问题描述

我正在尝试建立aa wsdl 连接。我收到以下错误。有人可以帮忙吗?

我的连接代码

import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';

    var soap = require('soap');
     var url = 'https://localhost:44379/service/ozelekranservice.svc?wsdl';
    var args = {User : '15460036927', Password : '123'};


type Props = {};
export default class App extends Component<Props> {

  render() {

    soap.createClientAsync(url).then((client) => {

     console.warn(client.Login(args));

    return client.Login(args);

  }).then((result) => {

   console.warn(result);

   });


    return (
      <View style={styles.container}>
        <Text style={styles.welcome}>Welcome to React Native!</Text>

      </View>
    );
  }
}

错误代码网址:http ://10.0.3.2:8081/index.delta?platform=andoid&dev=true&minify=false body:{"orginModulePath":"

C:\users\...\node_modules\soap\lib\client.js","targetModuleName":"assert","message":"Unable to resolve module'assert'from

'C:\users\...\node_modules\soap\lib\client.js':Module 'assert' does not exist in the Haste module map\n\n这可能与https://github.com/facebook有关/react-native/issues/4968 \n要解决,请尝试以下操作:\n

  1. 清除守望者手表:'watchman watch-del-all'。\n

  2. 删除“node_modules”文件夹:“rm -rf node_modules &&nom install”。\n

3.重置 Metro Bundler 缓存:'rm -rf/tmp/metro-bundler-chace-*' 或 'npm start -- --reset-chace'。\n

  1. 删除急速:'rm -rf /tmp/haste-mat-react-native-packager-*'.","errors":[{"description":"Unable to resolve module 'assert'from

'C:\users\...\node_modules\soap\lib\client.js': 模块 'assert' 在 Haste 模块映射中不存在\n\n这可能与

标签: node.jsasp.net-mvcreact-nativenode-modules

解决方案


推荐阅读