Create web service soap request in iphone.

Discussion in 'iOS Programming' started by forrestxu, Aug 29, 2008.

  1. forrestxu
    Expand Collapse
    macrumors newbie

    Joined:
    May 31, 2008
    #1
    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
     
  2. robbieduncan
    Expand Collapse
    Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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
     
  3. forrestxu
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    May 31, 2008
    #3
    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
     
  4. robbieduncan
    Expand Collapse
    Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    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.
     
  5. keehun
    Expand Collapse
    macrumors regular

    Joined:
    Mar 17, 2008
    #5
  6. forrestxu
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    May 31, 2008
    #6
    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
     
  7. supertoto
    Expand Collapse
    macrumors newbie

    Joined:
    Jul 29, 2008
    #7
    Who said C++ can not be compiled on iPhone?
    Absolutely it can! u can even mix C++ code with ObjC!
     
  8. forrestxu
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    May 31, 2008
    #8
    Thanks,
    I am wrong!
     
  9. keehun
    Expand Collapse
    macrumors regular

    Joined:
    Mar 17, 2008
    #9
    I did say you can compile C++ with objective c :)
     

Share This Page