asp中如何调用wdsl webservice接口
是java写的,大致如下:<?xmlversion="1.0"encoding="UTF-8"?>-<wsdl:definitionstargetNamespace="h...
是java写的,大致如下:
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://server.ws.trp.ac.cn" xmlns:tns="http://server.ws.trp.ac.cn" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://entity.ws.trp.ac.cn" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server.ws.trp.ac.cn">
- <xsd:element name="getJsList1">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in1" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in2" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in3" type="xsd:int" />
<xsd:element maxOccurs="1" minOccurs="1" name="in4" type="xsd:int" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
</wsdl:definitions>
麻烦请给出详细说明,最好有例子,如满意另加100分 展开
<?xml version="1.0" encoding="UTF-8" ?>
- <wsdl:definitions targetNamespace="http://server.ws.trp.ac.cn" xmlns:tns="http://server.ws.trp.ac.cn" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope" xmlns:ns1="http://entity.ws.trp.ac.cn" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding" xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
- <wsdl:types>
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server.ws.trp.ac.cn">
- <xsd:element name="getJsList1">
- <xsd:complexType>
- <xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="in0" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in1" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in2" nillable="true" type="xsd:string" />
<xsd:element maxOccurs="1" minOccurs="1" name="in3" type="xsd:int" />
<xsd:element maxOccurs="1" minOccurs="1" name="in4" type="xsd:int" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
</wsdl:definitions>
麻烦请给出详细说明,最好有例子,如满意另加100分 展开
2个回答
展开全部
asp可以调用asp.net编写webservice接口。
1、webservice的配置文件web.config的system.web节点添加如下代码
<webServices>
<protocols>
<add name="HttpPost"/>
<add name="HttpGet"/>
</protocols>
</webServices>
2、asp代码
dim url,soaprequest,retvalue
url=webservice的地址
'下面是webservice的参数
soaprequest="checkUser=" & checkUser & "&checkPwd=" & checkPwd & "&linkGuid=" & linkGuid & "&linkPhone=" & linkPhone
set xmlhttp = server.createobject("msxml2.xmlhttp")
xmlhttp.open "post",url,false
xmlhttp.setrequestheader "content-type", "application/x-www-form-urlencoded"
xmlhttp.setrequestheader "host",host
xmlhttp.setrequestheader "content-length",len(soaprequest)
xmlhttp.send(soaprequest)
if xmlhttp.status = 200 then
set xmldoc = server.createobject("msxml2.domdocument")
xmldoc.load(xmlhttp.responsexml)
'xmldoc是接收了webservice返回的xml内容,如果webservice返回的不是xml,就用xmlhttp.responsetext
else
‘调用webservice失败
end if
set xmlhttp = nothing
1、webservice的配置文件web.config的system.web节点添加如下代码
<webServices>
<protocols>
<add name="HttpPost"/>
<add name="HttpGet"/>
</protocols>
</webServices>
2、asp代码
dim url,soaprequest,retvalue
url=webservice的地址
'下面是webservice的参数
soaprequest="checkUser=" & checkUser & "&checkPwd=" & checkPwd & "&linkGuid=" & linkGuid & "&linkPhone=" & linkPhone
set xmlhttp = server.createobject("msxml2.xmlhttp")
xmlhttp.open "post",url,false
xmlhttp.setrequestheader "content-type", "application/x-www-form-urlencoded"
xmlhttp.setrequestheader "host",host
xmlhttp.setrequestheader "content-length",len(soaprequest)
xmlhttp.send(soaprequest)
if xmlhttp.status = 200 then
set xmldoc = server.createobject("msxml2.domdocument")
xmldoc.load(xmlhttp.responsexml)
'xmldoc是接收了webservice返回的xml内容,如果webservice返回的不是xml,就用xmlhttp.responsetext
else
‘调用webservice失败
end if
set xmlhttp = nothing
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询