wsdl文档分析
<?xml version="1.0" encoding="UTF-8"?>
<definitions
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://sayhi.ws.mscncn.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://sayhi.ws.mscncn.com/"
name="HelloWSImplService">
<types>
<xsd:schema>
<xsd:import namespace="http://sayhi.ws.mscncn.com/"
schemaLocation="http://192.168.70.51:9999/day01_ws/hellows?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="sayHello">
<part name="parameters" element="tns:sayHello"></part>
</message>
<message name="sayHelloResponse">
<part name="parameters" element="tns:sayHelloResponse"></part>
</message>
<portType name="HelloWSImpl">
<operation name="sayHello">
<input wsam:Action="http://sayhi.ws.mscncn.com/HelloWSImpl/sayHelloRequest"
message="tns:sayHello"></input>
<output wsam:Action="http://sayhi.ws.mscncn.com/HelloWSImpl/sayHelloResponse"
message="tns:sayHelloResponse"></output>
</operation>
</portType>
<binding name="HelloWSImplPortBinding" type="tns:HelloWSImpl">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"></soap:binding>
<operation name="sayHello">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="HelloWSImplService">
<port name="HelloWSImplPort" binding="tns:HelloWSImplPortBinding">
<soap:address location="http://192.168.70.51:9999/day01_ws/hellows"></soap:address>
</port>
</service>
</definitions>
这个文档标签结构可以简化为:
<definitions>
<types></types>
<!-- types
schema : 定义了一些标签结构
--描述请求对象
<sayHello>
<arg0>string</arg0>
</sayHello>
--描述响应对象
< sayHelloResponse>
<result>String</result>
</sayHelloResponse>
-->
<message></message>
<message></message>
<!-- message:用来定义消息的结构
part:通过element属性指定引用types定义的标签片段
-->
<portType></portType>
<!--
portType:用来定义服务器端的SEI(WebService EndPoint Interface)
operation : 用来指定SEI中的处理请求的方法
input : 指定客户端应用传过来的数据,会引用上面定义的<message>
output : 指定服务器端返回给客户端的数据,会引用上面定义的<message>
-->
<binding></binding>
<!--
binding: 用来定义SEI的实现类
type属性: 引用上面的<portType>
<soap:binding style="document">: 绑定的数据是一个document(xml)
operation:用来定义实现的方法
input:
<soap:body use="literal"></soap:body> xml格式文本数据
output:
<soap:body use="literal"></soap:body> xml格式文本数据
-->
<service></service>
<!--
service: 服务器的一个web service容器
name属性: 它用来指定客户端容器类
--port: 用来指定一个服务器端处理请求的入口(SEI的实现类)
binding属性:应用上面定义的<binding/>
address:当前webservice的请求地址
-->
</definitions>