Webhooks - need help with syntax for parsing the return | Community
Skip to main content
July 15, 2013
Solved

Webhooks - need help with syntax for parsing the return

  • July 15, 2013
  • 7 replies
  • 1994 views
Ok, I have gone through all the documentation and community article and it is NOT obvious what is the syntax for the webhook response syntax.

I have tried the "." method as in the article, XPath type "/" and nothing works.  The webhook call is a success but the field value is never updated.

If this is my webhook return:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soapenv:Body>
      <loginResponse>
         <result>
            <metadataServerUrl>https://cs3.salesforce.com/services/Soap/m/28.0/00DQ00000001SA2</metadataServerUrl>
            <passwordExpired>false</passwordExpired>
            <sandbox>true</sandbox>
            <serverUrl>https://cs3.salesforce.com/services/Soap/c/28.0/00DQ00000001SA2</serverUrl>
            <sessionId>00DQ00000001SA2!ARkAQFY5v3bpC3YJsHQguSgPw.sptBCKnOSidNdEiEl6XtO37Ygv6T3blGfkpnTE4b7fC3ZAcv8myLSsSiTzTAkLySD5xdna</sessionId>
            <userId>005Q000000I229cIAB</userId>

What should the response mapping be to store the sessionId? Xpath? "dot" syntax? from the root or relative to the SoapBody ???

I have tried all of the above with no success. HELP


Cheers,
Dazed and Confused
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by
Fixed in Aug release

7 replies

July 15, 2013
Eric,
You should use the dot syntax from the root of the XML tree.  Please try the following -

soapenv:Envelope.soapenv:Body.loginResponse.result.sessionId

Raj
July 15, 2013
Thanks Raj, I really appricate the help.

Ok tried it.  Same as before. Webhook generates a sucess but the field does not get updated. I think I am going to have to raise a support ticket.

Cheers,
Eric

FYI: 
Here is the activity Details

July 15, 2013
Eric,
Please do so - we'll have someone investigate this asap

Raj
July 15, 2013
Hey Eric,  I am also having a similar problem.  I get the response, but it is not written into the field.  Tech support indicates that they use OGNL to parse responses and spaces are not permitted for Response Attribute names. We're in the process of revising our webservice to use underscores for the Response Attribute names - hopefully that will solve the problem.  I wonder if the slashes in your Response Attribute name are causing a problem?
July 16, 2013
Thanks Elliot,

I was trying to see if they used a XPath type parse but as you point out that is not the case.
 
Posted as support ticket.
 
Case #: 00169748 - (ref:_00D506sHb._50050MlNLU:ref)

Cheers,
Eric
Accepted solution
August 26, 2013
Fixed in Aug release
March 6, 2014
It would be helpful if the fix and solution were documented in this post.