質問

注釈を使用する2つのエンドポイントがあります。それぞれに異なるインターセプターを適用したい。 (1つは安全なインターセプターで、もう1つは安全ではありません) PayloadRootAnnotationMethodEndpointMapping を使用してこれを行う方法はありますか?誰でもアイデアがありますか?

Springに付属している航空会社のサンプルのapplicationContext-ws.xmlによると:

  

エンドポイントマッピングは、   エンドポイントへのリクエスト。なぜなら私たちは   セキュリティインターセプトのみが必要   発生する    GetFrequentFlyerMileageEndpoint 、我々   2つのマッピングを定義します。1つは   securityInterceptor、および一般的なもの   それなしで。

これを行う唯一の方法は、 org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping org.springframework.ws.serverの2つの異なるマッピングを持つことです。エンドポイント.mapping.PayloadRootQNameEndpointMapping は安全なものですか?

役に立ちましたか?

解決

EndpointMapping にインターセプターを設定すると、それらのインターセプターは、その EndpointMapping によってマップされたすべてのエンドポイントに適用されます。そのため、一部のエンドポイントが他のエンドポイントへのインターセプターの異なるセットを取得する場合、はい、2つの異なる EndpointMapping Beanが必要です。インターセプターと保護されていないエンドポイントへのマッピング。

どの EndpointMapping 実装を使用するかは、アプリケーションと、使用するエンドポイントの種類によって異なります。

他のヒント

また、アプリケーションコンテキストでsws:interceptors要素を使用して、soapActionまたはpayloadRoot属性でフィルタリングされた特定のエンドポイントを持つ特定のインターセプターを指定することもできます。

から: http://static.springsource.org /spring-ws/site/reference/html/server.html#server-endpoint-interceptor

<sws:interceptors>
  <bean class="samples.MyGlobalInterceptor"/>
  <sws:payloadRoot namespaceUri="http://www.example.com">
    <bean class="samples.MyPayloadRootInterceptor"/>
  </sws:payloadRoot>
  <sws:soapAction value="http://www.example.com/SoapAction">
    <bean class="samples.MySoapActionInterceptor1"/>
    <ref bean="mySoapActionInterceptor2"/>
  </sws:soapAction>
</sws:interceptors>

<bean id="mySoapActionInterceptor2" class="samples.MySoapActionInterceptor2"/>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top