public EndpointReferenceType getAddressWithId(String id) { EndpointReferenceType ref = null; if (isMultiplexWithAddress()) { String address = EndpointReferenceUtils.getAddress(reference); ref = EndpointReferenceUtils.duplicate(reference); if (address.endsWith("/")) { EndpointReferenceUtils.setAddress(ref, address + id); } else { EndpointReferenceUtils.setAddress(ref, address + "/" + id); } } else { ref = super.getAddressWithId(id); } return ref; }
/** * Create an endpoint reference for the provided address. * @param address - address URI * @return EndpointReferenceType - the endpoint reference */ public static EndpointReferenceType getEndpointReference(String address) { EndpointReferenceType reference = new EndpointReferenceType(); setAddress(reference, address); return reference; }
/** * Create an endpoint reference for the provided address. * @param address - address URI * @return EndpointReferenceType - the endpoint reference */ public static EndpointReferenceType getEndpointReference(String address) { EndpointReferenceType reference = new EndpointReferenceType(); setAddress(reference, address); return reference; }
/** * Create an anonymous endpoint reference. * @return EndpointReferenceType - the endpoint reference */ public static EndpointReferenceType getAnonymousEndpointReference() { final EndpointReferenceType reference = new EndpointReferenceType(); setAddress(reference, ANONYMOUS_ADDRESS); return reference; }
/** * Create an anonymous endpoint reference. * @return EndpointReferenceType - the endpoint reference */ public static EndpointReferenceType getAnonymousEndpointReference() { final EndpointReferenceType reference = new EndpointReferenceType(); setAddress(reference, ANONYMOUS_ADDRESS); return reference; }
public EndpointReferenceType getAddressWithId(String id) { EndpointReferenceType ref = null; if (isMultiplexWithAddress()) { String address = EndpointReferenceUtils.getAddress(reference); ref = EndpointReferenceUtils.duplicate(reference); if (address.endsWith("/")) { EndpointReferenceUtils.setAddress(ref, address + id); } else { EndpointReferenceUtils.setAddress(ref, address + "/" + id); } } else { ref = super.getAddressWithId(id); } return ref; }
public W3CEndpointReference create(String id) { manageNumberServantInitialisation(); // manually force id into address context as context appendage EndpointReferenceType epr = EndpointReferenceUtils.duplicate(templateEpr); EndpointReferenceUtils.setAddress(epr, EndpointReferenceUtils.getAddress(epr) + id); Source source = EndpointReferenceUtils.convertToXML(epr); return new W3CEndpointReference(source); }
@Test public void testCallback() throws Exception { Object implementor = new CallbackImpl(); String address = "http://localhost:" + CB_PORT + "/CallbackContext/NestedCallbackPort"; Endpoint.publish(address, implementor); URL wsdlURL = getClass().getResource("/wsdl/nested_callback.wsdl"); SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME); ServerPortType port = ss.getPort(PORT_NAME, ServerPortType.class); updateAddressPort(port, PORT); EndpointReferenceType ref = null; try { ref = EndpointReferenceUtils.getEndpointReference(wsdlURL, SERVICE_NAME_CALLBACK, PORT_NAME_CALLBACK.getLocalPart()); EndpointReferenceUtils.setInterfaceName(ref, PORT_TYPE_CALLBACK); EndpointReferenceUtils.setAddress(ref, address); } catch (Exception e) { e.printStackTrace(); } NestedCallback callbackObject = new NestedCallback(); Source source = EndpointReferenceUtils.convertToXML(ref); W3CEndpointReference w3cEpr = new W3CEndpointReference(source); callbackObject.setCallback(w3cEpr); String resp = port.registerCallback(callbackObject); assertEquals("registerCallback called", resp); }