加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

WebService

发布时间:2020-12-16 22:25:43 所属栏目:安全 来源:网络整理
导读:scheme规范 1. 所有标签和属性都需要有scheme文件来定义2. 所有的scheme文件都要有一个id , 但在这里它叫namespace(W3c规范)namespace 相当于scheme文件的id3. namespace的值由什么来指定 由targetNamespace属性来指定,它的值是一个url(很有可能不存在)

scheme规范

1. 所有标签和属性都需要有scheme文件来定义
2. 所有的scheme文件都要有一个id , 但在这里它叫namespace(W3c规范)namespace 相当于scheme文件的id
3. namespace的值由什么来指定
    由targetNamespace属性来指定,它的值是一个url(很有可能不存在)
4. 如何引入一个scheme约束?
    属性 ; xmlns
    属性值 : 对应的scheme文件的id(namespace)
    默认关联根标签
5. 如果引入的scheme不是w3c , 必须指定scheme文件的位置
6. scheme文件由什么属性指定
    属性:schemeLocation
    属性值: namespace path
    smlns:别名

7. 如果引入了n个约束 , 至少需要给n-1个取别名(标签前面加上别名)

http 请求 请求过程 响应

WebService实例

各网站的天气预报的数据如何获取,必须webservice

什么是webservice?

跨语言 跨平台
webservice服务端 提供接口 url
webservice客户端 请求url

几个重要的webService术语

  • wsdl : web service definition language – xml scheme
  • soap:simple object access protocal – http+xml
  • sei :webservice endpoint interface
    处理请求的接口
  • cfx :celtix + xfire
    框架 一个Apache的用于开发webservice服务端和客户端的框架

参考学习:

Java WebService 简单实例:
http://www.cnblogs.com/yisheng163/p/4524808.html?utm_source=tuicool

一个wsdl xml完整内容实例

<?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.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://ws.com/" name="HelloWSImplService">
<types>
<xsd:schema>
<xsd:import namespace="http://ws.com/" schemaLocation="http://10.18.0.232:8989/aa/hellows?xsd=1"></xsd:import>
</xsd:schema>
</types>
<message name="sayHello">
<part name="parameters" element="tns:sayHello"></part>
</message>
<message name="sayHelloResponse">
<part name="parameters" element="tns:sayHelloResponse"></part>
</message>
<portType name="HelloWSImpl">
<operation name="sayHello">
<input wsam:Action="http://ws.com/HelloWSImpl/sayHelloRequest" message="tns:sayHello"></input>
<output wsam:Action="http://ws.com/HelloWSImpl/sayHelloResponse" message="tns:sayHelloResponse"></output>
</operation>
</portType>
<binding name="HelloWSImplPortBinding" type="tns:HelloWSImpl">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding>
<operation name="sayHello">
<soap:operation soapAction=""></soap:operation>
<input>
<soap:body use="literal"></soap:body>
</input>
<output>
<soap:body use="literal"></soap:body>
</output>
</operation>
</binding>
<service name="HelloWSImplService">
<port name="HelloWSImplPort" binding="tns:HelloWSImplPortBinding">
<soap:address location="http://10.18.0.232:8989/aa/hellows"></soap:address>
</port>
</service>
</definitions>

WSDL 详解参考学习:http://www.voidcn.com/article/p-wxvawoja-bka.html

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读