|
什么是SOAP?
SOAP是一个基于XML的用于应用程序之间通信数据编码的传输协议。最初由微软和Userland Software提出,随着不断地完善和改进,SOAP很快被业界广泛应用。
什么是Axis?
Axis本质上就是一个SOAP引擎,提供创建服务器端、客户端和网关SOAP操作的基本框架。Axis目前版本是为Java编写的,不过为C++的版本正在开发中。
配置webservice具体步骤:
1.安装weblogic。
2.配置一个web应用,如“\\lijunjie\e$\software\bea\user_projects\domains\lijjdomain\applications\ cntapws “。
3.从apache网站上下载axis-bin-1_2_1.tar.gz,解压后copy到cntapws下面。
4.打开“http://localhost:7001/console“,配置cntapws 的web应用。
5.axis1.2和weblogic8.1有冲突,原因是weblogic 本身携带的webservice.jar使用的旧的javax.xml.soap.*,而不是像axis使用J2EE1.4新的版本。解决方案是在WEB-INF/weblogic.xml文件中如下的配置:
<weblogic-web-app> <container-descriptor> <prefer-web-inf-classes>true</prefer-web-inf-classes> </container-descriptor> </weblogic-web-app>
6.按 http://localhost:8080/axis/happyaxis.jsp地址,可以显示你发布的webservice是否配置成功,如果显示必须的包缺失,则你的webservice不能正常运行。
开发webservice流程
1.写普通的java类,该类中有你要发布到webservice上的有关方法。
2.配置server-comfig.xml, 把你要发布的方法写入该文件。具体内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<globalConfiguration>
<parameter name="adminPassword" value="admin"/>
<parameter name="attachments.Directory" value="C:\eclipse\workspace\bookstore\WEB-INF\attachments"/>
<parameter name="attachments.implementation" value="org.apache.axis.attachments.AttachmentsImpl"/>
<parameter name="sendXsiTypes" value="true"/>
<parameter name="sendMultiRefs" value="true"/>
<parameter name="sendXMLDeclaration" value="true"/>
<parameter name="axis.sendMinimizedElements" value="true"/>
<requestFlow>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="session"/>
</handler>
<handler type="java:org.apache.axis.handlers.JWSHandler">
<parameter name="scope" value="request"/>
上一篇:泛型与模板的有机结合 STL.NET简介
下一篇:C# 3.0语言规范
|