怎样使用这个WSDL文件?(急求答案
我现在有了一个WSDL文件WMLP.WSDL,我按照这个网页http://www.newasp.net/tech/net/11374.html上的步骤在解决方案中添加了它的web引用,其中应该是包括WMLP_GetBaseMsg ( ) 、WMLP_GetCap ( ) 、WMLP_GetVersion ( ) 、WMLP_Subscribe ( ) 四个方法。我想知道我要不要自己完成这些方法的实现代码,如果需要的话在哪里写?
我在代码中是这样引用其中的方法的,不知道对不对?
WITSML_Publish.WMLP a = new WITSML_Publish.WMLP{};
a.WMLP_GetBaseMsg(……);
a.WMLP_GetCap(……);
a.WMLP_GetVersion(……);
a.WMLP_Subscribe(……);
网上说的使用wsdl的方法和上面那个链接中说的方法顺序一般都是反的:先创建web服务项目、编写代码再生成动态库。我想知道有了wsdl后,怎样完成对应的web service方法,自己编写么?
另外帮忙推荐本适合新手看的web service教程,.net实现的,最好讲的全面一些。
WMLP.WSDL中内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="WMLP" targetNamespace="http://www.witsml.org/wsdl/120" xmlns:wsdlns="http://www.witsml.org/wsdl/120" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/">
<documentation>WITSML Version 1.2.0 PUBLISH interface WSDL file
</documentation>
<!-- Abstract Definitions Section - <types>, <message> and <portType> elements -->
<!-- <types> element declares user-defined machine and language independent data types, and is not needed for the WITSML PUBLISH interface, which uses only W3C-defined data types -->
<!-- <message> elements define request/response messages and their parameters-->
<message name="Publish.WMLP_GetBaseMsg">
<part name="ReturnValueIn" type="xsd:short"/>
</message>
<message name="Publish.WMLP_GetBaseMsgResponse">
<part name="Result" type="xsd:string"/>
</message>
<message name="Publish.WMLP_GetCap">
<part name="OptionsIn" type="xsd:string"/>
</message>
<message name="Publish.WMLP_GetCapResponse">
<part name="CapabilitiesOut" type="xsd:string"/>
<part name="SuppMsgOut" type="xsd:string"/>
<part name="Result" type="xsd:short"/>
</message>
<message name="Publish.WMLP_GetVersion">
</message>
<message name="Publish.WMLP_GetVersionResponse">
<part name="Result" type="xsd:string"/>
</message>
<message name="Publish.WMLP_Subscribe">
<part name="SubscriptionIn" type="xsd:string"/>
<part name="OptionsIn" type="xsd:string"/>
<part name="CapabilitiesIn" type="xsd:string"/>
</message>
<message name="Publish.WMLP_SubscribeResponse">
<part name="Result" type="xsd:short"/>
<part name="SubscriptionOut" type="xsd:string"/>
<part name="SuppMsgOut" type="xsd:string"/>
</message>
<!-- <portType> element groups the functions (operations) into an interface -->
<portType name="PublishSoapPort">
<!-- <operation> elements define the function signatures (operation name and parameters) and associate the input and output messages -->
<!-- parameterOrder attribute values must be separated by a single space -->
<operation name="WMLP_GetBaseMsg" parameterOrder="ReturnValueIn">
<input message="wsdlns:Publish.WMLP_GetBaseMsg"/>
<output message="wsdlns:Publish.WMLP_GetBaseMsgResponse"/>
</operation>
<operation name="WMLP_GetCap" parameterOrder="OptionsIn CapabilitiesOut SuppMsgOut">
<input message="wsdlns:Publish.WMLP_GetCap"/>
<output message="wsdlns:Publish.WMLP_GetCapResponse"/>
</operation>
<operation name="WMLP_GetVersion" >
<input message="wsdlns:Publish.WMLP_GetVersion"/>
<output message="wsdlns:Publish.WMLP_GetVersionResponse"/>
</operation>
<operation name="WMLP_Subscribe" parameterOrder="SubscriptionIn OptionsIn CapabilitiesIn SubscriptionOut SuppMsgOut">
<input message="wsdlns:Publish.WMLP_Subscribe"/>
<output message="wsdlns:Publish.WMLP_SubscribeResponse"/>
</operation>
</portType>
<!-- Concrete Definitions Section - <binding> and <service> elements -->
<!-- <binding> specifies the protocol binding for each operation in the <portType> section -->
<binding name="PublishSoapBinding" type="wsdlns:PublishSoapPort">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="WMLP_GetBaseMsg">
<soap:operation soapAction="http://www.witsml.org/action/120/Publish.WMLP_GetBaseMsg"/>
<input>
<soap:body use="encoded" namespace="http://www.witsml.org/message/120" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://www.witsml.org/message/120" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="WMLP_GetCap">
<soap:operation soapAction="http://www.witsml.org/action/120/Publish.WMLP_GetCap"/>
<input>
<soap:body use="encoded" namespace="http://www.witsml.org/message/120" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://www.witsml.org/message/120" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="WMLP_GetVersion">
<soap:operation soapAction="http://www.witsml.org/action/120/Publish.WMLP_GetVersion"/>
<input>
<soap:body use="encoded" namespace="http://www.witsml.org/message/120" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://www.witsml.org/message/120" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="WMLP_Subscribe">
<soap:operation soapAction="http://www.witsml.org/action/120/Publish.WMLP_Subscribe"/>
<input>
<soap:body use="encoded" namespace="http://www.witsml.org/message/120" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="http://www.witsml.org/message/120" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<!-- <service> specifies the portType for each binding and the URL of the service -->
<service name="WMLP">
<port name="PublishSoapPort" binding="wsdlns:PublishSoapBinding">
<soap:address location="http://yourorg.com/yourwebservice"/>
</port>
</service>
</definitions>