Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

forrestxu

macrumors newbie
Original poster
May 31, 2008
16
0
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: http://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

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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

macrumors newbie
Original poster
May 31, 2008
16
0
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

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
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.
 

forrestxu

macrumors newbie
Original poster
May 31, 2008
16
0
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
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.