jQuery.webservice=function(a){try{var c={requestType:"soap1.1",error:function(e,g,f){throw e.responseText}};$.extend(c,a);var b=new Array();if(c.requestType=="soap1.1"||c.requestType=="soap1.2"){c.nameSpace+=(c.nameSpace.length-1==c.nameSpace.lastIndexOf("/"))?"":"/"}switch(c.requestType){case"soap1.2":c.methodType="POST";c.contentType="application/soap+xml";b.push("<soap12:Envelope ");b.push('xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ');b.push('xmlns:xsd="http://www.w3.org/2001/XMLSchema" ');b.push('xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">');b.push("<soap12:Body>");b.push("<"+c.methodName+' xmlns="'+c.nameSpace+'">');for(key in c.data){if(key!="length"&&typeof(c.data[key].prototype)=="undefined"){b.push("<"+key+">"+c.data[key]+"</"+key+">")}}b.push("</"+c.methodName+">");b.push("</soap12:Body>");b.push("</soap12:Envelope>");c.requestData=b.join("");break;case"httpget":c.methodType="GET";c.contentType="text/xml";for(key in c.data){if(key!="length"&&typeof(c.data[key].prototype)=="undefined"){b.push(key+"="+c.data[key])}}c.url+=("/"+c.methodName+"?"+b.join("&"));c.requestData="";break;case"httppost":c.methodType="POST";c.contentType="application/x-www-form-urlencoded";for(key in c.data){if(key!="length"&&typeof(c.data[key].prototype)=="undefined"){b.push(key+"="+c.data[key])}}c.url+=("/"+c.methodName);c.requestData=b.join("&");break;default:c.requestType="soap1.1";c.methodType="POST";c.contentType="text/xml";b.push("<soap:Envelope ");b.push('xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ');b.push('xmlns:xsd="http://www.w3.org/2001/XMLSchema" ');b.push('xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">');b.push("<soap:Body>");b.push("<"+c.methodName+' xmlns="'+c.nameSpace+'">');for(key in c.data){if(key!="length"&&typeof(c.data[key].prototype)=="undefined"){b.push("<"+key+">"+c.data[key]+"</"+key+">")}}b.push("</"+c.methodName+">");b.push("</soap:Body>");b.push("</soap:Envelope>");c.requestData=b.join("");break}$.ajax({type:c.methodType,cache:false,url:c.url,data:c.requestData,contentType:c.contentType,dataType:c.dataType,success:c.success,error:c.error,beforeSend:function(e){if(c.requestType=="soap1.1"||c.requestType=="soap1.2"){e.setRequestHeader("SOAPAction",c.nameSpace+c.methodName)}e.setRequestHeader("Content-Length",c.requestData.length)}})}catch(d){alert("Error occurred in jquery.webservice.js.")}};
