how do call a web srvice using soap when my webservice is like this.. i need to fill up the cus details how can i do that .. can any one guide me on this
<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>
The code which i use to call the service:
final String METHOD_NAME = ServiceStrings.registerMethod;
final String SOAP_ACTION = ServiceStrings.registerSoapAction;
try {
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
PropertyInfo pi = new PropertyInfo();
pi.setName("cusDetails");
pi.setValue(new SoapObject(NAMESPACE, "cusDetails")
.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", 1)
.addProperty("DiscAgree", 1)
.addProperty("Latitude", "11.2")
.addProperty("Longitude", "11.2"));
request.addProperty(pi);
But i get an error
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/'>
1 Answer