[SalesForce] SoapUI: Error getting response

I'm learning all about the SOAP api (working through the Trailhead module) and I'm having issues with SoapUI.

I'm able to make a login call successfully (username, password and token removed):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">
   <soapenv:Header>

   </soapenv:Header>
   <soapenv:Body>
      <urn:login>
         <urn:username>my-username@cunning-goat-67671.com</urn:username>
         <urn:password>passwordAndSecurityToken</urn:password>
      </urn:login>
   </soapenv:Body>
</soapenv:Envelope>

But when I try and create a record according to the instructions on the trailhead module, I get "Connection Refused" error.

Here's the call that I'm trying to execute in SoapUI (session token removed):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com" xmlns:urn1="urn:sobject.enterprise.soap.sforce.com">
   <soapenv:Header>
      <urn:SessionHeader>
         <urn:sessionId>mySecurityTokenHere</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:create>
         <!--Zero or more repetitions:-->
         <urn:sObjects xsi:type="urn1:Account" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <!--Zero or more repetitions:-->
            <Name>Sample SOAP Account</Name>
         </urn:sObjects>
      </urn:create>
   </soapenv:Body>
</soapenv:Envelope>

And here's the error message I'm getting:
enter image description here

Things I've tried:

  1. adding my IP address to the network whitelist
  2. following the instructions here to ensure that I'm not trying to log in using TLS1.0 (though the login call works fine so this was likely a red-herring-hail-mary flail)
  3. Disabling my Bitdefender firewall, and ensuring that my proxy was not running.
  4. regenerating my security token, log in with it fresh and immediately copy-paste the session ID, just in case it had expired (another long shot)
  5. going to the location described in this post to try and find more information about the error – the file location doesn't exist on my PC.

Unfortunately my error message hasn't changed.

Any advice gratefully received. Even if someone can point me in the direction for finding a more detailed debug log in SoapUI, that would be amazing.

Edited for additional screenshots:

Here's what my login call looks like, complete with the endpoint:

enter image description here

And the create call that's failing:

enter image description here

Best Answer

I suspect problem is the endpoint URL. It appears you are using the Enterprise API based on the structure of the urn:sObjects xsi:type.

For the partner API I'm using the following. Note that this is what comes back in the loginResponse serverUrl:

https://curious-raccoon-253753-dev-ed.my.salesforce.com/services/Soap/u/36.0/00D7F0000000001

For the enterprise API you would need to swap out the /u/ for /c/. E.g.

https://curious-raccoon-253753-dev-ed.my.salesforce.com/services/Soap/c/36.0/00D7F000000001

Of course, your trailhead playground will have a different sub domain and trailling org id


I tried again to replicate your call to the Enterprise API via SOAP UI by copy an pasting your sample request and changing the sessionId. I tried both with and without the Org ID on the end of the URL. Works on my machineā„¢

enter image description here

Does SOAP UI work against other orgs, or is it just your scratch org that is causing the connection refused error?

It really seems like a networking level error. I'd try using Soap UI from a different machine and/or another tool that uses the Soap API to update records. If your sole goal is to pass the Trailhead challenge you can probably trick the validation by using another API based tool to create the Account record.

Related Topic