Topic: Web Service Response Format and Debugging

The following is an example of what my web service returns. For some reason, the Get row from Stack module does not get a row back using the exact same request/parameters used to get the below response. Is there a way to see what the IVR app sees when the service is called during a test run? I feel like I'm stabbing at something in the dark...the path it's taking is No row to fetch, but I can't tell if the IVR app just isn't getting the right format to be able to determine what is a row in the response. Help will be very much appreciated.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <AuthenticateResponse xmlns="http://schema.tri-ad.com/2012/03/">
         <AuthenticateResult>
            <ClientEntityId>4</ClientEntityId>
            <UserId>jXZsp</UserId>
            <Email/>
            <UserName/>
            <SessionId>16f98268-7fce-46ce-aae0-fc60f87ec3f6</SessionId>
            <IsAbort xsi:nil="true"/>
            <IsValidLogin>true</IsValidLogin>
            <IsSessionEstablished>false</IsSessionEstablished>
            <IsInvalidRequest xsi:nil="true"/>
            <ResponseCode>0</ResponseCode>
            <IsCaseManagement xsi:nil="true"/>
         </AuthenticateResult>
      </AuthenticateResponse>
   </soap:Body>
</soap:Envelope>

Re: Web Service Response Format and Debugging

To debug webservice integration, you would use prompt modules to say aloud the data you're getting back.

Are you using Fetch from URL or SOAP webservice dialog? Also, which elements specifically are you trying to access? To facilitate debugging, please share you application with this account (username: admin)

Re: Web Service Response Format and Debugging

I just shared with username admin. I'm hitting a SOAP end-point, which has been tested using the values being passed in the IVR app. I have Say Variable modules coming off the Get Row from Stack module for UserId, IsValidLogin, and SessionId. I have a Simple Prompt connected to the No row to fetch path of the Get Row from Stack module, and that is where the app is going when I call. I actually plugged hard-coded values into the SOAP module just to eliminate user input as a point of failure.

Not sure what to do at this point...

Thanks for your help!

-Jason

Re: Web Service Response Format and Debugging

Hi Jason,

Your webservice is returning a complex object, which Fuse does not support. Please note that Plum Fuse supports return types that are simple, e.g., string or integer, or simple objects, or an array of simple objects. Objects with member variables that are also objects are not supported.

Re: Web Service Response Format and Debugging

I have a huge favor to ask. Can somebody take the XML I pasted into my first post and give me an example of an acceptable structure using the same data?

Many thanks....

Re: Web Service Response Format and Debugging

The XML for your return as a simple object would look like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <SOAP-ENV:Body>
    <ns1:testResponse>
      <return xsi:type="SOAP-ENC:Struct">
    <ClientEntityId xsi:type="xsd:int">4</ClientEntityId>
    <UserId xsi:type="xsd:string">jXZsp</UserId>
    <Email xsi:nil="true"/>
    <UserName xsi:nil="true"/>
    <SessionId xsi:type="xsd:string">16f98268-7fce-46ce-aae0-fc60f87ec3f6</SessionId>
    <IsAbort xsi:nil="true"/>
    <IsValidLogin xsi:type="xsd:boolean">true</IsValidLogin>
    <IsSessionEstablished xsi:type="xsd:boolean">false</IsSessionEstablished>
    <IsInvalidRequest xsi:nil="true"/>
    <ResponseCode xsi:type="xsd:int">0</ResponseCode>
    <IsCaseManagement xsi:nil="true"/>
      </return>
    </ns1:testResponse>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Hope this helps!

Re: Web Service Response Format and Debugging

I'm wondering if you have any clients using .Net to expose web services to your IVR platform? I'm in a bit of a catch-22. You can return a structure that does not have the wrapper node using [SoapDocumentMethod(ParameterStyle = SoapParameterStyle.Bare)] for the [WebMethod], but it does not conform -- the biggest problem is that you can only pass in a single object, not a set of parameters, which I don't think the IVR platform is capable of doing. So I'm still trying to figure out how to expose a soap response that's acceptable to the IVR platform.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <AuthenticateResponse xmlns="http://schema.tri-ad.com/2012/03/">
         <AuthenticateResult>
...........
         </AuthenticateResult>
      </AuthenticateResponse>
   </soap:Body>
</soap:Envelope>

Re: Web Service Response Format and Debugging

Would JSON output be more acceptable?

Re: Web Service Response Format and Debugging

We don't have any .NET examples, but if you are having trouble formatting your SOAP web return, you may return JSON. You would use the "Fetch from URL" module, and instead of a SOAP webservice, you would be writing a REST webservice that returns JSON.

Re: Web Service Response Format and Debugging

So we've cut over to using JSON. Having trouble accessing the values and objects. I'm wondering if every property and value in the JSON needs to be surrounded by quotes, even if a value is a number or a boolean?

Re: Web Service Response Format and Debugging

Here is the JSON structure we're trying to access. We've tried using Extract One Value with .Auth.ClientEntityId -- no result. We also tried Object to Stack, and referencing the members of Auth to no avail.

{"Auth": {"ClientEntityId":4,"UserId":"jXZsp","Email":"","UserName":"","SessionId":"e64474da-0360-4d68-b832-be2dd6f98605","IsValidLogin":true,"IsSessionEstablished":false,"IsInvalidRequest":false,"ResponseCode":0}}

Re: Web Service Response Format and Debugging

Figured this out. The Fetch from URL module was appending a ? to the end of the RESTful URL, so the last parameter, which is used for a lookup, was including the ? as the last character in its value.

I believe this post can be closed at this point.

Thanks for the help....