/** * Set up the decoupled Destination if necessary. */ private Destination setUpDecoupledDestination(Bus bus, String replyToAddress, Message message) { EndpointReferenceType reference = EndpointReferenceUtils.getEndpointReference(replyToAddress); if (reference != null) { String decoupledAddress = reference.getAddress().getValue(); LOG.info("creating decoupled endpoint: " + decoupledAddress); try { Destination dest = getDestination(bus, replyToAddress, message); bus.getExtension(ClientLifeCycleManager.class).registerListener(DECOUPLED_DEST_CLEANER); return dest; } catch (Exception e) { // REVISIT move message to localizable Messages.properties LOG.log(Level.WARNING, "decoupled endpoint creation failed: ", e); } } return null; }
/** * Set up the decoupled Destination if necessary. */ private Destination setUpDecoupledDestination(Bus bus, String replyToAddress, Message message) { EndpointReferenceType reference = EndpointReferenceUtils.getEndpointReference(replyToAddress); if (reference != null) { String decoupledAddress = reference.getAddress().getValue(); LOG.info("creating decoupled endpoint: " + decoupledAddress); try { Destination dest = getDestination(bus, replyToAddress, message); bus.getExtension(ClientLifeCycleManager.class).registerListener(DECOUPLED_DEST_CLEANER); return dest; } catch (Exception e) { // REVISIT move message to localizable Messages.properties LOG.log(Level.WARNING, "decoupled endpoint creation failed: ", e); } } return null; }
public EndpointReferenceType getAddressWithId(String id) { EndpointReferenceType ref = null; if (bindingPOA == null) { throw new CorbaBindingException( "getAddressWithId failed because the poa is null"); } try { Servant servant = bindingPOA.id_to_servant(objectId); org.omg.CORBA.Object objRef = bindingPOA.create_reference_with_id(id.getBytes(), servant._all_interfaces(bindingPOA, objectId)[0]); AddressType addr = new AddressType(); orbConfig.exportObjectReference(orb, objRef, address.getLocation(), addr); ref = EndpointReferenceUtils.getEndpointReference(addr.getLocation()); EndpointInfo ei = getEndPointInfo(); if (ei.getService() != null) { EndpointReferenceUtils.setServiceAndPortName(ref, ei.getService().getName(), ei.getName().getLocalPart()); } } catch (Exception e) { throw new CorbaBindingException("Failed to getAddressWithId, reason:" + e.toString(), e); } return ref; }
headerElement, unmarshaller); maps.setTo(EndpointReferenceUtils.getEndpointReference(addr)); } else if (Names.WSA_FROM_NAME.equals(localName)) { invalidCardinalityQName = maps.getFrom() != null
headerElement, unmarshaller); maps.setTo(EndpointReferenceUtils.getEndpointReference(addr)); } else if (Names.WSA_FROM_NAME.equals(localName)) { invalidCardinalityQName = maps.getFrom() != null
(String)message.getContextualProperty(WSAContextUtils.DECOUPLED_ENDPOINT_BASE_PROPERTY); if (debase != null) { return EndpointReferenceUtils.getEndpointReference(debase + replyTo);
(String)message.getContextualProperty(WSAContextUtils.DECOUPLED_ENDPOINT_BASE_PROPERTY); if (debase != null) { return EndpointReferenceUtils.getEndpointReference(debase + replyTo);
@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); }
@Before public void setUp() throws Exception { //super.setUp(); if (staticBus == null) { SpringBusFactory bf = new SpringBusFactory(); staticBus = bf.createBus(getConfigFileName()); BusFactory.setDefaultBus(staticBus); } messageIDs.clear(); mapVerifier = new MAPVerifier(); headerVerifier = new HeaderVerifier(); Interceptor<?>[] interceptors = {mapVerifier, headerVerifier}; addInterceptors(staticBus.getInInterceptors(), interceptors); addInterceptors(staticBus.getOutInterceptors(), interceptors); addInterceptors(staticBus.getOutFaultInterceptors(), interceptors); addInterceptors(staticBus.getInFaultInterceptors(), interceptors); EndpointReferenceType target = EndpointReferenceUtils.getEndpointReference(getAddress()); ReferenceParametersType params = ContextUtils.WSA_OBJECT_FACTORY.createReferenceParametersType(); JAXBElement<String> param = new JAXBElement<>(CUSTOMER_NAME, String.class, CUSTOMER_KEY); params.getAny().add(param); target.setReferenceParameters(params); greeter = createGreeter(target); mapVerifier.verificationCache = this; headerVerifier.verificationCache = this; } public URL getWSDLURL() {