当前位置: 代码迷 >> Web Service >> Webservice真是难于理解啊神奇的WDSL,请解答下小弟我的疑惑
  详细解决方案

Webservice真是难于理解啊神奇的WDSL,请解答下小弟我的疑惑

热度:193   发布时间:2016-05-02 02:21:57.0
Webservice真是难于理解啊,神奇的WDSL,请解答下我的疑惑!
用WCF做了个SVC的Webservice,
贴出WDSL返回的XML文件如下:

奇怪的是,在客户端VS.NET程序中添加这个XML的链接的Webservice引用,就能生成这个Webservice的调用的客户端代理类,很神奇的是,这个生成的客户端代理类,居然知道webservice的GetNewestAWOSData方法调用需要传入两个参数!但是从WDSL文件来看,没有什么地方能看出这个方法需要几个什么类型的参数来调用啊?

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://135.35.6.149" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" name="Service1" targetNamespace="http://tempuri.org/">
<wsdl:import namespace="http://135.35.6.149" location="http://135.35.6.149/test2/Service1.svc?wsdl=wsdl0"/>
<wsdl:types/>
<wsdl:binding name="BasicHttpBinding_Service1" type="i0:Service1">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="ShowName">
<soap:operation soapAction="http://135.35.6.149/Service1/ShowName" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetNewestAWOSData">
<soap:operation soapAction="http://135.35.6.149/Service1/GetNewestAWOSData" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Service1">
<wsdl:port name="BasicHttpBinding_Service1" binding="tns:BasicHttpBinding_Service1">
<soap:address location="http://135.35.6.149/test2/Service1.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
------解决方案--------------------
你看下web.config中是否配置了这些参数。
------解决方案--------------------
我觉得凡是与XML扩展扯上关系的标准都是繁琐与沉重的,所以我从来不主动为XML写程序,尽可能使用json替代它。
------解决方案--------------------
http://135.35.6.149/test2/Service1.svc?xsd=xsd0
http://135.35.6.149/test2/Service1.svc?xsd=xsd1
  相关解决方案