クラス WsdlDefinitionHandlerAdapter
- 実装済みのインターフェース一覧:
org.springframework.beans.factory.InitializingBean,org.springframework.web.servlet.HandlerAdapter
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 プロパティを変更することでカスタマイズできます。
フィールド概要
フィールドコンストラクター概要
コンストラクター方法の概要
修飾子と型メソッド説明voidlonggetLastModified(jakarta.servlet.http.HttpServletRequest request, ObjectSE handler) org.springframework.web.servlet.ModelAndViewhandle(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, ObjectSE handler) voidsetLocationExpression(StringSE locationExpression) WSDL 1.1 定義からlocation属性を抽出するために使用される XPath 式を設定します。voidsetSchemaLocationExpression(StringSE schemaLocationExpression) WSDL 1.1 定義からschemaLocation属性を抽出するために使用される XPath 式を設定します。voidsetTransformLocations(boolean transformLocations) 受信HttpServletRequestのリクエスト URI を使用して WSDL 内の相対アドレス位置を変換するかどうかを設定します。voidsetTransformSchemaLocations(boolean transformSchemaLocations) 受信HttpServletRequestのリクエスト URI を使用して WSDL 内の相対アドレススキーマの場所を変換するかどうかを設定します。booleanprotected voidtransformLocations(DocumentSE definitionDocument, jakarta.servlet.http.HttpServletRequest request) HttpServletRequestで指定されたサーバー名を反映するように、すべてのlocation属性を変換します。protected voidtransformSchemaLocations(DocumentSE definitionDocument, jakarta.servlet.http.HttpServletRequest request) HttpServletRequestで指定されたサーバー名を反映するように、すべてのschemaLocation属性を変換します。クラス org.springframework.ws.transport.http.LocationTransformerObjectSupport から継承されたメソッド
transformLocation, transformLocationsクラス org.springframework.xml.transform.TransformerObjectSupport から継承されたメソッド
createTransformer, getTransformerFactory, newTransformerFactory, setTransformerFactoryClass, transform
フィールドの詳細
コンストラクターの詳細
WsdlDefinitionHandlerAdapter
public WsdlDefinitionHandlerAdapter()
方法の詳細
setLocationExpression
WSDL 1.1 定義からlocation属性を抽出するために使用される XPath 式を設定します。デフォルトは
DEFAULT_LOCATION_EXPRESSIONです。setSchemaLocationExpression
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
- 次で指定:
- インターフェース
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
- 次で指定:
- インターフェース
org.springframework.web.servlet.HandlerAdapter内のsupports
afterPropertiesSet
- 次で指定:
- インターフェース
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 の場合にのみ呼び出されます。transformSchemaLocations
protected void transformSchemaLocations(DocumentSE definitionDocument, jakarta.servlet.http.HttpServletRequest request) throws ExceptionSE HttpServletRequestで指定されたサーバー名を反映するように、すべてのschemaLocation属性を変換します。定義された XPath 式を評価して適切な属性を決定し、transformLocationに委譲して、一致するすべての属性の変換を実行します。このメソッドは、
transformSchemaLocationsプロパティが true の場合にのみ呼び出されます。