用于不同Web服务调用的Spring 3 Web服务模板?

时间:2012-11-20 17:40:11

标签: marshalling spring-3 webservicetemplate

我不熟悉使用WebserviceTemplate拨打客户电话。

我可以将marshalSendAndReceive(request)用于单个公开的WS。在我的客户端内,我也需要调用其他WS。在我的SpringConfig.xml中, jaxbMarshaller定义为p:contextPath="com.acme.domain1.service1"。据我了解,contextpath用于编组请求。

因此,如果我需要调用生成的类在service2下的com.foo.service2,我该如何在同一代码中执行此操作?我正在自动装配WebserviceTemplate

1 个答案:

答案 0 :(得分:0)

只需添加列表

即可
<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
                 <property name="contextPaths">
                        <list>
                                <value>com.acme.domain1.service1</value>
                                <value>com.foo.service2</value>
                        </list>
                </property>
</bean>
相关问题