webService中wsdl文档详解

  <?xml version="1.0" encoding="UTF-8" ?>
- <!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version 
    is JAX-WS RI 2.2.4-b01. -->
- <!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version 
    is JAX-WS RI 2.2.4-b01. -->
-
<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://ws.day01_ws.atguigu.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.day01_ws.atguigu.com/"
    name="HelloWsImplService">
    -
    <types>
        -
        <xsd:schema>
            <xsd:import namespace="http://ws.day01_ws.atguigu.com/"
                schemaLocation="http://192.168.1.62:8080/day01_ws/hellows?xsd=1" />
        </xsd:schema>
    </types>
     <!-- 
        message:用来定义消息结构
            part:用于指定引用标签<types>中的xml片段
     -->
    <message name="sayHello">
        <part name="parameters" element="tns:sayHello" />
    </message>

    <message name="sayHelloResponse">
        <part name="parameters" element="tns:sayHelloResponse" />
    </message>
    -<!-- 
        portType:用来定义服务器端的SEI
            operation:用来定义SEI中处理请求的方法
            input:指定客户端传过来的数据,会引用标签<message>
            output:服务器端输出的数据,会引用对应标签<message>
     -->
    <portType name="HelloWsImpl">
        -
        <operation name="sayHello">
            <input wsam:Action="http://ws.day01_ws.atguigu.com/HelloWsImpl/sayHelloRequest"
                message="tns:sayHello" />
            <output wsam:Action="http://ws.day01_ws.atguigu.com/HelloWsImpl/sayHelloResponse"
                message="tns:sayHelloResponse" />
        </operation>
    </portType>
    -<!-- 
        binding:用于指定SEI的实现类
            type属性引用标签<portType>
            <soap:binding style="document" />绑定的数据是一个document(xml)
            operation:指定实现类的方法
            <soap:operation style="document" />
            input:指定客户端传过来的数据,
                <soap:body use="literal" />:传输的是一个文本数据    
            output:服务器端输出的数据,
            
     -->
    <binding name="HelloWsImplPortBinding" type="tns:HelloWsImpl">
        <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
            style="document" />
        -
        <operation name="sayHello">
            <soap:operation soapAction="" />
            -
            <input>
                <soap:body use="literal" />
            </input>
            -
            <output>
                <soap:body use="literal" />
            </output>
        </operation>
    </binding>
    <!-- 
        service:服务器的一个webservice的容器
        name:指定客户端容器类
        port:指定一个服务器端处理请求的入口(就是SEI的实现)
            binding属性对应一个标签<binding>
            address:当前webService地址
     -->
    <service name="HelloWsImplService">
        
        <port name="HelloWsImplPort" binding="tns:HelloWsImplPortBinding">
            <soap:address location="http://192.168.1.62:8080/day01_ws/hellows" />
        </port>
    </service>
</definitions>

 

posted @ 2017-08-28 14:34  liujiee2  阅读(329)  评论(0编辑  收藏  举报