Hi Plum
I have a requirement where I need to call a SOAP API and fetch few response fields.
Going through other Posts I see that Plum recommends to use <data> tag.
But how do we send request parameters & set request header for SOAP API call.
Is there any example implementation that I can refer to?
We've Moved! Please visit our new and improved forum over at our new portal: https://portal.plumvoice.com/hc/en-us/community/topics
How to call SOAP API using VXML?
Re: How to call SOAP API using VXML?
Hi Vikas,
Headers are supported but there is no SOAP method in vxml.
Regards,
Plum Support
Headers are supported but there is no SOAP method in vxml.
Regards,
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com
Re: How to call SOAP API using VXML?
Do you mean that I cannot call SOAP API using <data> tag?
If not what are my options? Let me know. Thanks.
If not what are my options? Let me know. Thanks.
Re: How to call SOAP API using VXML?
Hi Vikas,
That is correct. It is not possible to use a SOAP API using the <data> tag.
We recommend that you use some web scripting language to connect to your SOAP API and generate a valid VXML response based on the result. Here is an simple example in PHP:
start.vxml:
webservice.php:
Regards,
Plum Support
That is correct. It is not possible to use a SOAP API using the <data> tag.
We recommend that you use some web scripting language to connect to your SOAP API and generate a valid VXML response based on the result. Here is an simple example in PHP:
start.vxml:
Code: Select all
<?xml version="1.0"?>
<vxml version="2.0">
<var name="account_number"/>
<form>
<field name="account" type="digits">
<prompt>
Please enter your account number.
</prompt>
<filled>
<assign name="account_number" expr="account"/>
<submit next="webservice.php" method="post" namelist="account_number" />
</filled>
</field>
</form>
</vxml>
Code: Select all
<?php
header("Content-type: text/xml");
echo("<?xml version=\"1.0\"?>\n");
// get the variables posted to this script
$account_number = $_POST['account_number'];
// connect to SOAP webservice
$soap_url = "http://someurl.to/your/wsdl";
$client = new SoapClient($soap_url);
$params = array(
'AccountNum' => $account_number
);
$response = $client->validate($params); //TRUE or FALSE
?>
<vxml version="2.0">
<form>
<block>
<prompt>
<? if ($response): ?>
Your account is valid.
<? else: ?>
Your accound is invalid.
<? endif; ?>
</prompt>
<exit/>
</block>
</form>
</vxml>
Plum Support
Plum Support
http://www.plumvoice.com
http://www.plumvoice.com