给你个soap,xml格式的,该怎么调用啊?POST /WebSite1/WebService.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/HelloWorld"<?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>
    <HelloWorld xmlns="http://tempuri.org/">
      <name>string</name>
      <pwd>string</pwd>
    </HelloWorld>
  </soap:Body>
</soap:Envelope>
大哥帮下忙,很急!

解决方案 »

  1.   

    POST /WebSite1/WebService.asmx HTTP/1.1 
    Host: localhost 
    ----------------------------------------------
    从这个位置可以看出是个webservice<soap:Body> 
        <HelloWorld xmlns="http://tempuri.org/"> 
          <name>string </name> 
          <pwd>string </pwd> 
        </HelloWorld> 
      </soap:Body> 
    -----------------------------
    上面是方法参数
    原形应该是HelloWorld(string name,string pwd);
    具体代码看怎么调用websercie
      

  2.   


    function PostRequestData(URL,data){ 
    var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); 
    xmlhttp.Open("POST",URL, false); 
    xmlhttp.SetRequestHeader ("Content-Type","text/xml; charset=utf-8"); 
    xmlhttp.SetRequestHeader ("SOAPAction","http://tempuri.org/myService/test/isNumner"); 
    try { 
    xmlhttp.Send(data); 
    var result = xmlhttp.status; 

    catch(ex) { 
    return( ex.description + "|" + ex.number); 

    if(result==200) { 
    return( xmlhttp.responseText); 

    xmlhttp = null; 

    function loadit(value){ 
    var url = 'http://localhost/myService/test.asmx'; 
    var data ; 
    var r; 
    data = '<?xml version="1.0" encoding="utf-8"?>'; 
    data = data + '<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/">'; 
    data = data + '<soap:Body>'; 
    data = data + '<isNumner xmlns="http://tempuri.org/myService/test">'; 
    data = data + '<str>'+value+'</str>'; 
    data = data + '</isNumner>'; 
    data = data + '</soap:Body>'; 
    data = data + '</soap:Envelope>'; 
    r=PostRequestData(url,data); 
    document.write(r); 

    loadit('5'); 
    </script> 参考