Activity Forums Salesforce® Discussions What are the elements of a SOAP message in Salesforce?

  • Avnish Yadav

    Member
    August 2, 2018 at 1:39 pm

    Hi Sanjana,

    A SOAP message is an ordinary XML document containing the following elements:

    1. An Envelope element that identifies the XML document as a SOAP message
    2. A Header element that contains header information
    3. Body element that contains call and response information
    4. A Fault element containing errors and status information

    Thanks.

  • Parul

    Member
    September 14, 2018 at 5:14 am

    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

     

     

  • Aman

    Member
    September 29, 2018 at 4:37 pm

    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.

Popular Salesforce Blogs

Popular Salesforce Videos