方法
〈form target="_blank" action='http://www.ydcom.net/service/S_COMM.asmx/GetCZID' method="POST"〉〈table cellspacing="0" cellpadding="4" frame="box" bordercolor="#dcdcdc" rules="none" style="border-collapse: collapse;"〉〈tr〉〈td class="frmHeader" background="#dcdcdc" style="border-right: 2px solid white;"〉参数〈/td〉〈td class="frmHeader" background="#dcdcdc"〉值〈/td〉〈/tr〉 〈tr〉〈td class="frmText" style="color: #000000; font-weight: normal;"〉sTypeNum:〈/td〉〈td〉〈input class="frmInput" type="text" size="50" name="sTypeNum"〉〈/td〉〈/tr〉〈tr〉〈td〉〈/td〉〈td align="right"〉 〈input type="submit" value="调用" class="button"〉〈/td〉〈/tr〉〈/table〉〈/form〉
相关文档: 使用vbscript脚本调用web服务
<%Dim url,xmlhttp,dom,node,xmlDOC'根据webservice的测试页不同的方法构造不同的soap requestSoapRequest = ""& _"
If xmlhttp.Status = 200 ThenxmlDOC.load(xmlhttp.responseXML) Response.Write xmlhttp.Status&""Response.Write xmlhttp.StatusText&"执行结果为:"Response.Write xmlDOC.getElementsByTagName("GetCZIDResult")(0).textelseResponse.Write xmlhttp.Status&""Response.Write xmlhttp.StatusTextend if%>
实例:如何使用asp调用服务产生18位关键值 asp源文件代码
说明:总的来讲采用webservice的列表页说明来构造不同的SoapRequest,然后,从返回xmlDoc中取返回值xmlDOC.getElementsByTagName
<%Set objHTTP = Server.CreateObject("MSXML2.XMLHTTP")Set xmlDOC =Server.CreateObject("MSXML.DOMDocument")strWebserviceURL = "http://www.ydcom.net/service/S_COMM.asmx/GetCZID"'设置参数及其值strRequest = "sTypeNum=311"objHTTP.Open "POST", strWebserviceURL, False'设置这个Content-Type很重要objHTTP.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"objHTTP.SetRequestHeader("Content-Length: 30")objHTTP.Send(strRequest)bOK = xmlDOC.load(objHTTP.responseXML)'看看状态值if objHTTP.Status=200 then xmlStr = xmlDOC.xmlResponse.Write xmlStrelseResponse.Write objHTTP.Statu&""Response.Write objHTTP.StatusTextend if%>
实例:如何使用asp调用服务产生18位关键值 asp源文件代码
Dim strxml As StringDim str As Stringstr = Text2.Text'定义soap消息strxml = "
1,首先添加web引用,地址为:http://www.ydcom.net/service/s_comm.asmx
2,定义:dim sCom as New net.ydcom.www.S_COMM
3,调用:dim strCZID as string = sComm.GetCZID("313")
实例:如何使用VB.NET调用服务产生18位关键值 VB.NET源文件代码
SoapConnection conn Test_wsservice1soap sComlong rVal //string str_endpoint //str_endpoint = "http://www.ydcom.net/service/s_comm.asmx?WSDL" conn = create SoapConnection rVal = Conn.CreateInstance(sCom, "test_wsservice1soap") sle_1.text = sCom.GetCZID("313")) destroy conn
