您的位置:首页 > 其它

WebService

2016-01-01 09:40 369 查看

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 详解参考学习:/article/7952279.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: