Html5 & JavaScript

Xml to String : Html

posted Sep 26, 2013, 1:46 AM by Akash Khaitan   [ updated Sep 26, 2013, 1:47 AM ]

xhttp=new XMLHttpRequest();
xhttp.open("GET","books.xml",false);
xhttp.send();
xmlDoc=xhttp.responseXML;        


xmlDocstr=(new XMLSerializer()).serializeToString(xmlDoc);      //Xml to String

Posting XML as a parameter to a SOAP WebService Method

posted Sep 26, 2013, 1:03 AM by Akash Khaitan   [ updated Sep 26, 2013, 1:05 AM ]

Convert xml to string & enclose it with CDATA, paas it as webservice parameter

For Example
    xhttp=new XMLHttpRequest();
    xhttp.open("GET","books.xml",false);
    xhttp.send();
    xmlDoc=xhttp.responseXML;                                                  //Get XML
    xmlDocstr=(new XMLSerializer()).serializeToString(xmlDoc);                // XML to String
    xmlDocstr=   "<![CDATA[" + xmlDocstr + "]]>";                               

Now use this for as a parameter in webservice


By Andy Lewisohn
http://blog.arc90.com/2008/03/26/posting-xml-as-a-parameter-to-a-soap-webservice-method/

CDATA Reference
http://www.w3schools.com/xml/xml_cdata.asp



1-2 of 2