?WSDL文件示例?????????????????? <wsdl:definitionsxmlns:xs="http://www.w3.org/2001/XMLSchema" ??????xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" ??????xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" ??????xmlns:tns="http://www.daily-moon.com/classifieds" ??????xmlns:ns1="http://org.apache.axis2/xsd" ??????targetNamespace="http://www.daily-moon.com/classifieds"> ?<wsdl:types> ?<xs:schemaxmlns:xs="http://www.w3.org/2001/XMLSchema" ????????targetNamespace="http://org.apache.axis2/xsd" ????????elementFormDefault="unqualified" ????????attributeFormDefault="unqualified"> ????<xs:elementname="createNewAdRequest"> ?????<xs:complexType> ???????<xs:sequence> ?????????<xs:element type="xs:string" name="content"/> ?????????<xs:element type="xs:string" name="endDate"/> ???????</xs:sequence> ?????</xs:complexType> ???</xs:element> ????<xs:elementname="createNewAdResponse"> ?????<xs:complexType> ???????<xs:sequence> ?????????<xs:element type="xs:int" name="newAdId"/> ???????</xs:sequence> ?????</xs:complexType> ???</xs:element> ... ?</xs:schema> ? </wsdl:types> ?<wsdl:messagename="createNewAdRequestMessage"> ?<wsdl:part name="part1" element="ns1:createNewAdRequest"/> </wsdl:message> ?<wsdl:messagename="createNewAdResponseMessage"> ?<wsdl:part name="part1"element="ns1:createNewAdResponse" /> </wsdl:message> ?<wsdl:messagename="getExistingAdsResponseMessage"> ... </wsdl:message> ?<wsdl:portType name="ClassifiedServicePortType"> ??<wsdl:operation name="createNewAd"> ???<wsdl:input message="tns:createNewAdRequestMessage"/> ???<wsdl:output message="tns:createNewAdResponseMessage"/> ?</wsdl:operation> ??<wsdl:operationname="finalizeIssue">...</wsdl:operation> ?<wsdl:operationname="editExistingAd">...</wsdl:operation> ?<wsdl:operationname="getExistingAds">...</wsdl:operation> ?</wsdl:portType> ?<wsdl:bindingname="ClassifiedServiceBinding" ?????????????type="tns:ClassifiedServicePortType"> ??<soap:bindingtransport="http://schemas.xmlsoap.org/soap/http" ???????????????style="document" /> ??<wsdl:operation name="createNewAd"> ???<soap:operation soapAction="createNewAd"style="document" /> ???<wsdl:input> ?????<soap:bodyuse="literal" ????????????????namespace="http://ws.apache.org/axis2"/> ???</wsdl:input> ???<wsdl:output> ?????<soap:bodyuse="literal" ????????????????namespace="http://ws.apache.org/axis2"/> ???</wsdl:output> ?</wsdl:operation> ??<wsdl:operationname="finalizeIssue">...</wsdl:operation> ?<wsdl:operationname="editExistingAd">...</wsdl:operation> ?<wsdl:operationname="getExistingAds">...</wsdl:operation> ?</wsdl:binding> ?<wsdl:servicename="ClassifiedService"> ??<wsdl:portname="ClassifiedServicePort" ????????????binding="tns:ClassifiedServiceBinding"> ???<soap:address location= "http://www.daily-moon.com:8080/axis2/services/ClassifiedService"/> ?</wsdl:port> </wsdl:service> ?</wsdl:definitions> ?注意:在WSDL2.0中: 仅允许每个 message 包含一个part; portType 的名称已更改为interface; soapAction 已经完全从 WSDL2.0 中删除了; 另一个更改与“消息交换模式”的正式规范有关。WSDL2.0不依赖于用户确定是同时存在输入和输出还是仅有一个输入消息,它允许您具体地声明所使用的模式
???... ?<wsdl:operation name="finalizeIssue" ???????????pattern=http://www.w3.org/2006/01/wsdl/in-only"> ???<wsdl:inputmessage="tns:finalizeIssueRequestMessage"/> ?</wsdl:operation> ?<wsdl:operation name="createNewAd" ?????????????pattern="http://www.w3.org/2006/01/wsdl/in-out"> ???<wsdl:input message="tns:createNewAdRequestMessage"/> ???<wsdl:outputmessage="tns:createNewAdResponseMessage"/> ?</wsdl:operation> ... |
? -------------------------------------------- 有关命名空间的说明 和许多编程语言一样,在 XML中,经常有必要为各种元素和属性指定“命名空间”。这样就能方便地对具有相同名称但用途不同(来源也可能不同)的元素进行区分。XML 通过URI 引用命名空间。例如,XML 模式命名空间为http://www.w3.org/2001/XMLSchema。不过,为了方便起见,还为其分配了一个别名(或前缀)。例如,此处的模式命名空间的前缀为xs:。请记住,别名只是一个别名而已,重要的是 URI。因此,属于 ns1:命名空间的元素或属性也是模式的 targetNamespace 的一部分。 --------------------------------------------- |