Skip to main content

Integration & IT Modernization

Quick Steps to Start Testing Salesforce SOAP API

To start testing Salesforce SOAP API with SoapUI, follow the quick steps below:

  1. Register a Salesforce developer account.
    • Make sure to register a developer edition account from https://developer.salesforce.com/signup   Do not register from www.salesforce.com, as you won’t be able to ‘generate wsdls’ which will be needed in the next step.
  2. Reset Salesforce Security Token
    • Login to the developer account, go to personal settings -> reset security token,   you will receive an Email with security token info.  Make note of it, it will be used when test web service authentication in later steps.
  3. Download WSDL file
    •  Go to Setup -> Custom Code -> API,  right click ‘Generate Enterprise WSDL’ link and save file to your local.
  4. Create a Soap Project in SoapUI and import the WSDL file
  5. Use SoapUI to test Login service in Enterprise WSDL
    • Expand the SoapBinding node from left navigation, double click Request 1 under ‘login’ to create a new login request.
    • Fill in parameter values in the request message body
      • username (same as your salesforce user name)
      • password ( here password should be your Salesforce login password concatenate with your security token)
      • remove ‘?’ from other fields
    • Submit the request, and you should get a response successfully.
    • Fix TLS version issue (when necessary )
      • In case you got below error in response message as I did: “UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https”,  you’ll need to make changes to SoapUI to have it use higher version of TLS.
      • If you are on Windows, follow steps in this post.
      • If you are on Mac, you’ll need to find file /Applications/SoapUI-X.X.X.app/Contents/vmoptions.txt, and add a line to the bottom:-Dsoapui.https.protocols=TLSv1.2 
    • Analyse Response from Login request,
      • Notice element sessionId, serverUrl in response message body, they’ll be used in subsequent requests.
  6. Once Login successfully, test subsequent Enterprise services, E.g. queryAll
    • Double click ‘Request 1’  under queryAll, to create a queryAll request message
    • Fill in sessionId in message header with sessionId obtained from Login response.
    • Fill in queryString such as “SELECT id FROM Account”.
    • Fill in batchSize such as 3 for example.
    • Change the request Url from default to serverUrl obtained from Login response.
    • Submit the request, you should be able to see list of accounts in the response message.
  7.   You are all set to go. Have fun!

Thoughts on “Quick Steps to Start Testing Salesforce SOAP API”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Follow Us