Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/185.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 在android中发送嵌套请求\_Java_Android_Soap - Fatal编程技术网

Java 在android中发送嵌套请求\

Java 在android中发送嵌套请求\,java,android,soap,Java,Android,Soap,当我的web服务如下所示时,如何使用soap调用web服务。。我需要填写cus的详细信息我该怎么做。。有谁能在这方面指导我吗 <registerCustomer xmlns="http://webservices.foodtruck.zsl.com/"> <cusDetails> <FirstName>string</FirstName> <LastName>string</LastName> &

当我的web服务如下所示时,如何使用soap调用web服务。。我需要填写cus的详细信息我该怎么做。。有谁能在这方面指导我吗

<registerCustomer xmlns="http://webservices.foodtruck.zsl.com/">
  <cusDetails>
    <FirstName>string</FirstName>
    <LastName>string</LastName>
    <EmailID>string</EmailID>
    <AddLine1>string</AddLine1>
    <AddLine2>string</AddLine2>
    <ZipCode>string</ZipCode>
    <City>string</City>
    <StateCode>string</StateCode>
    <PhoneNumber>string</PhoneNumber>
    <Username>string</Username>
    <Password>string</Password>
    <BrandID>int</BrandID>
    <DiscAgree>int</DiscAgree>
    <Latitude>string</Latitude>
    <Longitude>string</Longitude>
  </cusDetails>
       </registerCustomer>
       </soap:Body>
     </soap:Envelope>
但我犯了个错误

Server was unable to read request. ---&gt; There is an error in XML document (1, 316). ---&gt; The specified type was not recognized: name='cusDetails', namespace='http://webservices.foodtruck.zsl.com/', at &lt;cusDetails xmlns='http://webservices.foodtruck.zsl.com/'&gt;

你发送了/而不是我给出了我的完整代码。。我没有提到像/then how it hpndSomething这样的东西,它在构造或发送xml详细信息时不起作用。但我不知道SoapObject是如何工作的。请尝试AndroidSOAP项目…:也请验证此示例:
Server was unable to read request. ---&gt; There is an error in XML document (1, 316). ---&gt; The specified type was not recognized: name='cusDetails', namespace='http://webservices.foodtruck.zsl.com/', at &lt;cusDetails xmlns='http://webservices.foodtruck.zsl.com/'&gt;
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
        PropertyInfo pi = new PropertyInfo();
        pi.setName("cusDetails");
        pi.setValue(new SoapObject(NAMESPACE, "Customer")
                .addProperty("FirstName", fname)
                .addProperty("LastName", lname)
                .addProperty("EmailID", email)
                .addProperty("AddLine1", add1)
                .addProperty("AddLine2", add2).addProperty("ZipCode", zip)
                .addProperty("City", city).addProperty("StateCode", state)
                .addProperty("PhoneNumber", phoneno)
                .addProperty("Username", email)
                .addProperty("Password", pwd)
                .addProperty("BrandID", brandid)
                .addProperty("DiscAgree", flag)
                .addProperty("Latitude", "11.2")
                .addProperty("Longitude", "11.2"));

        request.addProperty(pi);
        Log.e("req", brandid);
        SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(
                SoapEnvelope.VER11);
        envelope.dotNet = true;
        envelope.setOutputSoapObject(request);
        AndroidHttpTransport androidHttpTransport = new AndroidHttpTransport(
                URL);