Hi, I have created a REST web service using WCF and use HTTP Post Method. The request and response objects are all plain xml. Like the response object is:
<Response xmlns="http://WebService/WCF" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<Approved>true</Approved>
<ApprovedCode>OK242C0010063439: X:</ApprovedCode>
<ValidationLogID>106</ValidationLogID>
<OrderNumber>D1FB8F95-4B50B216-295-14442</OrderNumber>
<RetString>Approval Code: OK242C0010063439: X:</RetString>
</Response>
Now the Client ask us to change the format to VoiceXML format like below:
<?xml version="1.0" ?>
<vxml version="2.0" xmlns="http://www.w3.org/2001/vxml">
<form id="Response">
<var name="Approved" expr="'true'" />
<var name="RetString" expr="'Approval Code: OK242C0010063439: X:'" />
<var name="ApprovedCode" expr="'OK242C0010063439: X:'" />
<var name="ValidationLogID" expr="'106'" />
<var name="OrderNumber" expr="'D1FB8F95-4B50B216-295-14442'" />
<block>
<return namelist="Approved RetString ApprovedCod ValidationLogID OrderNumber" />
</block>
</form>
</vxml>
I am wondering if there is a simple way to do this transformation. Currently what I am thinking is to build and return an plain string instead of XML for the response object.
Thank you for your help! :)