0

错误信息是

在 SOAP 主体中找到的根元素“{ http://webservice.eis.tg }selectData”与 WSDL 文件中定义的任何消息的名称和名称空间都不匹配。

这是我的代码

StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();

StrictMode.setThreadPolicy(policy); 
String URL = "http://202.122.131.25/EISDatagetDB";
String NameSpace = "http://webservice.eis.tg";

String MethodName = "selectData";
String SoapAction = "selectData";

SoapObject request = new SoapObject(NameSpace,MethodName);
request.addProperty("fromdate","201201");

SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);

try{                
    HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
    androidHttpTransport.call(SoapAction, envelope);
         if (envelope.bodyIn instanceof SoapFault) {
                String str= ((SoapFault) envelope.bodyIn).faultstring;
                Log.i("Soap", str);
                System.out.println("++++++++++++++++++"+str);
                tv1.setText(str);
         } else {
               SoapObject resultsRequestSOAP = (SoapObject) envelope.bodyIn;
                Log.d("WS", String.valueOf(resultsRequestSOAP));
                Results = resultsRequestSOAP;
                data = Results.toString();
                System.out.println(data);
                tv1.setText(data);        
                }
            }
            catch(Exception e){
                System.out.println("---------------------"+e);
                tv1.setText(""+e);
                Toast.makeText(getApplicationContext(), "No Response",Toast.LENGTH_LONG).show();
            }

请在以下位置检查 xml:http://202.122.131.25/EISDatagetDB?wsdl

非常感谢您的帮助。

4

1 回答 1

0

你能在你的代码中做这两个改变吗?

尝试改变

String URL = "http://202.122.131.25/EISDatagetDB";

String URL = "http://57.59.36.25:80/EISDatagetDB";

因为端点地址在元素中表示

<wsdlsoap:address location="http://57.59.36.25:80/EISDatagetDB"/>
于 2013-08-03T04:55:19.037 回答