Interface DocumentLocationResolver


public interface DocumentLocationResolver
Resolves relative references among the metadata(WSDL, schema) documents.

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.

Usage Example 1

Say: http://localhost/hello?wsdl has reference to

<xsd:import namespace="urn:test:types" schemaLocation="http://localhost/hello?xsd=1"/>

Using this class, it is possible to write A.wsdl to a local filesystem with a local file schema import.

<xsd:import namespace="urn:test:types" schemaLocation="hello.xsd"/>

Author:
Jitendra Kotamraju
  • Method Summary

    Modifier and Type
    Method
    Description
    getLocationFor(String namespaceURI, String systemId)
    Produces a relative reference from one document to another.
  • Method Details

    • getLocationFor

      @Nullable String getLocationFor(String namespaceURI, String systemId)
      Produces a relative reference from one document to another.
      Parameters:
      namespaceURI - The namespace urI for the referenced document. for e.g. wsdl:import/@namespace, xsd:import/@namespace
      systemId - The location value for the referenced document. for e.g. wsdl:import/@location, xsd:import/@schemaLocation
      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 document will produce a "implicit reference" (for example, <xs:import> without the @schemaLocation attribute, etc).