In a previous post I discussed how to test Salesforce webservices with soapUI. In this post I will show how to use the “default” methods inside the enterprise WSDL.
Logging In
First we need to login to Salesforce and get our session Id. Under the SoapBinding list, expand login and choose Show Request Editor. After opening the request editor we need to remove the extra headers we don’t need, and fill in our username and password.
Image may be NSFW.
Clik here to view.
Then press the “play” button to send the request
Image may be NSFW.
Clik here to view.
Now in the resulting XML we can pull out our session Id
Image may be NSFW.
Clik here to view.
And we can pull out our server Url
Image may be NSFW.
Clik here to view.
Adding the new endpoint
If we create a new query request and remove the unneeded headers and insert our session Id and run the request you get the following error:
UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService
To fix this issue we need to add a new end point to our SOAP request. Using the server Url obtained during login we can add it to our request
Image may be NSFW.
Clik here to view.
And now we can rerun our new request with the correct endpoint
Image may be NSFW.
Clik here to view.
Conclusion
Unlike custom webservices which include the Salesforce endpoint as part of the WSDL the standard Salesforce enterprise WSDL only has the test or login url included. Because of this, we need to use the returned server url to set our end point.