读书人

Spring 配备 Axis client 动态指定 WS

发布时间: 2012-11-06 14:07:00 作者: rapoo

Spring 配置 Axis client 动态指定 WSDL

Spring 对 Axis 有了比较好的支持

通过WSDL 生成的接口? 只需要通过配置? 就可以完成 Webservice client 的实现 无需自己动手 简单方便

配置文档如下

  1. <!--?WEBSERVICE?CLIENT?-->??
  2. ????<bean?id="ackWebServiceClient"??
  3. ????????class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean"??
  4. ????????lazy-init="true">??
  5. ????????<property?name="serviceFactoryClass"??
  6. ????????????value="org.apache.axis.client.ServiceFactory"?/>??
  7. ????????<property?name="serviceInterface"??
  8. ????????????value="org.thinker.webservice.client.IClient"?/>??
  9. ????????<property?name="wsdlDocumentUrl"??
  10. ????????????value="http://localhost:8080/sh_ack_server/services/ackService?wsdl"?/>??
  11. ????????<property?name="namespaceUri"??
  12. ????????????value="http://localhost:8080/sh_ack_server/services/ackService"?/>??
  13. ????????<property?name="serviceName"?value="RemoteACKServerService"?/>??
  14. ????????<property?name="portName"?value="ackService"?/>??
  15. ????</bean>??

我们直接用就好了

但有个问题?? 如果我想要用 Spring 的这个 代理类? 即 org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean

但我需要动态的指定 wsdl?/namespace/serviceName/portName 属性 如何才能做到呢 ??

读书人网 >软件架构设计

热点推荐