function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Tarak SilliniTarak Sillini 

API 2.0 - Describe does not work

Hi, i am trying to use API 2.0. the login call works fine but when i try to use the describe function on a lead, i get an error in the reference.map file saying unknown method name describe .

Is there anything different using API 2.0? Do i need an updated WSDL?

 

PS: I am using VSNet 2003 with the SoapAPI

DevAngelDevAngel

Hi Tarak,

That error is typical of trying to make a describe call to www.salesforce.com/servlet/servlet.soapapi

The way you should be thinking about how to use the API is that there are 2 "servers" that you will always use.  One "server" is used for the login call, the other "server" is for all the other calls.

  • login
  • others
    • na0-api.salesforce.com/servlet/servlet.soapapi  or
    • na1-api.salesforce.com/servlet/servlet.soapapi  or
    • ap-api.salesforce.com/servlet/servlet.soapapi      or
    • eme-api.salesforce.com/servlet/servlet.soapapi

Each "server" correspond to one of the urls above.  If you always use the "www" url for logins, you will recieve a url from the login call if successful.  This url will be one of the ones in the others category above and this url is the one to use for all other calls.  You do not need to be concerned about which "other" url to use.  You simply use the one that you are given by the login call.

Here is a successful login call soap message response ( I have removed the header for clarity);

  <soap:Body>
    <sfdc:loginResponse xmlns:sfdc="sfconnector:SalesforceConnector">
      <return>
        <valueMap xsi:type="tns:map">
          <server_url xsi:type="xsd:string">http://na1-api.salesforce.com/servlet/servlet.SoapApi</server_url>
          <userID xsi:type="xsd:string">00530000000bxGz</userID>
          <session_id xsi:type="xsd:string">chV.elA9ehnzRu_smbVqRmXD.SQei2vN5EyObB2lez2Y2jpIpzQjoTdHaQyUZqmwUSiat1H5KaIuIMCxor_Mg.btzKggVlhL</session_id>
        </valueMap>
      </return>
    </sfdc:loginResponse>
  </soap:Body>

In VS.Net, you have a soap proxy client that is generated for you called reference.vb or reference.cs.  This class provides a public member called url.  After successfully logging in you should immediately set this member to the url returned from the login call (at the same time you should be setting the session_id and version in the headerstruct member).