標籤:style http io ar 資料 art sp cti on
wsdl文件剖析
<?xml version="1.0" encoding="UTF-8"?><definitionsxmlns: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>
wsdl文件剖析