jax-ws spring client 详解
2012-08-08 17:24
726 查看
jax-ws spring client 详解
2010-07-06 17:42
2010-07-06 17:42
1 将 wevservice 客户端 通过<jaxws:client>元素,注入到spring的配置文件中,类似<jaxws:endpoint>元素被用户服务端 2 具体的例子 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <jaxws:client id="helloClient" serviceClass="demo.spring.HelloWorld" address="http://localhost:9002/HelloWorld" /> </beans> <jaxws:client>元素说明: id: String类型,唯一标识,可以被spring的bean进行调用 serviceClass:Class 类型,内容为完整的类名称,SEI 接口名 address:QName 类型,对应wsdl:service@name. endpointName :QName,对应wsdl:port@name wsdlLocation:URL类型,A URL to connect to in order to retrieve the WSDL for the service. This is not required 3 更详细的例子 <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd"> <!-- Interceptors extend e.g. org.apache.cxf.phase.AbstractPhaseInterceptor --> <bean id="anotherInterceptor" class="..." /> <!-- Handlers implement e.g. javax.xml.ws.handler.soap.SOAPHandler --> <bean id="jaxwsHandler" class="..." /> <!-- The SOAP client bean --> <jaxws:client id="helloClient" serviceClass="demo.spring.HelloWorld" address="http://localhost:9002/HelloWorld"> <jaxws:inInterceptors> <bean class="org.apache.cxf.interceptor.LoggingInInterceptor"/> <ref bean="anotherInterceptor"/> </jaxws:inInterceptor> <jaxws:handlers> <ref bean="jaxwsHandler" /> </jaxws:handlers> <jaxws:properties> <entry key="mtom-enabled" value="true"/> </jaxws:properties> </jaxws:client> </beans> <jaxws:client>子元素: jaxws:inInterceptors:拦截器,必须实现Each should implement org.apache.cxf.interceptor.Interceptor or org.apache.cxf.phase.PhaseInterceptor jaxws:handlers:处理类,必须实现javax.xml.ws.handler.Handler or javax.xml.ws.handler.soap.SOAPHandler. jaxws:properties :属性, MAP |
相关文章推荐
- Spring Web Service Client via JaxWsPortProxyFactoryBean
- java,某行代码不执行,也不报错。JaxWsDynamicClientFactory.newInstance();
- JAX-WS - Soap详解
- CXF----webservice和Spring之JaxWsProxyFactoryBean调用
- Jax-ws server side and client side
- WebService学习之旅(三)JAX-WS与Spring整合发布WebService
- Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws]
- CXF动态客户端如何优化JaxWsDynamicClientFactory.createClient -- 慢
- Spring WS Add Soap Header In Client
- JAX-WS开发webservice示例详解
- Spring jaxws 整合
- Apache CXF实现Web Service(1)——不借助重量级Web容器和Spring实现一个纯的JAX-WS web service
- Creating a Simple Web Service and Client with JAX-WS
- Jax-ws 开发webService ,并使用spring注入service类中遇到 空指针
- JAX-WS开发webservice接口的注解的应用和注解的详解
- WebService(2) JAX-WS、CXF、Spring3.0+
- JAX-WS - Handler详解
- 利用JaxWsDynamicClientFactory 调用webservice 报错解决
- 实现JAX-WS,如果忘了jaxws-spring这个jar的奇怪现象
- WebService学习之旅(三)JAX-WS与Spring整合发布WebService