簡體   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