Java 在android中发送嵌套请求\
当我的web服务如下所示时,如何使用soap调用web服务。。我需要填写cus的详细信息我该怎么做。。有谁能在这方面指导我吗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> &
<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. ---> There is an error in XML document (1, 316). ---> The specified type was not recognized: name='cusDetails', namespace='http://webservices.foodtruck.zsl.com/', at <cusDetails xmlns='http://webservices.foodtruck.zsl.com/'>
你发送了/而不是我给出了我的完整代码。。我没有提到像/then how it hpndSomething这样的东西,它在构造或发送xml详细信息时不起作用。但我不知道SoapObject是如何工作的。请尝试AndroidSOAP项目…:也请验证此示例:
Server was unable to read request. ---> There is an error in XML document (1, 316). ---> The specified type was not recognized: name='cusDetails', namespace='http://webservices.foodtruck.zsl.com/', at <cusDetails xmlns='http://webservices.foodtruck.zsl.com/'>
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);