您的位置:首页 > 其它

wsdl文件标签的描述

2017-10-25 17:59 204 查看
<types>
<xsd:schema>
<xsd:import schemaLocation="http://xxx.xxx.x.xx/helloWorld?xsd=1" namespace="http://impl.cxf.it.huahua.com/"/>
</xsd:schema>
</types>


http://xxx.xxx.x.xx/helloWorld?xsd=1内容如下:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. -->
<xs:schema targetNamespace="http://impl.cxf.it.huahua.com/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://impl.cxf.it.huahua.com/">
<xs:element type="tns:say" name="say"/>
<xs:element type="tns:sayResponse" name="sayResponse"/>
<xs:complexType name="say">
<xs:sequence>
<xs:element type="xs:string" name="arg0" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="sayResponse">
<xs:sequence>
<xs:element type="xs:string" name="return" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
types定义数据交换的格式


<message name="say">
<part name="parameters" element="tns:say"/>
</message>
<message name="sayResponse">
<part name="parameters" element="tns:sayResponse"/>
</message>


message:用来定义消息结构

part:指定引用types中定义的消息片段

<portType name="HelloWorldImpl">
<operation name="say">
<input message="tns:say" wsam:Action="http://impl.cxf.it.huahua.com/HelloWorldImpl/sayRequest"/>
<output message="tns:sayResponse" wsam:Action="http://impl.cxf.it.huahua.com/HelloWorldImpl/sayResponse"/>
</operation>
</portType>


portType:指定一个web services可被执行的操作以及相关消息(可比作一个函数库,一个类,一个模块)

operatoin:指定类的一个方法,有一个输入参数和一个返回参数

input:指定客户端传过来的参数;

out:服务器响应给客户端的参数;

<binding name="HelloWorldImplPortBinding" type="tns:HelloWorldImpl">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="say">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>


WSDL 绑定可为 web service 定义消息格式和协议细节。

binding:name指定绑定的名称,type用于指定绑定的端口。

soap:binding:style可取document/rpc,transport属性指定要使用soap协议传输

operation:定义了每个端口要进行的操作

对于每个操作,相应的 SOAP 行为都需要被定义。同时您必须如何对输入和输出进行编码。在这个例子中我们使用了 “literal”。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  wsdl