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>
     
  • 相关阅读:
    SQL Server数据库中批量导入数据
    SQL里面也能用Split()
    MSSQL发送邮件
    Asp.Net简单的发邮件功能
    十大措施保证系统安全性
    WebDriver测试web中遇到的弹出框或不确定的页面
    WebDriver数据驱动模式
    nginx 优化(转)
    配置虚拟目录出错
    14152学期校内岗招聘信息
  • 原文地址:https://www.cnblogs.com/Kqingniao/p/6839797.html
Copyright © 2011-2022 走看看