MyEclipse6.0如何配置XFire
解决方案 »
- 关于EJB的调查
- Event.observe(window, 'load', init, false) IE7出错,请各位大侠帮忙看看
- 使用ibatis 出现异常
- 请教一个跟jsp页面相关的问题!!
- vb(Client)+Java(Server)端Web Service数据传输的加密和解密问题!
- 关于struts标签的问题
- 关于Tomcat远程热部署的问题。
- myeclipse hibernate reverse engineering出现 An internal error occurred during:
- tomcat 如何设置为调试模式,程序修改后不需要重新启动
- 如何在一个CLASS的方法内得到方法的名称
- TOMCAT下面配置多域名出错了
- velocity的问题!!
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml
/WEB-INF/xfire-servlet.xml
</param-value>
</context-param>
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
<context-param>
<param-name>webAppRootKey</param-name>
<param-value>yygh.root</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>xfire</servlet-name>
<!--<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
-->
<servlet-class>org.codehaus.xfire.spring.XFireSpringServlet</servlet-class>
<!--
<load-on-startup>0</load-on-startup>
--></servlet>
<servlet-mapping>
<servlet-name>xfire</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
</web-app>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd" ><beans default-autowire="byName"> <!--引入XFire的预配置文件-->
<import resource="classpath:org/codehaus/xfire/spring/xfire.xml" /><!--
获得applicationContext中所有bean的JSR181 annotation
<bean id="webAnnotations"
class="org.codehaus.xfire.annotations.jsr181.Jsr181WebAnnotations"
lazy-init="false" />
定义handler mapping,将所有JSR181定义的bean导出为web service
<bean id="jsr181HandlerMapping"
class="org.codehaus.xfire.spring.remoting.Jsr181HandlerMapping"
lazy-init="false">
<property name="xfire" ref="xfire" />
<property name="webAnnotations" ref="webAnnotations" />
</bean>
--><!--
Declare a parent bean with all properties common to both services
--> <bean id="baseWebService"
class="org.codehaus.xfire.spring.remoting.XFireExporter" lazy-init="false" abstract="true"> <property name="serviceFactory">
<ref bean="xfire.serviceFactory" />
</property> <property name="xfire">
<ref bean="xfire" />
</property>
</bean>
<bean parent="baseWebService">
<property name="serviceBean"><!-- applicationcontext的bean的名字-->
<ref bean="QueryBusiness" />
</property> <property name="serviceClass"><!-- 导出的接口类 -->
<value>com.export.Iquery</value>
</property> <property name="name" value="Query"></property><!-- Web service 服务名-->
<!--
<property name="inHandlers">
<list>
<ref bean="domInHandler" />
<ref bean="wss4jInHandler"/>
</list>
</property>
--> </bean>
<bean parent="baseWebService">
<property name="serviceBean">
<ref bean="UpdateBussiness"/>
</property>
<property name="serviceClass"><!-- 导出的接口类 -->
<value>com.export.Iupdate</value>
</property> <property name="name" value="Update"></property><!-- Web service 服务名-->
<!--
<property name="inHandlers">
<list>
<ref bean="domInHandler" />
<ref bean="wss4jInHandler"/>
</list>
</property>
-->
</bean>
<bean id="domInHandler" class="org.codehaus.xfire.util.dom.DOMInHandler"></bean>
<bean id="wss4jInHandler" class="org.codehaus.xfire.security.wss4j.WSS4JInHandler">
<property name="properties">
<props>
<prop key="action">UsernameToken</prop>
<prop key="passwordCallbackClass">
com.security.UtPasswordHandler
</prop>
</props>
</property>
</bean>
<!--
END SNIPPET: xfire
--></beans>
工程右键--MyEclipse---Add Xfire Web Service Capabilities
再按你选择的就可以了
默认的好像缺包,用的过程中发现缺什么就加什么