开发者

Using Salesforce WSDL in iPhone app

开发者 https://www.devze.com 2023-01-04 05:57 出处:网络
I\'ve just started using Salesforc开发者_Go百科e and would like to use the Salesforce API in my iPhone app to submit data from the app to the instance.

I've just started using Salesforc开发者_Go百科e and would like to use the Salesforce API in my iPhone app to submit data from the app to the instance.

I generated the WSDL and know the XML field names which I have to send in the SOAP payload.

But I haven't been able to figure out how exactly to send the request. I generated the SOAP payload, set the headers

  1. Content-Type: text/xml
  2. SOAPAction: blank string (according to the WSDL's XML)
  3. Content-Length: length of the SOAP payload

What I cannot understand - What will be the URL to which I send the request? Can't figure it out from the WSDL

Thanks for any help.


It should be at the bottom of your WSDL, similar to this:

<service name="SforceService">
    <documentation>Sforce SOAP API</documentation> 
    <port binding="tns:SoapBinding" name="Soap">
        <soap:address location="https://login.salesforce.com/services/Soap/c/19.0" /> 
    </port>
</service>

Different environments (i.e. production vs. sandbox) and different WSDLs (enterprise vs. partner) might lead to slight changes in the address, but taking it from the WSDL is the way to go.

Also: while all's fine with building your own SOAP messages, you might want to check out the zkSforce Mac OS X library listed on the official API page.

0

精彩评论

暂无评论...
验证码 换一张
取 消