分布式通信框架-webservice协议(分布式六 中)

什么时候使用webservice

系统语言不一致
在这里插入图片描述

SOAP(simple object access protocal简单对象访问协议)

http+xml
webservice通过http协议发送和接收请求时, 发送的内容(请求报文)和接收的内容(响应报文)都是采用xml格式进行封装
这些特定的HTTP消息头和XML内容格式就是SOAP协议

  1. 一种简单、基于HTTP和XML的协议
  2. soap消息:请求和响应消息
  3. http+xml报文

WSDL(web service definition language webservice 定义语言)

webservice服务需要通过wsdl文件来说明自己有什么服务可以对外调用。并且有哪些方法、方法里面有哪些参数
wsdl基于XML(可扩展标记语言)去定义的

  1. 对应一个.wsdl的文件类型
  2. 定义了webservice的服务器端和客户端应用进行交互的传递数据和响应数据格式和方式
  3. 一个webservice对应唯一一个wsdl文档

SEI(webservice endpoint interface webservice的终端接口)

webservice服务端用来处理请求的接口,也就是发布出去的接口

分析WSDL

基于上一篇提供的webservice服务:http://localhost:8888/ws/hello?wsdl
具体参考博客地址:https://blog.csdn.net/dengjili/article/details/86024334

在这里插入图片描述

各个元素
<!--
 Published by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. 
-->
<!--
 Generated by JAX-WS RI (http://jax-ws.java.net). RI's version is JAX-WS RI 2.2.9-b130926.1035 svn-revision#5f6196f2b90e9460065a4c2f4e30e065b245e51e. 
-->
<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://webservice.distributed_s1.dengjili.priv/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://webservice.distributed_s1.dengjili.priv/" name="SayHelloImplService">
    <types>
        <xsd:schema>
            <xsd:import namespace="http://webservice.distributed_s1.dengjili.priv/" schemaLocation="http://localhost:8888/ws/hello?xsd=1"/>
        </xsd:schema>
    </types>
    <message name="sayHello">
        <part name="parameters" element="tns:sayHello"/>
    </message>
    <message name="sayHelloResponse">
        <part name="parameters" element="tns:sayHelloResponse"/>
    </message>
    <portType name="SayHelloImpl">
        <operation name="sayHello">
            <input wsam:Action="http://webservice.distributed_s1.dengjili.priv/SayHelloImpl/sayHelloRequest" message="tns:sayHello"/>
            <output wsam:Action="http://webservice.distributed_s1.dengjili.priv/SayHelloImpl/sayHelloResponse" message="tns:sayHelloResponse"/>
        </operation>
    </portType>
    <binding name="SayHelloImplPortBinding" type="tns:SayHelloImpl">
        <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 name="SayHelloImplService">
        <port name="SayHelloImplPort" binding="tns:SayHelloImplPortBinding">
            <soap:address location="http://localhost:8888/ws/hello"/>
        </port>
    </service>
</definitions>

分析
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值