WSDL文件示例
讓我們來研究一下WSDL文件,看看它的結構,以及如何工作。請注意這是一個非常簡單的WSDL文檔實例。我們的意圖只是說明它最顯著的特征。以下的內容中包括更加詳細的討論。
<?xml version="1.0" encoding="UTF-8" ?> <definitions name="FooSample" targetNamespace="http://tempuri.org/wsdl/" xmlns:wsdlns="http://tempuri.org/wsdl/" xmlns:typens="http://tempuri.org/xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:stk="http://schemas.microsoft.com/soap-toolkit/wsdl-extension" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <schema targetNamespace="http://tempuri.org/xsd" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" elementFormDefault="qualified" > </schema> </types> <message name="Simple.foo"> ?。紁art name="arg" type="xsd:int"/> </message> <message name="Simple.fooResponse"> ?。紁art name="result" type="xsd:int"/> </message> <portType name="SimplePortType"> ?。紀peration name="foo" parameterOrder="arg" > ?。糹nput message="wsdlns:Simple.foo"/> ?。紀utput message="wsdlns:Simple.fooResponse"/> ?。?operation> </portType> <binding name="SimpleBinding" type="wsdlns:SimplePortType"> ?。約tk:binding preferredEncoding="UTF-8" /> ?。約oap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> ?。紀peration name="foo"> ?。約oap:operation soapAction="http://tempuri.org/action/Simple.foo"/> ?。糹nput> ?。約oap:body use="encoded" namespace="http://tempuri.org/message/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> ?。?input> ?。紀utput> ?。約oap:body use="encoded" namespace="http://tempuri.org/message/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> ?。?output> ?。?operation> </binding> <service name="FOOSAMPLEService"> ?。紁ort name="SimplePort" binding="wsdlns:SimpleBinding"> ?。約oap:address location="http://carlos:8080/FooSample/FooSample.asp"/> ?。?port> </service> </definitions> |
int foo(int arg); |