Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <script type="text/javascript">
- function run(){
- var objXMLHttpRequest = new XMLHttpRequest();
- objXMLHttpRequest.open("GET", "http://localhost:8080/CrunchifyWS/services/CrunchifyHelloWorld?wdsl/", true);
- objXMLHttpRequest.onreadystatechange = function () {
- alert(objXMLHttpRequest.readyState+" "+ objXMLHttpRequest.status);
- if (objXMLHttpRequest.readyState == 4 && objXMLHttpRequest.status == 200) {
- result = objXMLHttpRequest.responseXML;
- }
- }
- objXMLHttpRequest.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
- var packet = '<?xml version="1.0" encoding="utf-8" ?><soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><soap:Body> <PieTable xmlns="[getTextResponse(Namespace = "http://service.web.com.crunchify/")]"> <table>Pie</table> </PieTable> </soap:Body></soap:Envelope>';
- objXMLHttpRequest.send(packet);
- // Add mentioned below code only if your application calls webservice synchronously. Otherwise use "onreadystatechange" process response.
- response = objXMLHttpRequest.responseXML;
- alert(objXMLHttpRequest.responseText+ " "+ response);
- }
- </script>
- <head>
- </head>
- <body>
- <button onclick="run()">Dale!</button>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement