Web-Service-SOAP&WSDL
2014-05-14 19:27
232 查看
WebService通过HTTP协议完成远程调用: (深入分析) – RPC
WebService只采用HTTP POST方式传输数据,不使用GET方式; -- 握手,WSDL-get,
•普通http post的contentType为
•application/x-www-form-urlencoded
•WebService的contentType为-即在Http的基础上发SOAP协议
•text/xml 这是基于soap1.1协议。
•application/soap+xml 这是基于soap1.2协议。
WebService从数据传输格式上作了限定。WebService所使用的数据均是基于XML格式的。目前标准的WebService在数据格式上主要采用SOAP协议。SOAP协议实际上就是一种基于XML编码规范的文本协议。
SOAP – Simple Object Access protocol 简单对像访问协议。是运行在HTTP协议基础之上的协议。其实就是在HTTP协议是传输XML文件,就变成了SOAP协议。
SOAP1.1和SOAP1.2的 namespace不一样。可以通过查看类
•javax.xml.ws.soap.SOAPBinding来查看里面的常量
•默认情况下,Jdk1.6只支持soap1.1
•即:@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING)
SOAP1.1和SOAP1.2的对比
使用JDK1.6发布的简单Web服务,其内部其实是使用Socket实现。可以查看:SUN公司未对外公布的API类com.sun.xml.internal.ws.transport.http.server.
ServerMgr获知,请使用反编译工具。
WebService的特点
•WebService通过HTTP POST方式接受客户的请求
•WebService与客户端之间一般使用SOAP协议传输XML数据.
•它本身就是为了跨平台或跨语言而设计的。
访问 http://127.0.0.1:9999/hello?wsdl
WebService只采用HTTP POST方式传输数据,不使用GET方式; -- 握手,WSDL-get,
•普通http post的contentType为
•application/x-www-form-urlencoded
•WebService的contentType为-即在Http的基础上发SOAP协议
•text/xml 这是基于soap1.1协议。
•application/soap+xml 这是基于soap1.2协议。
WebService从数据传输格式上作了限定。WebService所使用的数据均是基于XML格式的。目前标准的WebService在数据格式上主要采用SOAP协议。SOAP协议实际上就是一种基于XML编码规范的文本协议。
SOAP – Simple Object Access protocol 简单对像访问协议。是运行在HTTP协议基础之上的协议。其实就是在HTTP协议是传输XML文件,就变成了SOAP协议。
SOAP1.1和SOAP1.2的 namespace不一样。可以通过查看类
•javax.xml.ws.soap.SOAPBinding来查看里面的常量
•默认情况下,Jdk1.6只支持soap1.1
•即:@BindingType(value=javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING)
SOAP1.1和SOAP1.2的对比
WebService和Web服务器的区别
WebService和Web服务器有什么区别呢?我们可以把WebService看作是Web服务器上应用;反过来说,Web服务器是WebService运行时所必需的容器。这就是它们的区别和联系。使用JDK1.6发布的简单Web服务,其内部其实是使用Socket实现。可以查看:SUN公司未对外公布的API类com.sun.xml.internal.ws.transport.http.server.
ServerMgr获知,请使用反编译工具。
WebService的特点
•WebService通过HTTP POST方式接受客户的请求
•WebService与客户端之间一般使用SOAP协议传输XML数据.
•它本身就是为了跨平台或跨语言而设计的。
WSDL
发布/** * * * @author 姜沂 * * WebService 将 Java 类标记为实现 Web Service,或者将 Java 接口标记为定义 Web Service 接口 * */ @WebService public class HelloService { public static void main(String[] args) { /** * 静态的和final的方法 不能被发布 参数1:服务的发布地址 参数2:服务的实现者 */ Endpoint.publish("http://127.0.0.1:9999/hello", new HelloService()); System.out.println("Server ready..."); } public String sayHello(String name) { System.err.println("----------------"); return "hello" + name; } @WebMethod(exclude=true)//不暴露 public String sayHello2(String name) { return "hello " + name; } }
访问 http://127.0.0.1:9999/hello?wsdl
相关文章推荐
- Web Service, SOAP和WSDL的关系
- Exception in thread "main" javax.xml.ws.WebServiceException: Could not find wsdl:binding operation i
- 因添加两个webservice引用时提示:{"无法加载协定为“sms.WebServiceSoap”的终结点配置部分,找到了该协定的多个终结点配置。请按名称指示首选的终结点配置部分。"}
- jaxws soap webservice 使用apache cxf tool ——wsdl2java
- zz SOAP/Web Service/WSDL关系
- webservice soap wsdl
- webservice wsdl soap axis
- webservice Quiz(Wsdl &Soap)
- Webservice soap wsdl区别之个人见解
- 彻底理解webservice SOAP WSDL
- 白痴理解的SOAP/Web Service/WSDL关系
- Exception in thread "main" javax.xml.ws.WebServiceException: Could not find wsdl:binding operation i
- WebService Caused by: javax.wsdl.WSDLException: WSDLException (at /soap:Envelope):
- SOAP/Web Service/WSDL关系
- webservice SOAP WSDL UDDI
- 什么是web service?- SOAP Web Service & Restful Web Service
- WSDL/WebService/SOAP/REST/AXIS/CXF 开放式服务
- 白痴理解的SOAP/Web Service/…
- Web-Service-常用监听器&&注解修改WSDL
- webservice wsdl和soap