+ Start a Discussion
kevindotcarkevindotcar 

Dreaded No operation available for request on SOAP API call

Hi all,

I'm getting the dreaded "No operation available for request" when sending an API request.

I'm using Curl because it's just a quick describeObject that I need to do.  It works fine via XML-RPC but I'm missing something with the SOAP equivalent.  Here's my command line:

curl -k  "https://test.salesforce.com/services/Soap/c/18.0" -H "Content-Type: text/xml" -H "SoapAction: ''"   -d "<?xml version='1.0' encoding='UTF-8' ?> <soap-env:Envelope xmlns:soap-env='http://schemas.xmlsoap.org/soap/envelope/' xmlns:tns='salesforce' xmlns:types='salesforce/encodedTypes' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' soap-env:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'> <soap-env:Header> <headerStruct> <version type='string'>2.0</version> </headerStruct> </soap-env:Header> <soap-env:Body> <tns:login xmlns:tns='sfconnector:SalesforceConnector' type='methodCall'> <username type='string'>USERNAME</username> <password type='string'>passwdandtoken</password> </tns:login> </soap-env:Body> </soap-env:Envelope>"

...And the response is:

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode><faultstring>No operation available for request {sfconnector:SalesforceConnector}login</faultstring></soapenv:Fault></soapenv:Body></soapenv:Envelope>

Thanks in advance for any help.

Best Answer chosen by Admin (Salesforce Developers) 
kevindotcarkevindotcar

Sorry - my misrtake - should have used the partner WSDL.

 

 

All Answers

SuperfellSuperfell

The namespaces are wrong in your request xml. see the example requests in the wiki for reference.

kevindotcarkevindotcar

Thank you Simon -that was helpful.

I'm able to log on, but DescribeSObject still fails.

 

I'm trying to hit out enterprise server:  https://test.salesforce.com/services/Soap/u/20.0

 

Login is OK and returns a SessionID and server:

https://na11-api.salesforce.com/services/Soap/u/20.0/00DG0000000BmQx

 

My Describe Object looks like:

  <soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'
      xmlns:xsd='http://www.w3.org/2001/XMLSchema'
      xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
  <soapenv:Header>
     <ns1:SessionHeader soapenv:mustUnderstand='0' xmlns:ns1='urn:enterprise.soap.sforce.com'>
     <ns2:sessionId xmlns:ns2='urn:enterprise.soap.sforce.com'>fvety54f56135b44f46y4y46y4hf.rh4</ns2:sessionId>
     </ns1:SessionHeader>
  </soapenv:Header>
  <soapenv:Body>   
  <describeSObject xmlns='urn:enterprise.soap.sforce.com'>
  <sObjectType>Account</sObjectType>
  </describeSObject>
  </soapenv:Body>
  </soapenv:Envelope>

 

...But response is in error:

<?xml version="1.0" encoding="UTF-8"?>

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

<soapenv:Body><soapenv:Fault><faultcode>soapenv:Client</faultcode>

<faultstring>No operation available for request {urn:enterprise.soap.sforce.com}describeSObject</faultstring></soapenv:Fault></soapenv:Body>
</soapenv:Envelope>

 

...I just find it strange that the Login goes fine, but the describe crashes.

 

SuperfellSuperfell

You're sending an enterprise API request to the partner API endpoint, you need to either switch the enterprise API endpoint, or switch your payload to use the partner API namespaces.

kevindotcarkevindotcar

Sorry - my misrtake - should have used the partner WSDL.

 

 

This was selected as the best answer