You need to sign in to do that
Don't have an account?
Travis 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());
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
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