私はSpring Integrationプロジェクトの一部としてSpring WSエンドポイントを持っています。私はSoap Headerにアクセスしたいと思います。SoapHeaderをSpring WSエンドポイントに追加
[10/05/16 05:00:05:005 PDT]ローカルホスト-startStop-1 DEBUG springframework.integration.util.MessagingMethodInvokerHelper私は私は次の例外を取得するメソッドパラメータにSoapHeaderはを追加する場合.doWith(): メソッド[public com.bstonetech.ptms.integration.model.ws.external.contract.GetContractRespons com.bstonetech.ptms.integration.service.ws.GetContractEndpoint.getContract(com.bstonetech.ptms。メッセージの処理に適さない 複数のパラメータ型候補が見つかりました: [@ org.springframework.ws.server.endpoint.annotation.RequestPayload com.bstonetech.ptms.integration.model.ws.external.contract.GetContractRequest] および[org.springframework.ws.context.MessageContext]。 [10/05/16 05:00:05:005 PDT]ローカルホスト-startStop-1)( web.context.support.XmlWebApplicationContext.refreshに警告:例外コンテキスト初期化中に遭遇 - キャンセルリフレッシュ試行
ジャワ.lang.IllegalArgumentException:[クラス com.bstonetech.ptms.integration.service.ws.GetContractEndpoint]タイプのターゲットオブジェクトに、 メッセージを処理するための適格なメソッドがありません。
MessageContext messageContextも同じエラーが発生します。
私は明らかに何かが不足しています。どんな助けもありがとう。次のように
の統合は、次のように
<oxm:jaxb2-marshaller id="contractMarshaller" context-path="com.bstonetech.ptms.integration.model.ws.external.contract"/>
<ws:inbound-gateway id="getContractWs" request-channel="inboundGetContractChannel" mapped-request-headers="fileId" mapped-reply-headers="fileId"
marshaller="contractMarshaller" unmarshaller="contractMarshaller"/>
<int:service-activator id="contractEndpoint" input-channel="inboundGetContractChannel" ref="getContractEndpoint"/>
エンドポイントが見えます:遅延の
@Endpoint
public class GetContractEndpoint {
private static final String NAMESPACE_URI = "http://bstonetech.com/contract";
@PayloadRoot(namespace = NAMESPACE_URI, localPart = "GetContractRequest")
@ResponsePayload
public GetContractResponse getContract(@RequestPayload GetContractRequest request, SoapHeader soapHeader) throws Exception {
.....
}
私は今理解しています。私は今、PayloadRootQNameEndpointMappingを使用してゲートウェイのマッピングを行い、エンドポイントをPOJOとして実装しています。 – alan
それでも、これを行い、ダウンストリームのメッセージングを得ることができます。すべての@Endpoint設定を@MessagingGatewayレベルに移動してください。 –
これから進むEnboundInterceptorを実装して、すべての着信Webサービスコールを傍受します。私はそれぞれのケースでデータベースに書き込み、成功または失敗をログに記録します。作成したデータベーステーブルの行IDをPOJOに渡すことができます。 MessageContextには設定できるプロパティがあることがわかります。 POJOでMessageContextを取得したり、POJOを実行する前にプロパティをヘッダーにマップすることは可能ですか? – alan