Activity › Forums › Salesforce® Discussions › What are the elements of a SOAP message in Salesforce?
Tagged: Envelope Element, Salesforce Authentication, Salesforce SOAP API, SOAP elements, SOAP Message, XML Document
-
What are the elements of a SOAP message in Salesforce?
Posted by Sanjana on July 13, 2018 at 12:48 PMWhat are the elements of a SOAP message in Salesforce?
Aman replied 7 years, 7 months ago 4 Members · 3 Replies -
3 Replies
-
Hi Sanjana,
A SOAP message is an ordinary XML document containing the following elements:
- An Envelope element that identifies the XML document as a SOAP message
- A Header element that contains header information
- Body element that contains call and response information
- A Fault element containing errors and status information
Thanks.
- [adinserter block='9']
-
elements of a SOAP message in Salesforce
urn: LoginScopeHeader: element concern the authentication of Self-Service and Customer Portal users.
urn:login: element in the message body.
urn:password: element in the password body.
Thanks
-
Hi,
Here’s the code to send SOAP message in Salesforce:
Http h = new Http();
HttpRequest req = new HttpRequest();
req.setMethod(‘POST’);
req.setHeader(‘Accept-Encoding’,’gzip,deflate’);
req.setHeader(‘Content-Type’,’text/xml;charset=UTF-8′);
req.setHeader(‘SOAPAction’, URL);
req.setHeader(‘User-Agent’,’Jakarta Commons-HttpClient/3.1′);
Blob headerValue = Blob.valueOf(USERNAME + ‘:’ + PASSWORD);
String authorizationHeader = ‘BASIC ‘ + EncodingUtil.base64Encode(headerValue);
req.setHeader(‘Authorization’, authorizationHeader);
req.setEndpoint(CustomerCheck__c.getAll().get(‘endpoint’).value__c);
String requestString = ‘<<SOAP MESSAGE>>’;
req.setHeader(‘Content-Length’,String.valueOf(requestString.length()));
req.setBody(requestString);
h.send(req);
Thanks.
Log In to reply.