Retrieving an Endpoint Reference

Prerequisites

Enable the SOAP binding that delivers the message to the Spring component for WS-Addressing to use reference parameters.

Procedure

  1. Import context, endpoint reference, request context, wildcard extension, and URI class definitions:
    import com.tibco.amf.platform.runtime.extension.context.ComponentContext;
    import com.tibco.amf.platform.runtime.extension.context.EndpointReference;
    import com.tibco.amf.platform.runtime.extension.context.RequestContext;
    import com.tibco.amf.platform.runtime.extension.context.WildCardExtension;
    import java.net.URI;
  2. Declare the component context:
    @Context
    public ComponentContext componentContext;
  3. Retrieve the request context:
    RequestContext requestContext = (RequestContext)componentContext.getRequestContext();
  4. Retrieve the endpoint reference:
    EndpointReference<Element> endpointReference = requestContext.getEndpointReference(Element.class);
  5. Optionally retrieve the URI and reference parameters from the endpoint reference:
    URI uri = endpointReference.getAddress().getURI();
    WildCardExtension<Element> refElements = endpointReference.getReferenceParameters();