Gurvinder Singh
Gurvinder Singh

Reputation: 29

How to Post data to server using SOAP

This is my XML format which I want to post to serve:

`<soap:Body>
<UploadImagesAndNotes xmlns="http://www.datadog.co.nz/
<UserId>string</UserId>
<Password>string</Password>
<MobileNumber>string</MobileNumber>
<Note>string</Note>
<JobNumber>int</JobNumber>
<GPSLatitude>decimal</GPSLatitude>
<GPSLongitude>decimal</GPSLongitude>
<Images>
<Image>
<ImageData>base64Binary</ImageData>
<ImageLatitude>decimal</ImageLatitude>
<ImageLongitude>decimal</ImageLongitude>
</Image>
<Image>
<ImageData>base64Binary</ImageData>
<ImageLatitude>decimal</ImageLatitude>
<ImageLongitude>decimal</ImageLongitude>
</Image>
</Images>
<Fowards>
<EmailAddress>string</EmailAddress>
<EmailAddress>string</EmailAddress>
</Fowards>
</UploadImagesAndNotes>
</soap:Body>
</soap:Envelope>`

I know how to send it to server using this:-

`SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME); //set up request
request.addProperty("GPSLatitude", lat);
request.addProperty("GPSLongitude", long);`

but I am getting problem in

`<Images>
<Image>`

How to set these nodes value?

Upvotes: 1

Views: 1074

Answers (2)

PiyushMishra
PiyushMishra

Reputation: 5773

<image name="image1">

and <image name="image2"> add this into ur images to differentiate b/w two.

Upvotes: 1

Related Questions