请给我解释下这个服务器描述语言是什么意思??

wkhegx 2014-06-18 03:14:34
在php的一个项目里面,有一个wsdl格式的文件,打开里面的代码是这样的,虽然看得懂英文的意思,但是我看不懂这个代码有什么用,放在项目的根目录下起什么作用,它如何运行的?请给我详细说下,谢谢。。
<?xml version='1.0' encoding='UTF-8'?>

<!-- WSDL file generated by Zend Studio. -->

<definitions name="soap" targetNamespace="urn:soap" xmlns:typens="urn:soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<message name="auth">
<part name="email" type="xsd:string"/>
<part name="password" type="xsd:string"/>
</message>
<message name="authResponse">
<part name="authReturn" type="xsd:boolean"/>
</message>
<message name="latest">
<part name="date" type="xsd:integer"/>
</message>
<message name="latestResponse">
<part name="latestReturn" type="xsd:string"/>
</message>
<message name="send">
<part name="email" type="xsd:string"/>
<part name="password" type="xsd:string"/>
<part name="message" type="xsd:string"/>
</message>
<message name="sendResponse">
<part name="sendReturn" type="xsd:boolean"/>
</message>
<portType name="chatPortType">
<operation name="auth">
<input message="typens:auth"/>
<output message="typens:authResponse"/>
</operation>
<operation name="latest">
<input message="typens:latest"/>
<output message="typens:latestResponse"/>
</operation>
<operation name="send">
<input message="typens:send"/>
<output message="typens:sendResponse"/>
</operation>
</portType>
<binding name="chatBinding" type="typens:chatPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="auth">
<soap:operation soapAction="urn:chatAction"/>
<input>
<soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="latest">
<soap:operation soapAction="urn:chatAction"/>
<input>
<soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="send">
<soap:operation soapAction="urn:chatAction"/>
<input>
<soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="soapService">
<port name="chatPort" binding="typens:chatBinding">
<soap:address location=""/>
</port>
</service>
</definitions>
...全文
288 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wkhegx 2014-06-28
  • 打赏
  • 举报
回复
引用 5 楼 xuzuning 的回复:
WSDL 文件有严格的语法格式,相关解释网上都能找到 WSDL 都是用工具生成的,很少会有人手工书写 php 的 soap 扩展虽然没有提供 WSDL 书写工具 但已有高人书写了 SoapDiscovery.class.php 用于从你写好的服务端工作类上才生出 WSDL 文档 因此像我等懒人也就没有必要研读 WDSL 的文法了
希望能够给我推荐一个生成wdsl的工具,我知道zend studio可以,但是现在新版的Zend Studio也不能自动生成了。
xuzuning 2014-06-18
  • 打赏
  • 举报
回复
WSDL 文件有严格的语法格式,相关解释网上都能找到 WSDL 都是用工具生成的,很少会有人手工书写 php 的 soap 扩展虽然没有提供 WSDL 书写工具 但已有高人书写了 SoapDiscovery.class.php 用于从你写好的服务端工作类上才生出 WSDL 文档 因此像我等懒人也就没有必要研读 WDSL 的文法了
wkhegx 2014-06-18
  • 打赏
  • 举报
回复
引用 3 楼 xuzuning 的回复:
Web Service 是服务器,使用 SOAP 协议 服务端使用 SoapServer 类形成服务 客户端通过 SoapClient 类进行访问 解析 WSDL 可由 SoapClient::__getFunctions SoapClient::__getTypes 方法进行 相关文件你的项目应该都提供了,你可以通过搜索包含“WSDL”字样的文件,找到他们
引用 3 楼 xuzuning 的回复:
Web Service 是服务器,使用 SOAP 协议 服务端使用 SoapServer 类形成服务 客户端通过 SoapClient 类进行访问 解析 WSDL 可由 SoapClient::__getFunctions SoapClient::__getTypes 方法进行 相关文件你的项目应该都提供了,你可以通过搜索包含“WSDL”字样的文件,找到他们
根据你的说法,我看懂了你写出来的,但是对于下来的代码还是不知道是什么意思。
 <portType name="chatPortType">
        <operation name="auth">
            <input message="typens:auth"/>
            <output message="typens:authResponse"/>
        </operation>
        <operation name="latest">
            <input message="typens:latest"/>
            <output message="typens:latestResponse"/>
        </operation>
        <operation name="send">
            <input message="typens:send"/>
            <output message="typens:sendResponse"/>
        </operation>
    </portType>
    <binding name="chatBinding" type="typens:chatPortType">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="auth">
            <soap:operation soapAction="urn:chatAction"/>
            <input>
                <soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </input>
            <output>
                <soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </output>
        </operation>
        <operation name="latest">
            <soap:operation soapAction="urn:chatAction"/>
            <input>
                <soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </input>
            <output>
                <soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </output>
        </operation>
        <operation name="send">
            <soap:operation soapAction="urn:chatAction"/>
            <input>
                <soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </input>
            <output>
                <soap:body namespace="urn:soap" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </output>
        </operation>
    </binding>
    <service name="soapService">
        <port name="chatPort" binding="typens:chatBinding">
            <soap:address location=""/>
        </port>
    </service>
</definitions>
xuzuning 2014-06-18
  • 打赏
  • 举报
回复
Web Service 是服务器,使用 SOAP 协议 服务端使用 SoapServer 类形成服务 客户端通过 SoapClient 类进行访问 解析 WSDL 可由 SoapClient::__getFunctions SoapClient::__getTypes 方法进行 相关文件你的项目应该都提供了,你可以通过搜索包含“WSDL”字样的文件,找到他们
wkhegx 2014-06-18
  • 打赏
  • 举报
回复
引用 1 楼 xuzuning 的回复:
这是 Web Service 使用的,与客户沟通用说明文件 他告知用户,本 Web Service 提供了如下方法: [0] => boolean auth(string $email, string $password) [1] => string latest(integer $date) [2] => boolean send(string $email, string $password, string $message)
我看不懂啊,你是怎么看出来的?? 告知用户提供你说的这3个服务,然后呢?这样写它是如何工作的??这个文件看起来英文倒是简单,但是毫无头绪啊。全看不懂。
xuzuning 2014-06-18
  • 打赏
  • 举报
回复
这是 Web Service 使用的,与客户沟通用说明文件 他告知用户,本 Web Service 提供了如下方法: [0] => boolean auth(string $email, string $password) [1] => string latest(integer $date) [2] => boolean send(string $email, string $password, string $message)

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧