views:

115

answers:

1

1- How do i create soap messages to communicate with a web service? Let's say my client needs to send a request to a web service, Do i generate the FULL soap string and then send it to the web service, including header, body, envelop etc?

2- Let's say the web service sends me back a SOAP response, the response contains information about 4 different users info in my database? How do i convert the soap message to 4 "objects of User"? Do i need to loop through the message and read each parameter 1 by 1, and create my "User" objects? or is there an easier way of matching the parameters in the soap message with parameters in my class and create the objects automatically?

+1  A: 

If you have the WSDL of that webservice, many IDE's have the ability to import the WSDL and auto generate a client program for the bindings.

So, if the webservice returns many USER objects, your IDE' will generate them back. If not, it will generate objects for the kind of response your webservice returns.

With those objects, i think will be easier to extract the users from it than from the raw envelope

Garis Suero