PDA

View Full Version : Create web service soap request in iphone.




forrestxu
Aug 29, 2008, 02:48 PM
Hi ,

Can we create soap request in iphone. For example, do we have SDK to create the soap request described as below:

POST /InStock HTTP/1.1
Host: www.example.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<soap:Envelope
xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">

<soap:Body xmlns:m="http://www.example.org/stock">
<m:GetStockPrice>
<m:StockName>IBM</m:StockName>
</m:GetStockPrice>
</soap:Body>

</soap:Envelope>

Regards,
Forrest



robbieduncan
Aug 29, 2008, 02:51 PM
Read the documentation for NSMutableURLRequest and NSURLConnection. Between them you can create a POST mode request with your payload and retreive the response. As far as I am aware there is no specialist SOAP API

forrestxu
Aug 29, 2008, 04:42 PM
Read the documentation for NSMutableURLRequest and NSURLConnection. Between them you can create a POST mode request with your payload and retreive the response. As far as I am aware there is no specialist SOAP API

Thank you for your help.

I think NSURLConnection is used to create connection between web service and iphone.

NSMutableURLRequest is used to create HTTP request. I don't know how to create soap request which is HTTP+XML request. Could you please help me to find example code?

Thanks a lot.

Forrest

robbieduncan
Aug 29, 2008, 05:23 PM
I have no example code and I'm certainly not going to spend my time looking for any. I would simply say that you have a request thatlt is made up of a number of headers which you can set in the request and a text body that again you can set. Basically I don't see where the issue is. As a programmer you are expected to be able to read th documentation and apply it to the problem at hand. You cannot expect to be spoon fed a solution.

keehun
Aug 29, 2008, 06:22 PM
gSoap might be the best way you can go. It is written in C++ but there are ways you can get that to compile.

http://www.cs.fsu.edu/~engelen/soap.html

forrestxu
Aug 30, 2008, 09:18 AM
gSoap might be the best way you can go. It is written in C++ but there are ways you can get that to compile.

http://www.cs.fsu.edu/~engelen/soap.html

Robbieduncan and Keehun
Thank you very much.

Keehun,
I guess C++ can not be compiled in iphone. right?

Robbieduncan,
I will try NSMutableURLRequest and NSURLConnection.

Just curiously. some information I found regarding on web service does not related with NSMutableURLRequest and NSURLConnection.

For example, sample code SeismicXML in iphone dev cente

the link http://discussions.apple.com/thread.jspa?threadID=1435726&tstart=0 seems introduce a little of NSMutableURLRequest and NSURLConnection.


It should be easy if we can use NSMutableURLRequest and NSURLConnection. Let me try it now.

Thank you very much!

Forrest

supertoto
Aug 30, 2008, 11:08 AM
Keehun,
I guess C++ can not be compiled in iphone. right?

Forrest

Who said C++ can not be compiled on iPhone?
Absolutely it can! u can even mix C++ code with ObjC!

forrestxu
Aug 30, 2008, 11:50 AM
Who said C++ can not be compiled on iPhone?
Absolutely it can! u can even mix C++ code with ObjC!

Thanks,
I am wrong!

keehun
Aug 30, 2008, 11:59 AM
I did say you can compile C++ with objective c :)