繁体   English   中英

Spring-WS Apache Camel with Soap version 1.2

[英]Spring-ws apache Camel with soap version 1.2

我正在使用spring-ws apache骆驼,默认情况下它支持soap 1.1。 但是我想发布一个将其绑定到soap 1.2的请求,因为我的端点服务仅支持soap 1.2。 我试图在applicationContext.xml中像下面一样设置messageFactory

<bean id="soapMessageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMessageFactory">               <property name="soapVersion">                   
<util:constant static-field="org.springframework.ws.soap.SoapVersion.SOAP_12"/>               
</property>                        
</bean> 

然后将其添加到RouteBuilder中,如.to(“ spring-ws:https://” + url +“?soapAction =#xxx&wsAddressingAction =#xxx&messageFactory =#soapMessageFactory

但这是行不通的。 还有其他方法可以在spring-ws组件中设置soap版本吗? 我无权访问Web服务。

谢谢

我遇到了类似的情况,并采用了稍微不同的方法来解决该问题。 我创建了一个自定义WebServiceTemplate并将消息工厂附加到它。 然后,在RouteBuilder中将webServiceTemplate指定为调用的一部分。 这是代码:

@Bean
public WebServiceTemplate webServiceTemplate() throws Exception {
    final MessageFactory msgFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
    final SaajSoapMessageFactory messageFactory = new SaajSoapMessageFactory(msgFactory);
    final WebServiceTemplate webServiceTemplate = new WebServiceTemplate(messageFactory);

    return webServiceTemplate;
}

然后在我的路线中,我像这样打了电话:

    .toD("spring-ws:{{some.service.url}}?webServiceTemplate=#webServiceTemplate&wsAddressingAction=http://test.org/SomeService/SomeOperation")

希望这会有所帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM