关于weblogic平台和axis上开发webservices的比较
来源:互联网 发布:二胡校音器软件下载 编辑:程序博客网 时间:2024/04/29 18:55
1.bea workshop太大,开发的方式相对比较单一(基于jws),主要以业务为主,使用起来不灵活,与平台紧紧靠在一起,对EJB,JSP,swing等开发都限制在weblogic平台上,否则很难在相互之间的调用,开发部署的透明度不高(要根据醒目来部署,而不是一个简单的项目来)。
2.axis则相对是轻量级的web services开发环境,提供了JWS,wsdd开发方式,还可以结合wsdl2Java工具来完成根据wsdl文件生成合适的web services的开发。axis更是一个开放的组件,它的实现不依赖于任何特定的服务器,可看成一个简单的web应用,同时提供web services的容器。这是因为它的核心是基于servlet容器上的soap通信容器。
axis实现web services的基本原理(基于servlet引擎的web services):
有关于mesage Envelope等包应用在xml soap底层文件处理上,可以结合xmlDOM来处理soap消息,在结合servlet就可以实现一个web services.而不需要任何环境;
其思路:
1.客户端是基于message,和xml来都到合适的envelope的soap消息,上面就是例子。
2.服务端是一个servlet文件,其中用XMLDOM和Envlope来解析envelope,处理之后生成envelope,并通过soap走http给于请求回应。
这样他们之间就可以实现基于soap的web services。
这只是一基本原理,其实质的远比这复杂.
这样在处理soap消息的过程中,可以结合上面的一些底层的东西处理soap消息,从而获得根大的灵活性
例:一个得到的soap消息中根据其对cid描述,对其附加上附件。
关键代码如下:
import javax.mail.internet.MimeBodyPart;
import org.apache.axis.*;
import javax.xml.soap.AttachmentPart;
import org.apache.axis.Message;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPEnvelope;
import java.io.*;
public class test{
public static void main(String arg[]){
try{
File file=new File("HelloWorld.java");
BufferedReader br=new BufferedReader(new FileReader(file));
StringBuffer sb=new StringBuffer();
for(String line=br.readLine();line!=null;line=br.readLine()){
sb.append(line);
}
Message m=new Message("<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'><soapenv:Body><ns1:putFile soapenv:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:ns1='http://127.0.0.1:7001/axis/services/FileService'><s1 href='cid:attachement' xsi:type='ns2:DataHandler' xmlns:ns2='FileService'/><s2 xsi:type='xsd:string'>HelloWorld.java</s2></ns1:putFile></soapenv:Body></soapenv:Envelope>");
AttachmentPart ap1 = m.createAttachmentPart();
ap1.setContent(sb.toString(), "text/plain");
ap1.setContentId("attachement");
m.addAttachmentPart(ap1);
String endpoint="http://127.0.0.1:7003/axis/services/FileService";
String name="gaolong1";
Service service=new Service();
Call call=(Call) service.createCall();
System.out.println(m.getSOAPEnvelope());
call.setTargetEndpointAddress(new java.net.URL(endpoint));
SOAPEnvelope ret=(SOAPEnvelope)call.invoke(m);
System.out.println(ret.toString());
}catch(Exception e){
e.printStackTrace();
}
}
}
- 关于weblogic平台和axis上开发webservices的比较
- AXIS WebServices开发
- Axis开发WebServices轻松入门
- 基于weblogic+axis的web services开发
- 架设 apache Axis的webservices服务器和客户端
- Axis和CXF的比较
- CXF和Axis的比较
- Axis和CXF的比较
- CXF和Axis的比较
- Axis和CXF的比较
- axis webservices
- axis webservices
- Axis做的Service客户端部署在weblogic上兼容问题
- Axis做的Service客户端部署在weblogic上兼容问题 .
- 关于.NET和AXIS交流webservice的开发
- 关于windows平台上的java和c/c++的editplus搭建开发平台
- CXF和Axis的比较【转】
- WebLogic 上WebServices 总是提示 401 Unauthorized 异常的一种情况!
- 一个用C#写的利用OWC控件的方法
- 超级兔子
- 网速超好的一个地方
- IE 打开文件文件链接出现提醒对话框
- 设计到底需要考虑什么
- 关于weblogic平台和axis上开发webservices的比较
- 06/03/09
- 基于weblogic+axis的web services开发
- Java1.5新特性
- 近日动态!
- 实现uc版本维护功能,基线baseline的实现也就容易了
- 【原创】我在成都当程序员
- 如何修改jboss4的默认端口
- 内心英雄