We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics

WebService

Questions and answers about IVR programming for Plum DEV

Moderators: admin, support

Post Reply
dnagel
Posts: 18
Joined: Sat Feb 08, 2014 10:18 am

WebService

Post by dnagel »

Hello,

New to Plum Voice.

I'm trying to pull a UStmtBal from a webservice response.
In the example below, I am trying to grab the 332.04 value.

Script:
------------
<?xml version="1.0"?>
<vxml version="2.1">
<form>
<data name="thedata" src="http://10.5.35.40/csp/test1/BAR.WS.Gen. ... id=5167565"/>
<block>
Your balance is <value expr="thedata.documentElement.childNodes.item(0).getElementsByTagName('UStmtBal')"/>.
</block>
</form>
</vxml>

WebService:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<UStatementBalanceResponse xmlns="http://mytestserver/cb/BAR.WS.Gen.Account">
<UStatementBalanceResult>
<AccountUStatementBalance>
<AccountUStatementBalance>
<UStmtBal>332.04</UStmtBal>
</AccountUStatementBalance>
</AccountUStatementBalance>
</UStatementBalanceResult>
</UStatementBalanceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

support
Posts: 3632
Joined: Mon Jun 02, 2003 3:47 pm
Location: Boston, MA
Contact:

Re: WebService

Post by support »

To grab the 332.04, your <value> tag needs to looks like this:

Code: Select all

<value expr="thedata.documentElement.firstChild.firstChild.firstChild.firstChild.firstChild.firstChild.firstChild.toString()"/>
This is because 332.04 is nested inside 7 tags in the SOAP's return.

dnagel
Posts: 18
Joined: Sat Feb 08, 2014 10:18 am

Re: WebService

Post by dnagel »

Thank you, I did finally figure this out. I didn't realize this posting went through as I never saw anything that indicated it was created, otherwise I would have removed the posting (if that is possible).

Thanks anyway.

Don

Post Reply