Question Consuming a SOAP Service to Get a picture

sgcweb

New member
Joined
Nov 22, 2015
Messages
1
Programming Experience
Beginner
I need to get a picture from a 3rd party soap service and display it on a WM 6.1 device using vb.net

The webpage info for the service is as follows
HTML:
SOAPAction: "http://tempuri.org/GetPhotoByEntityId"


<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">  <soap:Body>    <GetPhotoByEntityId xmlns="http://tempuri.org/">      <entityId>long</entityId>    </GetPhotoByEntityId>  </soap:Body></soap:Envelope>

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">  <soap:Body>    <GetPhotoByEntityIdResponse xmlns="http://tempuri.org/">      <GetPhotoByEntityIdResult>base64Binary</GetPhotoByEntityIdResult>    </GetPhotoByEntityIdResponse>  </soap:Body></soap:Envelope>
 
You add a Web Reference in project and give it the WSDL url, this creates a managed proxy class that you use to call the service methods.

From the the looks of it the GetPhotoByEntityId method returns a byte array, which you can put in a MemoryStream and construct Bitmap from.
 
From the the looks of it the GetPhotoByEntityId method returns a byte array, which you can put in a MemoryStream and construct Bitmap from.

It says base64Binary so it's probably just a base64 encoded string of the binary data.
 
It says base64Binary so it's probably just a base64 encoded string of the binary data.
The proxy converts that for you.
 
Back
Top