asp去ms下载一个工具包,名字忘了你查查,服务器上注册后就可以了

解决方案 »

  1.   

    不知道对你有没有用处,我学webService时一段测试javascript代码
    function test()
    {
    var strSend = "<?xml version=\"1.0\" encoding = \"utf-8\"?>";
    strSend += "<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/\">";
    strSend += "<soap:Body>";
    strSend += "<To3 xmlns=\"http://tempuri.org/\">";
    strSend += "<TC>" + document.all.TC.value + "</TC>";
    strSend += "</To3>";
    strSend += "</soap:Body>";
    strSend += "</soap:Envelope>";

    document.all.txtDisplay.innerText = strSend;
    var httpMain=new ActiveXObject("Microsoft.XMLHTTP");
    httpMain.Open("POST", "http://localhost/demo/22/TestService.asmx",false);
    httpMain.setRequestHeader("Content-Type","text/xml");
    httpMain.setRequestHeader("SOAPAction","http://tempuri.org/To3");//To3()是调用的方法
    httpMain.Send(strSend);
    if (httpMain.responseXML.xml!='')
    {
    document.all.txtDisplay2.innerText = httpMain.responseXML.xml;
    }
    }