什么是webservicetemplate的现代等价物?

az31mfrm  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(169)

我正在升级一个旧的spring项目,我有这样的代码。。。

<bean id="templateSearch" class="org.springframework.ws.client.core.WebServiceTemplate">
    <constructor-arg ref="messageFactory" />
    <property name="marshaller" ref="..."></property>
    <property name="unmarshaller" ref="..."></property>
    <property name="messageSender">
        <bean class="org.springframework.ws.transport.http.HttpComponentsMessageSender">
            <property name="connectionTimeout" value="${webservice.connectionTimeout}" /> 
            <property name="readTimeout" value="${webservice.readTimeout}" />
        </bean>
    </property>
    <property name="defaultUri" value="..." />
</bean>

这个是这样用的。。。

WebServiceTemplate template = (WebServiceTemplate) app.getBean("templateSearch");
JAXBElement response =  (JAXBElement) template.marshalSendAndReceive(
    new ObjectFactory().createSearchContact(search));

现在我完全理解了这里发生的事情,请求被发送到默认uri,然后使用注入的封送器进行解封。然而, org.springframework.ws.client.core.WebServiceTemplate 似乎不再是Spring的事了,我找不到更现代的例子了。
有人能帮我找到适合这个代码的迁移路径吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题