Creating an Endpoint Reference
Prerequisites
You must set an endpoint reference object before invoking a reference that is dynamically wired to a service.
Procedure
Example
import org.osoa.sca.annotations.Context;
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.MutableRequestContext;
import com.tibco.amf.platform.runtime.extension.support.ElementEndpointReference;
import com.tibco.amf.platform.runtime.extension.support.ElementWildcardExtension;
import java.net.URI;
import java.util.List;
import java.util.Arrays;
@Context
public ComponentContext context;
public static final String WSQName = "com.ws.base";
private void setEPR(URI targetURI) {
EndpointReference<Element> epr = new ElementEndpointReference(targetURI);
String property1= "<property1 " + "xmlns=\"" + WSQName + "\">value1</property1>";
String property2= "<property2 " + "xmlns=\"" + WSQName + "\">value2</property2>";
List<Element> elements = Arrays.asList(
DOMUtils.getDOMNode(property1).getDocumentElement(),
DOMUtils.getDOMNode(property2).getDocumentElement());
ElementWildcardExtension refParams = new ElementWildcardExtension(null, elements);
epr.setReferenceParameters(refParams);
MutableRequestContext mctxt = (MutableRequestContext) context.createMutableRequestContext();
mctxt.setEndpointReference(epr);
context.setRequestContext(mctxt);
}
Copyright © Cloud Software Group, Inc. All rights reserved.