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
Travis HendrixTravis Hendrix 

No operation available for request {urn:enterprise.soap.sforce.com}describeSObject

I am trying to figure out how to use the Rest-Api.  I am getting the error No operation available for request {urn:enterprise.soap.sforce.com}describeSObject I am not sure what I am doing wrong.
HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setMethod('GET');
req.setHeader('Content-Type', 'text/xml');
req.setHeader('SOAPAction', 'describeSObject');
//req.setHeader('Authorization', 'OAuth'+UserInfo.getSessionId());



String b = '';
b += '<?xml version="1.0" ?>';
b += '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:enterprise.soap.sforce.com">';
b += '<soapenv:Header>';
b += '<urn:SessionHeader>';
b += '<urn:sessionId>'+UserInfo.getSessionId()+'</urn:sessionId>';
b += '</urn:SessionHeader>';
b += '</soapenv:Header>';
b += '<soapenv:Body>';
b += '<urn:describeSObject>';
b += '<urn:sObjectType>Account</urn:sObjectType>';
b += '</urn:describeSObject>';
b += '</soapenv:Body>';
b += '</soapenv:Envelope>';

req.setBody(b);
req.setCompressed(false);
req.setEndpoint('https://na34.salesforce.com/services/Soap/u/25.0');
HTTPResponse resp = h.send(req);
System.debug(resp.getBody());

 
Best Answer chosen by Travis Hendrix
scottbcovertscottbcovert

Hi Travis, try changing "Soap/u/25.0" to "Soap/c/25.0" as I believe u specifies the partner WSDL and it looks like you're trying to use the enterprise WSDL

All Answers

scottbcovertscottbcovert

Hi Travis, try changing "Soap/u/25.0" to "Soap/c/25.0" as I believe u specifies the partner WSDL and it looks like you're trying to use the enterprise WSDL
This was selected as the best answer
Travis HendrixTravis Hendrix
thank you that is exactly what I needed.  I finally found where the WSDL lists that so in the future I can find it.  Sometimes it is just a nudge down the correct path.