- 浏览: 68958 次
- 性别:
- 来自: 深圳
文章分类
最新评论
-
南朝落雨:
您在使用悲观锁的时候是否走索引了呢?如果走索引才有可能实现行锁 ...
hibernate 锁机制 -
xiaoying-07:
jboss-eap-4.3.rar 这个能发我一份吗
linux下的安装Jboss4.3
java创建webservice接口
1 用jdk自带的jws
2 webserivce框架
目前java开发webservice的框架是cxf和axis2。cxf继承了jws的API。和spring可以无缝结合。还可以用js调用。
axis2 支持java,c++语言开发webserive,有自己的数据绑定方式adb.不过本人并不喜欢用axis2去开发webserive。官方给的实例实用性不高,要打包aar文件。依赖axis2的中间容器。当然你也可以不打包aar.不过官方没给出,这个需要自己摸索。
pom.xml
遇到问题
使用cxf ws-security 安全认证
org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl cannot be cast to javax.xml.soap.SOAPElement
对其错误进行了debug
创建MessageFactory这个地方问题
创建MessageFactory,有点象jdbc连接。对外提供接口,具体的实现就留给厂家去实现。
现在这里的问题是 厂家有多个,而MessageFactory如果找到了第一个厂家就不会去找第二个。
仔细查看了代码。
cxf 提供使用自己的messageFactoryClassName
if (messageFactoryClassName != null) {
messageFactory = newInstanceCxfSAAJFactory(messageFactoryClassName,
MessageFactory.class);
}
解决问题是关键
MessageFactory.class
我们可以自己去系统设置 MessageFactory 实体的实例化类
System.setProperty("org.apache.cxf.binding.soap.messageFactoryClassName","com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
现在有一个问题是是服务端怎么去实现系统设置?
因为服务端的安全认证是配置在spring中。
可以用拦截器去实现
Spring.xml
jar冲突
axis2
<artifactId>org.apache.ws.commons.schema</artifactId>
<groupId>XmlSchema</groupId>
<version>1.4.7</version>
cxf
xmlschema-core-2.0.3
删除 axis2的xmlschema的jar
1 用jdk自带的jws
2 webserivce框架
目前java开发webservice的框架是cxf和axis2。cxf继承了jws的API。和spring可以无缝结合。还可以用js调用。
axis2 支持java,c++语言开发webserive,有自己的数据绑定方式adb.不过本人并不喜欢用axis2去开发webserive。官方给的实例实用性不高,要打包aar文件。依赖axis2的中间容器。当然你也可以不打包aar.不过官方没给出,这个需要自己摸索。
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>XX</groupId> <artifactId>XX</artifactId> <version>1.0</version> <packaging>war</packaging> <properties> <spring.version>3.0.5.RELEASE</spring.version> <axis2.version>1.6.2</axis2.version> <java.home>C:\Program Files\Java\jdk1.6.0_43</java.home> </properties> <!-- <profiles> <profile> <id>default-tools.jar</id> <activation> <property> <name>java.vendor</name> <value>Sun Microsystems Inc.</value> </property> </activation> <dependencies> <dependency> <groupId>com.sun</groupId> <artifactId>tools</artifactId> <version>1.6.0_43</version> <scope>system</scope> <systemPath>${java.home}/lib/tools.jar</systemPath> </dependency> </dependencies> </profile> </profiles> --> <build> <!-- <finalName>NPS-Web-${project.version}.build.${maven.build.timestamp}</finalName> --> <defaultGoal>jetty:run</defaultGoal> <resources> <resource> <filtering>true</filtering> <directory>src/main/resources</directory> </resource> <resource> <filtering>true</filtering> <directory>src/test/resources</directory> </resource> </resources> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.5.1</version> <configuration> <source>1.6</source> <target>1.6</target> <encoding>UTF-8</encoding> </configuration> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>2.1</version> <configuration> <webXml>src/main/webapp/WEB-INF/web.xml</webXml> </configuration> </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> <version>8.1.8.v20121106</version> <configuration> <webAppConfig> <defaultsDescriptor>src/test/resources/webdefault.xml</defaultsDescriptor> <contextPath>/RecoverGroup</contextPath> </webAppConfig> </configuration> </plugin> </plugins> </build> <dependencies> <!--s- spring jar --> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aspects</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-aop</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-orm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-expression</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-jdbc</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-test</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-tx</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-asm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-oxm</artifactId> <version>${spring.version}</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>${spring.version}</version> </dependency> <!--e- spring jar --> <!--s- hibernate jar --> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate</artifactId> <version>3.3.2</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.3.1.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-commons-annotations</artifactId> <version>3.2.0.Final</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-core</artifactId> <version>3.3.2.GA</version> </dependency> <!-- <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-ehcache</artifactId> <version>3.3.2.GA</version> </dependency> --> <dependency> <groupId>org.hibernate.javax.persistence</groupId> <artifactId>hibernate-jpa-2.0-api</artifactId> <version>1.0.1.Final</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>3.1.0.GA</version> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>ejb3-persistence</artifactId> <version>1.0.2.GA</version> </dependency> <!--e- hibernate jar --> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-beanutils</artifactId> <version>1.8.0</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-logging</artifactId> <version>1.1.1</version> </dependency> <!-- --> <dependency> <groupId>org.apache</groupId> <artifactId>log4j</artifactId> <version>1.2.15</version> </dependency> <!-- aspectj 切面编程--> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjweaver</artifactId> <version>1.6.8</version> </dependency> <dependency> <groupId>org.aspectj</groupId> <artifactId>aspectjrt</artifactId> <version>1.6.8</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-dbcp</artifactId> <version>1.2.1</version> </dependency> <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons.pool</artifactId> <version>1.5.3</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>org.javassist</groupId> <artifactId>javassist</artifactId> <version>3.15.0-GA</version> </dependency> <!-- s-junit --> <dependency> <groupId>org.junit</groupId> <artifactId>junit</artifactId> <version>4.8.1</version> <scope>test</scope> </dependency> <dependency> <groupId>org.hamcrest</groupId> <artifactId>hamcrest-all</artifactId> <version>1.2</version> <scope>test</scope> </dependency> <!--e-junit--> <!--s-struts2 --> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-core</artifactId> <version>2.1.8.1</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-spring-plugin</artifactId> <version>2.1.8.1</version> </dependency> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts-taglib</artifactId> <version>1.3.8</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-convention-plugin</artifactId> <version>2.1.8.1</version> </dependency> <dependency> <groupId>org.apache.struts</groupId> <artifactId>struts2-json-plugin</artifactId> <version>2.1.8.1</version> </dependency> <!--e-struts2 --> <!-- s-cxf --> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-log4j12</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-frontend-jaxws</artifactId> <version>2.7.8</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http</artifactId> <version>2.7.8</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-transports-http-jetty</artifactId> <version>2.7.8</version> </dependency> <!-- e-cxf --> <dependency> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-webapp</artifactId> <version>8.1.14.v20131031</version> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.0.4</version> </dependency> <dependency> <groupId>cglib</groupId> <artifactId>cglib-nodep</artifactId> <version>2.2.2</version> </dependency> <!-- <dependency> <groupId>org.apache.ws.security</groupId> <artifactId>wss4j</artifactId> <version>1.6.13</version> </dependency> --> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-ws-rm</artifactId> <version>2.7.8</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-ws-security</artifactId> <version>2.7.8</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-ws-addr</artifactId> <version>2.7.8</version> </dependency> <dependency> <groupId>org.apache.cxf</groupId> <artifactId>cxf-rt-ws-policy</artifactId> <version>2.7.8</version> </dependency> <dependency> <groupId>org.slf4j</groupId> <artifactId>jcl-over-slf4j</artifactId> <version>1.5.8</version> </dependency> <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>woodstox-core-asl</artifactId> <version>4.2.0</version> </dependency> <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>stax2-api</artifactId> <version>3.0.1</version> </dependency> <!-- <dependency> <groupId>nl.pinkroccade.quarant</groupId> <artifactId>quarant-domain-model</artifactId> <version>1.0.0</version> </dependency>--> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc14</artifactId> <version>10.2.0.4.0</version> </dependency> <!-- axis2--> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-adb</artifactId> <version>${axis2.version}</version> </dependency> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-adb-codegen</artifactId> <version>${axis2.version}</version> <exclusions> <exclusion> <artifactId>org.apache.ws.commons.schema</artifactId> <groupId>XmlSchema</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-java2wsdl</artifactId> <version>${axis2.version}</version> <exclusions> <exclusion> <artifactId>org.apache.ws.commons.schema</artifactId> <groupId>XmlSchema</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-jaxws</artifactId> <version>${axis2.version}</version> </dependency> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-kernel</artifactId> <version>${axis2.version}</version> <exclusions> <exclusion> <artifactId>org.apache.ws.commons.schema</artifactId> <groupId>XmlSchema</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-saaj</artifactId> <version>${axis2.version}</version> </dependency> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-transport-http</artifactId> <version>${axis2.version}</version> </dependency> <dependency> <groupId>org.apache.axis2</groupId> <artifactId>axis2-transport-local</artifactId> <version>${axis2.version}</version> </dependency> <dependency> <groupId>org.apache.ws.commons.axiom</groupId> <artifactId>axiom-api</artifactId> <version>1.2.13</version> </dependency> <dependency> <groupId>org.apache.ws.commons.axiom</groupId> <artifactId>axiom-impl</artifactId> <version>1.2.13</version> </dependency> <dependency> <groupId>javax.activation</groupId> <artifactId>activation</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>commons-codec</groupId> <artifactId>commons-codec</artifactId> <version>1.3</version> </dependency> <dependency> <groupId>commons-httpclient</groupId> <artifactId>commons-httpclient</artifactId> <version>3.1</version> </dependency> <dependency> <groupId>org.apache.geronimo.specs</groupId> <artifactId>geronimo-stax-api_1.0_spec</artifactId> <version>1.0.1</version> </dependency> <dependency> <groupId>org.apache.neethi</groupId> <artifactId>neethi</artifactId> <version>3.0.2</version> </dependency> <dependency> <groupId>wsdl4j</groupId> <artifactId>wsdl4j</artifactId> <version>1.6.2</version> </dependency> <dependency> <groupId>org.codehaus.woodstox</groupId> <artifactId>wstx-asl</artifactId> <version>3.2.9</version> </dependency> <dependency> <groupId>org.quartz-scheduler</groupId> <artifactId>quartz</artifactId> <version>1.7.2</version> </dependency> <!-- servlet --> <dependency> <groupId>javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> </dependency> </dependencies> </project>
遇到问题
使用cxf ws-security 安全认证
org.apache.axiom.soap.impl.dom.SOAPEnvelopeImpl cannot be cast to javax.xml.soap.SOAPElement
对其错误进行了debug
创建MessageFactory这个地方问题
public static MessageFactory createMessageFactory(SoapVersion version) throws SOAPException { MessageFactory messageFactory; String messageFactoryClassName = SystemPropertyAction.getPropertyOrNull(MESSAGE_FACTORY_KEY); if (messageFactoryClassName != null) { messageFactory = newInstanceCxfSAAJFactory(messageFactoryClassName, MessageFactory.class); } else if (version instanceof Soap11) { try { messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); } catch (Throwable t) { messageFactory = MessageFactory.newInstance(); } } else if (version instanceof Soap12) { try { messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); } catch (Throwable t) { messageFactory = MessageFactory.newInstance(); } } else { messageFactory = MessageFactory.newInstance(); } return messageFactory; } public static SOAPFactory createSOAPFactory(SoapVersion version) throws SOAPException { SOAPFactory soapFactory; String soapFactoryClassName = SystemPropertyAction.getPropertyOrNull(SOAP_FACTORY_KEY); if (soapFactoryClassName != null) { soapFactory = newInstanceCxfSAAJFactory(soapFactoryClassName, SOAPFactory.class); } else if (version instanceof Soap11) { try { soapFactory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); } catch (Throwable t) { soapFactory = SOAPFactory.newInstance(); } } else if (version instanceof Soap12) { try { soapFactory = SOAPFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL); } catch (Throwable t) { soapFactory = SOAPFactory.newInstance(); } } else { soapFactory = SOAPFactory.newInstance(); } return soapFactory; }
创建MessageFactory,有点象jdbc连接。对外提供接口,具体的实现就留给厂家去实现。
现在这里的问题是 厂家有多个,而MessageFactory如果找到了第一个厂家就不会去找第二个。
仔细查看了代码。
cxf 提供使用自己的messageFactoryClassName
if (messageFactoryClassName != null) {
messageFactory = newInstanceCxfSAAJFactory(messageFactoryClassName,
MessageFactory.class);
}
解决问题是关键
MessageFactory.class
我们可以自己去系统设置 MessageFactory 实体的实例化类
System.setProperty("org.apache.cxf.binding.soap.messageFactoryClassName","com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl");
现在有一个问题是是服务端怎么去实现系统设置?
因为服务端的安全认证是配置在spring中。
可以用拦截器去实现
package com.telecommunications.interceptor; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.message.Message; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; public class CxfSystemEnvIntercepter extends AbstractPhaseInterceptor<Message>{ public CxfSystemEnvIntercepter(String phase) { super(phase); } public CxfSystemEnvIntercepter(){ super(Phase.RECEIVE); //System.setProperty("org.apache.cxf.binding.soap.messageFactoryClassName","com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"); } @Override public void handleMessage(Message message) throws Fault { // TODO Auto-generated method stub if(null==System.getProperty("org.apache.cxf.binding.soap.messageFactoryClassName")||"".equals(System.getProperty("org.apache.cxf.binding.soap.messageFactoryClassName"))){ System.setProperty("org.apache.cxf.binding.soap.messageFactoryClassName","com.sun.xml.internal.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl"); } } }
Spring.xml
<jaxws:inInterceptors> <ref bean="loggingInInterceptor"/> <bean class="com.telecommunications.interceptor.CxfSystemEnvIntercepter"></bean> <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" /> <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor"> <constructor-arg> <map> <entry key="action" value="UsernameToken" /> <entry key="passwordType" value="PasswordText" /> <entry key="user" value="EDA" /> <entry key="passwordCallbackRef"> <ref bean="serverAutherHandler" /> </entry> </map> </constructor-arg> </bean> </jaxws:inInterceptors>
jar冲突
axis2
<artifactId>org.apache.ws.commons.schema</artifactId>
<groupId>XmlSchema</groupId>
<version>1.4.7</version>
cxf
xmlschema-core-2.0.3
删除 axis2的xmlschema的jar
相关推荐
Axis2是由Axis1.x系列演化而来,而Apache CXF则是由Celtix和XFire项目整合而生。在本文中,我们将探讨CXF和Axis2框架的区别,以帮助开发者更好地选择适合自己的框架。 架构设计 Axis2是一个对Axis进行了彻底的重写...
2. 创建Web服务:使用CXF的wsdl2java工具或者Axis的wsdl2java工具,从WSDL文件生成Java服务接口和服务实现。 3. 配置服务发布:在Spring配置文件中,通过CXF或Axis的配置元素,设置服务的地址和绑定信息。 4. 客户端...
整合Spring和Axis2,主要是为了利用Spring的依赖注入和管理能力,以及Axis2的Web服务处理能力。整合过程主要包括以下步骤: - 配置Spring容器:首先在Spring配置文件中定义Web服务的bean,这些bean通常代表了服务...
在Web服务开发中,CXF、AXIS2和XFire是常见的Java API,用于构建和消费SOAP(简单对象访问协议)服务。这些框架提供了丰富的功能,使得开发者能够方便地创建和调用Web服务。本文将详细介绍使用CXF作为客户端调用Web...
CXF是Apache基金会的一个项目,它整合了XFire和Axis2的优势,提供了一站式的解决方案,支持SOAP、REST、WS-*标准等。 4. CXF特性 - 强大的工具集,包括WSDL-to-Java和Java-to-WSDL工具。 - 对WS-Security、WS-...
针对目前网上的很多cxf相关的服务开发源码不能使用,自己做的cxf与spring的整合,里面包含了服务端和客户端代码,还有说明文档,这个demo使用的是cxf的服务端,axis2的客户端,希望能够帮到cxf初学者们。
在本教程中,我们将深入探讨如何使用Spring Boot与Apache CXF整合来创建并提供Web服务。Spring Boot以其简化Java应用程序开发的特性而受到广泛欢迎,而CXF则是一个流行的开源框架,用于构建和消费Web服务。当我们...
在Java开发中,有时我们可能需要整合不同的框架或者库,比如Apache CXF和XFire,这两个都是用于构建Web服务的框架。然而,由于它们都包含了处理XML Schema(XmlSchema)的相关组件,可能会出现jar包冲突的问题,导致...
本主题聚焦于如何使用Spring3 MVC与Hibernate进行整合,以便更好地处理业务逻辑和数据持久化,并结合Axis2发布Web服务,同时利用Quartz进行任务调度。以下将详细介绍这些技术及其整合过程。 **Spring3 MVC** 是...
10. **与其他Apache项目的整合**:`Axis2`与许多其他Apache项目良好集成,如`CXF`、`WSO2`等,可以构建更复杂的企业级Web服务解决方案。 在实际应用中,`axis2.jar`通常包含`Axis2`运行时库,包含了执行Web服务所需...
本文将深入探讨如何将Spring 4.0与Apache Axis2整合,以便利用Spring的强大功能来管理和控制服务,同时利用Axis2作为高效的Web服务引擎。 首先,Spring 4.0是Spring框架的一个重要版本,它引入了对Java 8的支持,...
这份文档由ProdigyWit和Along两位作者共同编写,自2008年首次作为《AXIS开发指南》发布以来,经过多次修订与扩充,最终于2009年加入了整合篇,形成了包含Axis、XFire和CXF使用的全面指南。 ### Web Service概述 ...
需要注意的是,虽然这是一种可行的解决方案,但因为Axis1.4的年代久远,可能遇到一些兼容性和性能问题,所以在条件允许的情况下,推荐使用更新的Web服务框架,如Apache CXF或Spring Web Services的最新版本。
CXF整合了多种技术,包括Apache Axis2和XFire,提供了一个全面且灵活的解决方案。 1. **深入浅出WebService**:Web服务是一种通过互联网交换结构化信息的标准方式。它基于WSDL(Web Services Description Language...
相比其他类似的框架,如AXIS和AXIS2,CXF的优势在于其易于使用和与Spring的紧密配合。许多开发者选择CXF正是因为它的这一特性,能够减少配置工作并提供更好的可维护性。 在实际项目中,整合CXF和Spring通常涉及以下...
XFire(后来被整合到Apache CXF项目中)也是一个强大的Web服务框架,设计目的是简化Web服务的开发过程。与Axis1类似,XFire支持SOAP,但还支持其他协议,如RESTful服务。它以其高效和易用性著称,提供了一套丰富的...
3. **丰富的绑定和模块**: Axis拥有众多的模块,如Axis2 JMS Transport、Axis2 MTOM/SwA等,可以满足不同的需求。 4. **广泛的社区支持**:由于Apache社区的强大支持,轴有丰富的文档和活跃的用户群,问题解决和...
在这个配置类中,我们定义了CXF的servlet、spring bus和实现类appService。我们还添加了一个AuthInterceptor来进行用户名密码校验。 四、实现用户名密码校验 现在,我们需要实现用户名密码校验。我们可以在...