zoukankan      html  css  js  c++  java
  • 浅学soap--------3

    //person.wsdl   标签
    <?xml version="1.0" ?>
    <definitions name="person" targetNamespace="urn:person" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:person" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns="http://schemas.xmlsoap.org/wsdl/">
    <types xmlns="http://schemas.xmlsoap.org/wsdl/" />
    
    <portType name="personPort">    <!--web service 执行的操作,相当于class person-->
    <operation name="name">            <!--相当于class person中的name方法-->
        <input message="tns:nameRequest" />        <!--name方法的请求,和name=nameRequest的message对应-->
        <output message="tns:nameResponse" />    <!--name方法的返回,和name=nameRequest的message对应-->
    </operation>
    <operation name="add">
        <input message="tns:addRequest" />
        <output message="tns:addResponse" />
    </operation>
    </portType>
    
    
    <binding name="personBinding" type="tns:personPort">    <!--同portType中的name-->
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
        <!--style 属性可取值 "rpc" 或 "document",transport 属性定义了要使用的 SOAP 协议-->
    <operation name="name">
        <soap:operation soapAction="urn:person#person#name" />
        <input>
            <soap:body use="encoded" namespace="urn:person" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
        </input>
        <output>
            <soap:body use="encoded" namespace="urn:person" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
        </output>
    </operation>
    
    <operation name="add">        <!--person类中的方法名-->
        <soap:operation soapAction="urn:person#person#add" />
        <input>
            <soap:body use="encoded" namespace="urn:person" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
        </input>
        <output>
            <soap:body use="encoded" namespace="urn:person" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
        </output>
    </operation>
    </binding>
    
    
    <service name="person">
        <documentation />
        <port name="personPort" binding="tns:personBinding">    <!--同上方binding的name-->
            <soap:address location="http://localhost:80/test/web_service/Service.php" />
            <!--location是Service的地址-->    
        </port>
    </service>
    <message name="nameRequest">            <!--message,web service 使用的消息-->
    </message>
    <message name="nameResponse">
        <part name="name" type="xsd:string" />
    </message>
    <message name="addRequest">                    <!--person类中的add方法-->
        <part name="a" type="xsd:string" />        <!--person类中add方法的传入参数a-->
        <part name="b" type="xsd:string" />        <!--person类中add方法的传入参数b-->
    </message>
    <message name="addResponse">
        <part name="add" type="xsd:string" />    <!--person类中add方法的返回-->
    </message>
    </definitions>
     
  • 相关阅读:
    Redis概述
    容器化VS微服务
    HTTP协议
    Java传参都是传引用变量的副本
    短连接、长连接和短轮询、长轮询
    Netty 5 获取客户端IP(非HTTP)
    Linux上从Java程序中调用C函数
    【转载】Log4j详细使用教程
    【转载】Windows下VSCode编译调试c/c++
    SpringCloud与Seata分布式事务初体验
  • 原文地址:https://www.cnblogs.com/Kqingniao/p/6839797.html
Copyright © 2011-2022 走看看