Advertisement
Guest User

Untitled

a guest
Nov 15th, 2011
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function beginTest()
  2. {
  3.     var mess = '<?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><Echo xmlns="http://blahblah.com/Services/"><s>string</s></Echo></soap:Body></soap:Envelope>';
  4.     var service = '/services-1.0/Test.asmx/Echo';
  5.  
  6.     $.ajax({
  7.         url: service,
  8.         type: "POST",
  9.         dataType: "xml",
  10.         data: mess,
  11.         complete: endTest,
  12.         error: processError,
  13.         contentType: "text/xml"
  14.     });
  15.  
  16.     return false;
  17. }
  18.  
  19. function endTest(xmlHttpRequest, status)
  20. {
  21.     $(xmlHttpRequest.responseXML).find('string').each(function()
  22.         {
  23.             var name = $(this).text();
  24.             document.getElementById("myDiv").innerHTML = name;
  25.         }
  26.     );
  27. }
  28.  
  29. function processError(data, status, req) {
  30.     document.getElementById("myDiv").innerHTML = req.responseText + " " + status + " " + req;
  31. }
  32.  
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement