alibasha syed

alibasha syed

  • NA
  • 92
  • 34.3k

How to Generate XML with C Data and other Nodes.

Nov 27 2013 8:39 AM

Hi,

     I need to do XML serialization on one object and return string. I did that successfully, which is displayed below...

12 <ISO>         <Businesstype>021000</Businesstype> <AgencyId>P</AgencyId>........               </ISO>


But I need that to be generated as in the below format...

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">


 <soapenv:Header/>                                                                                                                                         

<soapenv:Body>


 <tem:GetResponseXmlForAplus>        

<!--Optional:-->

         <tem:requestXml>

<![CDATA[<?xml version="1.0" encoding="UTF-8"?>


<ISO>        

<Businesstype>021000</Businesstype>

  <AgencyId>P</AgencyId>......     

 </ISO>]]>

</tem:requestXml>     

</tem:GetResponseXmlForAplus>


   </soapenv:Body>

</soapenv:Envelope>

Because I need to pass this XML request to some other service. Please help me in this regard as soon as possible. Thanks in advance.