当前位置: 代码迷 >> Web前端 >> js调webservice一部分代码
  详细解决方案

js调webservice一部分代码

热度:191   发布时间:2013-09-05 16:02:07.0
js调webservice部分代码
 var ns = "http://cn/javacoder/com/webservices/database/agent";
          	    // build SOAP request  
          	    var sr =   
          	                "<?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>" +  
          	                "<getRealTimeQueueDashboard  xmlns=\"" + ns + "\">" +   
          	                "</getRealTimeQueueDashboard></soap:Body></soap:Envelope>";  
          	    if (!HttpMethod) {  
          	        HttpMethod = "GET";  
          	    }  
          	    req = getXMLHttpRequest();  
          	    if (req) {  
          	        req.open(HttpMethod,url,false);
          	        var soapaction = ((ns.lastIndexOf("/") != ns.length - 1) ? ns + "/" : ns) + "getRealTimeQueueDashboard";  
          	        req.setRequestHeader("SOAPAction", soapaction); 
          	        req.setRequestHeader("Content-Type", "text/xml; charset=utf-8");    
          	        req.send(sr); 
          	        
       	            var returnText = req.responseText;
  相关解决方案