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

Partner WSDL and

I am struggling with the understanding of API usage.  I saw an example in the cook book where I could consume the Apex Partner WSDL in a Salesforce ORG.  Now I am trying to actually query data from one developer org  and by using the partner classes generated the WSDL import actually insert records into another developer org via API calls.


The examples that I find in the API developer guide are all around C# or Java apps doing this.  I want to do this from one SF org to another SF org.


In addition, I do not see any full-complete examples of how to encrypt the password so that the actual Apex code inside of SF does not allow someone to see the password in its normal view.


Any help would be appreciated.


While you can consume WSDLs in apex, the partner WSDL contains features not supported by WSDL2Apex, so that's not really going to work very well.

Thank you for your feedback. To make sure I am not ask the wrong question let me give it another try.

In all the SF guides they give examples of java or C# calling SF Web Service. I am having a hard enough learning curve trying to get WS concept down so I was not trying to learn/deal with Those other languages. I wanted to use two developer org where one would query the other to get contact and account data for example.

I just find it very difficult to find good complete example on most SF code example but for API it is a nightmare for the beginner of API. I appreciate your help.

Going between 2 orgs is not particularly a common scenario for the API, by far the vast usage of the API is for integration of on premise systems, and so the examples reflect that.

Trying out the enterprise API from a tool like SoapUI might help get you upto spped faster.


I guess what I am looking for is a complete package for a beginner of the API world.  I cannot seem to find one but I did find this link that helps with WS calls from SF to SF.  Step 6 did not happen like the instructions stated.  SF consumed the wsdl without errors so this is yet another failed example for me to get a full understanding by actually creating something. Pressure is on for me to get an understanding of this stuff so I can actually produce results for production initiatives!


Is it possible that when this topic was posted SF had issues consuming its own WSDL and now they do not?  Have you tried this example and had it actually work by performing an query API call from SF to SF to get accounts, for example?


Never seen that before, My suggestion stays the same, start with SoapUI, then move onto an external language like C# or Java, then move to apex if thats your final goal. WSDL2Apex does not (and never has) support some of the features of the partner API, so the apex route will be challenging, but it will depend on exactly what you're trying to do.