随笔分类 - 3 Web Service
摘要:Web services transactions specifications由IBM、BEA和Microsoft 重量级公司开发。被分成了三个主要工作组:WS-Coordination, WS-Atomic Transaction以及WS-Business Activity。根据http://www.oschina.net/p/apache+kandula的说法,Apache中有一个项目Kandula专门用来实现web服务的事务。但是奇怪的是,这个项目已经在Apache网上找不到了。其他相关网站如下:Axis2 与 JAX-WS规范 http://www.blogjava.net/oran
阅读全文
摘要:首先要声明,不推荐在web service中实现分布式事务。原因如下: 1、webservice在通信层上是一种无连接的协议,每两次调用之间,tcp连接是断开的。而分布式事务需要保存事务上下文,这是一个难点 2、web service是一种以松耦合为指导思想的集成方式,一般主张采用无状态方法,一次请求即完成一次完整的处理,两次调用之间没有上下文关系; 而事务处理更强调多次调用间的紧耦合关系 3、异构平台不一定都支持两段事务提交模式。一般的面向DCOM的分布式应用中,分布式事务支持策略如下: 采用两段式事务提交的办法,第一次提交是预提交,预提交之后是可以回滚的。 第二次提交是永久...
阅读全文
摘要:根据WSDL定义,binding标签用于将抽象的数据定义与具体的实现协议、编码方式等进行绑定。这里用到两个重要的属性: style:RPC、Document use:encoded、literal<binding>标签片段如下:<binding name="ExamplePortBinding" type="tns:Example"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"&g
阅读全文
摘要:先看例子再做解释:<?xml version="1.0" encoding="UTF-8"?><definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.jsoso.com/wstest" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/&
阅读全文
摘要:WS-policy(一个所有WS-*协议的父协议。用于定义一个语法和语义来描述Web服务的需求、偏好和能力)Defines a syntax and semantic for service providers and service requestors to describe their requirements, preferences, and capabilities.The syntax provides a flexible and concise way of expressing the needs of each domain in the form of policies
阅读全文
posted @ 2012-01-30 22:53
万法自然~
摘要:1 //Interface class: 2 // RemoteServiceCentral.java 3 //Implementation: 4 // RemoteServiceCentralImpl.java 5 6 import java.rmi.registry.LocateRegistry; 7 import java.rmi.registry.Registry; 8 9 String hostName = null;10 try {11 hostName = InetAddress.getLocalHost().getHostName();12 } c...
阅读全文
摘要:一、CXF准备工作 jar包下载地址、jar包结构、源代码 特性简介: 代码生成工具:Java to WSDL; WSDL to Java; XSD to WSDL; WSDL to XML; WSDL to SOAP; WSDL to Service; 支持:JAX-WS, JAX-WSA, JSR181, SAAJ; 支持:SOAP 1.1/1.2, WS-I BasicProfile, WS-Security, WS-Addressing, WS-RM和WS-Policy; 支持:WSDL1.1/2.0 支持:MTOM; javascript, 通过Yoko支持C...
阅读全文
摘要:RPC:(Remote Procedure Call) 被设计为在应用程序间通信的平台中立的方式,它不理会操作系统之间以及语言之间的差异。 支持多语言RMI:(Remote Method Invocation) RPC 的Java版本,EJB的基础技术 RMI 采用JRMP(Java Remote Method Protocol)通讯协议,是构建在TCP/IP协议上的一种远程调用方法。 RMI 采用stubs和skeletons来进行远程对象的通讯。 stub充当远程对象的客户端代理,有着和远程对象相同的远程接口。 远程对象的调用实际是通过调用该对象的客户端代理对象stub来完成的...
阅读全文
摘要:XML-RPC的全称是XML Remote Procedure Call,即XML远程方法调用。 这种远程过程调用使用http作为传输协议,XML作为传送信息的编码格式。XML-RPC是工作在Internet上的远程过程调用协议。一个XML-RPC消息就是一个请求体为xml的http-post请求,被调用的方法在服务器端执行并将执行结果以xml格式编码后返回。Request example POST /RPC2 HTTP/1.0User-Agent: Frontier/5.1.2 (WinNT)Host: betty.userland.comContent-Type: text/xmlCo..
阅读全文
摘要:比较对象:RMI、Hessian、Burlap、Httpinvoker、WebService基本介绍:RMI是java语言本身提供的远程通讯协议,稳定高效,是EJB的基础。但它只能用于JAVA程序之间的通讯。Hessian和Burlap是caucho公司提供的开源协议,基于HTTP传输,服务端不用开防火墙端口。协议的规范公开,可以用于任意语言。Httpinvoker是SpringFramework提供的远程通讯协议,只能用于JAVA程序间的通讯,且服务端和客户端必须使用SpringFramework。Web service是连接异构系统或异构语言的首选协议,它使用SOAP形式通讯,可以用于任何
阅读全文
摘要:练习内容:通过wsdl文件生成对应java类。练习步骤:1. In http://cxf.apache.org/docs/developing-a-consumer.htmlcopy the whole content of HelloWorld WSDL Contract and save it as hello_world.wsdl in F:\Tim-Work\ProgramTest-Area\ folder.2. start a command window, go to F:\Tim-Work\ProgramTest-Area\ directory and enter the fol
阅读全文
摘要:1. root tag<wsdl:definitions/>2. inner tag:<wsdl:types/><wsdl:message /><wsdl:portType /><wsdl:binding /><wsdl:service />3. all the detailed type definitions are located in wsdl:types tag.4. Message tags are always in pair, one is request/in message, the other is
阅读全文
摘要:JAX-WS规范是一组XML web services的JAVA API。JAX-WS允许开发者可以选择RPC-oriented或者message-oriented 来实现自己的web services。在 JAX-WS中,一个远程调用可以转换为一个基于XML的协议例如SOAP。在使用JAX-WS过程中,开发者不需要编写任何生成和处理SOAP消息的代码。JAX-WS的运行时实现会将这些API的调用转换成为SOAP消息。 在服务器端,用户只需要通过Java语言定义远程调用所需要实现的接口SEI (service endpoint interface),并提供相关的实现,通过调用JAX-WS的服务
阅读全文
摘要:Developing a Service using JAX-WSYou can develop a service using one of two approaches:Start with a WSDL contract and generate Java objects to implement the service.Start with a Java object and service enable it using annotations.For new development the preferred path is to design your services in W
阅读全文
摘要:#######################################http://cxf.apache.org/CXF: An Open-Source Services Framework#######################################Apache CXF is an open source services framework. CXF helps you build and develop services using frontend programming APIs, like JAX-WS and JAX-RS. These services
阅读全文
浙公网安备 33010602011771号