クラス WsdlDefinitionHandlerAdapter

実装済みのインターフェース一覧:
org.springframework.beans.factory.InitializingBeanorg.springframework.web.servlet.HandlerAdapter

public class WsdlDefinitionHandlerAdapter extends LocationTransformerObjectSupport implements org.springframework.web.servlet.HandlerAdapter, org.springframework.beans.factory.InitializingBean
汎用 DispatcherServlet で WsdlDefinition インターフェースを使用するためのアダプター。

マップされた WsdlDefinition 実装からソースを読み取り、その結果として HttpServletResponse に書き込みます。

プロパティ transformLocations が true に設定されている場合、このアダプターは、WSDL 定義の location 属性を変更して、受信リクエストの URL を反映します。元の WSDL の場所フィールドが絶対パスの場合、スキーム、ホスト名、ポートが変更されます。場所が相対パスの場合、スキーム、ホスト名、ポート、コンテキストパスが先頭に追加されます。この動作は、transformLocation() メソッドをオーバーライドすることでカスタマイズできます。

たとえば、WSDL で定義されている location 属性が http://localhost:8080/context/services/myService であり、WSDL のリクエスト URI が http://example.com/context/myService.wsdl である場合、ロケーションは http://example.com/context/services/myService に変更されます。

WSDL で定義されている location 属性が /services/myService であり、WSDL のリクエスト URI が http://example.com:8080/context/myService.wsdl である場合、場所は http://example.com:8080/context/services/myService に変更されます。

transformLocations が有効になっている場合、WSDL 定義で見つかったすべての location 属性がデフォルトで変更されます。この動作は、変更する属性に一致する XPath 式である locationExpression プロパティを変更することでカスタマイズできます。

導入:
1.0.0
作成者:
Arjen Poutsma
関連事項:
  • フィールドの詳細

    • DEFAULT_LOCATION_EXPRESSION

      public static final StringSE DEFAULT_LOCATION_EXPRESSION
      WSDL 定義からすべての location 属性を抽出するために使用されるデフォルトの XPath 式。
      関連事項:
    • DEFAULT_SCHEMA_LOCATION_EXPRESSION

      public static final StringSE DEFAULT_SCHEMA_LOCATION_EXPRESSION
      WSDL 定義からすべての schemaLocation 属性を抽出するために使用されるデフォルトの XPath 式。
      関連事項:
  • コンストラクターの詳細

    • WsdlDefinitionHandlerAdapter

      public WsdlDefinitionHandlerAdapter()
  • 方法の詳細

    • setLocationExpression

      public void setLocationExpression(StringSE locationExpression)
      WSDL 1.1 定義から location 属性を抽出するために使用される XPath 式を設定します。

      デフォルトは DEFAULT_LOCATION_EXPRESSION です。

    • setSchemaLocationExpression

      public void setSchemaLocationExpression(StringSE schemaLocationExpression)
      WSDL 1.1 定義から schemaLocation 属性を抽出するために使用される XPath 式を設定します。

      デフォルトは DEFAULT_SCHEMA_LOCATION_EXPRESSION です。

    • setTransformLocations

      public void setTransformLocations(boolean transformLocations)
      受信 HttpServletRequest のリクエスト URI を使用して WSDL 内の相対アドレス位置を変換するかどうかを設定します。デフォルトは false です。
    • setTransformSchemaLocations

      public void setTransformSchemaLocations(boolean transformSchemaLocations)
      受信 HttpServletRequest のリクエスト URI を使用して WSDL 内の相対アドレススキーマの場所を変換するかどうかを設定します。デフォルトは false です。
    • getLastModified

      public long getLastModified(jakarta.servlet.http.HttpServletRequest request, ObjectSE handler)
      次で指定:
      インターフェース org.springframework.web.servlet.HandlerAdapter 内の getLastModified 
    • handle

      public org.springframework.web.servlet.ModelAndView handle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, ObjectSE handler) throws ExceptionSE
      次で指定:
      インターフェース org.springframework.web.servlet.HandlerAdapter 内の handle 
      例外:
      ExceptionSE
    • supports

      public boolean supports(ObjectSE handler)
      次で指定:
      インターフェース org.springframework.web.servlet.HandlerAdapter 内の supports 
    • afterPropertiesSet

      public void afterPropertiesSet() throws ExceptionSE
      次で指定:
      インターフェース org.springframework.beans.factory.InitializingBean 内の afterPropertiesSet 
      例外:
      ExceptionSE
    • transformLocations

      protected void transformLocations(DocumentSE definitionDocument, jakarta.servlet.http.HttpServletRequest request) throws ExceptionSE
      HttpServletRequest で指定されたサーバー名を反映するように、すべての location 属性を変換します。定義された XPath 式を評価して適切な属性を決定し、transformLocation に委譲して、一致するすべての属性の変換を実行します。

      このメソッドは、transformLocations プロパティが true の場合にのみ呼び出されます。

      例外:
      ExceptionSE
      関連事項:
    • transformSchemaLocations

      protected void transformSchemaLocations(DocumentSE definitionDocument, jakarta.servlet.http.HttpServletRequest request) throws ExceptionSE
      HttpServletRequest で指定されたサーバー名を反映するように、すべての schemaLocation 属性を変換します。定義された XPath 式を評価して適切な属性を決定し、transformLocation に委譲して、一致するすべての属性の変換を実行します。

      このメソッドは、transformSchemaLocations プロパティが true の場合にのみ呼び出されます。

      例外:
      ExceptionSE
      関連事項: