Interface DocumentAddressResolver


public interface DocumentAddressResolver
Resolves relative references among SDDocuments.

This interface is implemented by the caller of SDDocument.writeTo(com.sun.xml.ws.api.server.PortAddressResolver, com.sun.xml.ws.api.server.DocumentAddressResolver, java.io.OutputStream) method so that the SDDocument can correctly produce references to other documents.

This mechanism allows the user of WSEndpoint to assign logical URLs to each SDDocument (which is often necessarily done in a transport-dependent way), and then serve description documents.

Usage Example 1

HTTP servlet transport chose to expose those metadata documents to HTTP GET requests where each SDDocument is identified by a simple query string "?ID". (HTTP servlet transport assigns such IDs by itself.)

In this nameing scheme, when SDDocument X refers to SDDocument Y, it can put a reference as "?IDofY". By implementing DocumentAddressResolver it can do so.

Author:
Kohsuke Kawaguchi
  • Method Details

    • getRelativeAddressFor

      @Nullable String getRelativeAddressFor(@NotNull SDDocument current, @NotNull SDDocument referenced)
      Produces a relative reference from one document to another.
      Parameters:
      current - The document that is being generated.
      referenced - The document that is referenced.
      Returns:
      The reference to be put inside current to refer to referenced. This can be a relative URL as well as an absolute. If null is returned, then the SDDocument will produce a "implicit reference" (for example, <xs:import> without the @schemaLocation attribute, etc).