Refine search
private boolean matches(EndpointReferenceType ref, W3CEndpointReference r) { EndpointReferenceType cref = ProviderImpl.convertToInternal(r); QName snr = EndpointReferenceUtils.getServiceName(ref, bus); QName snc = EndpointReferenceUtils.getServiceName(cref, bus); String addr = EndpointReferenceUtils.getAddress(ref); String addc = EndpointReferenceUtils.getAddress(cref); if (addr == null) { return false; } if (addr.equals(addc)) { return !(snr != null && !snr.equals(snc)); } return false; } }
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; }
BackChannelConduit(Message inMessage, JMSConfiguration jmsConfig, Connection connection) { super(EndpointReferenceUtils.getAnonymousEndpointReference()); this.inMessage = inMessage; this.jmsConfig = jmsConfig; this.persistentConnection = connection; }
@Override public Dispatch<Object> createDispatch(EndpointReference endpointReference, JAXBContext context, Mode mode, WebServiceFeature... features) { EndpointReferenceType ref = ProviderImpl.convertToInternal(endpointReference); QName portName = EndpointReferenceUtils.getPortQName(ref, bus); updatePortInfoAddress(portName, EndpointReferenceUtils.getAddress(ref)); return createDispatch(portName, context, mode, features); }
public <T> T getPort(EndpointReferenceType endpointReference, Class<T> type, WebServiceFeature... features) { endpointReference = EndpointReferenceUtils.resolve(endpointReference, bus); QName serviceQName = EndpointReferenceUtils.getServiceName(endpointReference, bus); String portName = EndpointReferenceUtils.getPortName(endpointReference); QName portQName = null; if (portName != null && serviceQName != null) { String ns = serviceQName.getNamespaceURI(); if (StringUtils.isEmpty(ns)) { //hack to workaround a xalan bug for (QName qn : portInfos.keySet()) { if (portName.equals(qn.getLocalPart())) { ns = qn.getNamespaceURI(); } } } if (StringUtils.isEmpty(ns) && serviceName != null) { ns = serviceName.getNamespaceURI(); } portQName = new QName(ns, portName); } return createPort(portQName, endpointReference, type, features); }
QName interfaceName = EndpointReferenceUtils.getInterfaceName(callback, bus); QName serviceName = EndpointReferenceUtils.getServiceName(callback, bus); String address = EndpointReferenceUtils.getAddress(callback); String portString = EndpointReferenceUtils.getPortName(callback); QName portName = new QName(serviceName.getNamespaceURI(), portString); seiName.append(JAXBUtils.namespaceURIToPackage(interfaceName.getNamespaceURI())); seiName.append("."); seiName.append(JAXBUtils.nameToIdentifier(interfaceName.getLocalPart(),
org.apache.cxf.ws.addressing.v200403.EndpointReferenceType exposed = Names200403.WSA_OBJECT_FACTORY .createEndpointReferenceType(); exposed.setAddress(convertTo200403(internal.getAddress())); QName serviceQName = EndpointReferenceUtils.getServiceName(internal, null); if (serviceQName != null) { org.apache.cxf.ws.addressing.v200403.ServiceNameType serviceName = Names200403.WSA_OBJECT_FACTORY exposed.setServiceName(serviceName); String portLocalName = EndpointReferenceUtils.getPortName(internal); if (portLocalName != null && serviceQName != null) { String namespace = serviceQName.getNamespaceURI() != null ? serviceQName.getNamespaceURI() : Names.WSDL_INSTANCE_NAMESPACE_NAME; QName portQName = new QName(namespace, portLocalName); org.apache.cxf.ws.addressing.v200403.AttributedQName portType = Names200403.WSA_OBJECT_FACTORY .createAttributedQName(); addAll(exposed.getAny(), internal.getAny()); putAll(exposed.getOtherAttributes(), internal.getOtherAttributes()); return exposed;
public static QName getPortQName(EndpointReferenceType ref, Bus bus) { QName serviceName = getServiceName(ref, bus); return new QName(serviceName.getNamespaceURI(), getPortName(ref)); }
return; location = EndpointReferenceUtils.getAddress(ref); if (location != null) { location = location.trim(); final QName sName = EndpointReferenceUtils.getServiceName(ref, bus); if (sName != null) { serviceName = sName; final QName epName = EndpointReferenceUtils.getPortQName(ref, bus); if (epName != null) { endpointName = epName; final String wsdlLoc = EndpointReferenceUtils.getWSDLLocation(ref); if (wsdlLoc != null) { wsdlLocation = wsdlLoc; new QName(schemaElement.getNamespaceURI(), schemaElement.getLocalName()); WSDLManager wsdlManager = bus.getExtension(WSDLManager.class); ExtensibilityElement
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; }
@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); }
private void proccessEndpointReference(EndpointReferenceType ref, ScopesType scopes, List<QName> types, List<String> xAddrs) { QName nm = EndpointReferenceUtils.getPortQName(ref, bus); scopes.getValue().add(nm.getNamespaceURI()); types.add(nm); String wsdlLocation = EndpointReferenceUtils.getWSDLLocation(ref); if (!StringUtils.isEmpty(wsdlLocation)) { xAddrs.add(wsdlLocation); } String add = EndpointReferenceUtils.getAddress(ref); if (!StringUtils.isEmpty(add) && !xAddrs.contains(add)) { xAddrs.add(add); } } public boolean isAdHoc() {
/** * 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; }
/** * 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; }
/** * Construct and store MAPs for partial response. * * @param partialResponse the partial response message * @param namespaceURI the current namespace URI */ private static void ensurePartialResponseMAPs(Message partialResponse, String namespaceURI) { // ensure there is a MAPs instance available for the outbound // partial response that contains appropriate To and ReplyTo // properties (i.e. anonymous & none respectively) AddressingProperties maps = new AddressingProperties(); maps.setTo(EndpointReferenceUtils.getAnonymousEndpointReference()); maps.setReplyTo(ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType()); maps.getReplyTo().setAddress(ContextUtils.getAttributedURI(Names.WSA_NONE_ADDRESS)); maps.setAction(ContextUtils.getAttributedURI("")); maps.exposeAs(namespaceURI); ContextUtils.storeMAPs(maps, partialResponse, true, true, false); }
headerElement, unmarshaller); maps.setTo(EndpointReferenceUtils.getEndpointReference(addr)); } else if (Names.WSA_FROM_NAME.equals(localName)) { invalidCardinalityQName = maps.getFrom() != null EndpointReferenceType replyTo = ContextUtils.WSA_OBJECT_FACTORY.createEndpointReferenceType(); replyTo.setAddress(address); maps.setReplyTo(replyTo);
/** * Builds an new endpoint reference using the current target reference as a template. * The supplied id is endcoded using a reference parameter. * This requires the ws-a interceptors to propagate the reference parameters * on subsequent invokes using the returned reference. * @param id the id to encode in the new reference * @return the new reference with the id encoded as a reference parameter * @see org.apache.cxf.transport.MultiplexDestination#getAddressWithId(java.lang.String) */ public EndpointReferenceType getAddressWithId(String id) { EndpointReferenceType epr = EndpointReferenceUtils.duplicate( EndpointReferenceUtils.mint(reference, bus)); ReferenceParametersType newParams = new org.apache.cxf.ws.addressing.ObjectFactory() .createReferenceParametersType(); ReferenceParametersType existingParams = epr.getReferenceParameters(); if (null != existingParams) { newParams.getAny().addAll(existingParams.getAny()); } newParams.getAny().add(new JAXBElement<String>(MULTIPLEX_ID_QNAME, String.class, id)); epr.setReferenceParameters(newParams); return epr; }
protected String findMEXLocation(EndpointReferenceType ref, boolean useEPRWSAAddrAsMEXLocation) { if (ref.getMetadata() != null && ref.getMetadata().getAny() != null) { for (Object any : ref.getMetadata().getAny()) { if (any instanceof Element) { String addr = findMEXLocation((Element)any); if (addr != null) { return addr; } } } } return useEPRWSAAddrAsMEXLocation ? EndpointReferenceUtils.getAddress(ref) : null; }
@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() {
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); }