/** * @param inMessage * the incoming message * @return the inbuilt backchannel */ protected Conduit getInbuiltBackChannel(Message inMessage) { // get a back channel to send back the response to the client return new BackChannelConduit(EndpointReferenceUtils.getAnonymousEndpointReference(), inMessage); }
public static QName getPortQName(EndpointReferenceType ref, Bus bus) { QName serviceName = getServiceName(ref, bus); return new QName(serviceName.getNamespaceURI(), getPortName(ref)); }
public static Schema getSchema(ServiceInfo serviceInfo) { return getSchema(serviceInfo, null); } public static Schema getSchema(ServiceInfo serviceInfo, Bus b) {
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 wsdl, service and portname. * @param wsdlUrl - url of the wsdl that describes the service. * @param serviceName - the <code>QName</code> of the service. * @param portName - the name of the port. * @return EndpointReferenceType - the endpoint reference */ public static EndpointReferenceType getEndpointReference(URL wsdlUrl, QName serviceName, String portName) { EndpointReferenceType reference = WSAEndpointReferenceUtils.createEndpointReferenceWithMetadata(); setServiceAndPortName(reference, serviceName, portName); //TODO To Ensure it is a valid URI syntax. setWSDLLocation(reference, wsdlUrl.toString()); return reference; }
Definition def = getWSDLDefinition(manager, ref); if (def == null) { throw new WSDLException(WSDLException.OTHER_ERROR, "unable to find definition for reference"); QName serviceName = getServiceName(ref, null); if (null != serviceName) { if (StringUtils.isEmpty(serviceName.getNamespaceURI())) { return (Port)service.getPorts().values().iterator().next(); String str = getPortName(ref); LOG.log(Level.FINE, "getting port " + str + " from service " + service.getQName()); Port port = service.getPort(str);
String portName = null; if (target != null) { serviceName = EndpointReferenceUtils.getServiceName(target, conduit.getBus()); address = EndpointReferenceUtils.getAddress(target); portName = EndpointReferenceUtils.getPortName(target); } else { serviceName = message.getExchange().get(org.apache.cxf.service.Service.class).getName();
namespaceURI = getNameSpaceUri(node, content, namespaceURI); if (StringUtils.isEmpty(namespaceURI)) { namespaceURI = findNamespaceHack(ref, bus); content = getService(content); } else { Node nodeAttr = node.getAttributes().getNamedItem("xmlns");
QName serviceName = null; if (target != null) { serviceName = EndpointReferenceUtils.getServiceName(target, message.getExchange() .get(Bus.class)); } else {
/** * Get the target endpoint reference. * * @param ei the corresponding EndpointInfo * @param t the given target EPR if available * @param bus the Bus * @return the actual target */ protected static EndpointReferenceType getTargetReference(EndpointInfo ei, EndpointReferenceType t, Bus bus) { EndpointReferenceType ref = null; if (null == t) { ref = new EndpointReferenceType(); AttributedURIType address = new AttributedURIType(); address.setValue(ei.getAddress()); ref.setAddress(address); if (ei.getService() != null) { EndpointReferenceUtils.setServiceAndPortName(ref, ei.getService().getName(), ei.getName().getLocalPart()); } } else { ref = t; } return ref; }
/** * 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; }
private static JAXBContext getJAXBContextForEPR() throws JAXBException { Reference<JAXBContext> rctx = ADDRESSING_CONTEXT.get(); JAXBContext ctx = rctx.get(); if (ctx == null) { ctx = createContextForEPR(); } return ctx; } public static Source convertToXML(EndpointReferenceType epr) {
public static Schema getSchema(ServiceInfo serviceInfo, Bus b) { if (serviceInfo == null) { return null; } Schema schema = serviceInfo.getProperty(Schema.class.getName(), Schema.class); if (schema == null && !serviceInfo.hasProperty(Schema.class.getName() + ".CHECKED")) { try { synchronized (serviceInfo) { return createSchema(serviceInfo, b); } } finally { serviceInfo.setProperty(Schema.class.getName() + ".CHECKED", Boolean.TRUE); } } return schema; }
Definition def = getWSDLDefinition(manager, ref); if (def == null) { throw new WSDLException(WSDLException.OTHER_ERROR, "unable to find definition for reference"); QName serviceName = getServiceName(ref, null); if (null != serviceName) { if (StringUtils.isEmpty(serviceName.getNamespaceURI())) { return (Port)service.getPorts().values().iterator().next(); String str = getPortName(ref); LOG.log(Level.FINE, "getting port " + str + " from service " + service.getQName()); Port port = service.getPort(str);
namespaceURI = getNameSpaceUri(node, content, namespaceURI); if (StringUtils.isEmpty(namespaceURI)) { namespaceURI = findNamespaceHack(ref, bus); content = getService(content); } else { Node nodeAttr = node.getAttributes().getNamedItem("xmlns");
QName serviceName = null; if (target != null) { serviceName = EndpointReferenceUtils.getServiceName(target, message.getExchange().get(Bus.class)); } else {
/** * Get the target endpoint reference. * * @param ei the corresponding EndpointInfo * @param t the given target EPR if available * @param bus the Bus * @return the actual target */ protected static EndpointReferenceType getTargetReference(EndpointInfo ei, EndpointReferenceType t, Bus bus) { EndpointReferenceType ref = null; if (null == t) { ref = new EndpointReferenceType(); AttributedURIType address = new AttributedURIType(); address.setValue(ei.getAddress()); ref.setAddress(address); if (ei.getService() != null) { EndpointReferenceUtils.setServiceAndPortName(ref, ei.getService().getName(), ei.getName().getLocalPart()); } } else { ref = t; } return ref; }
/** * Create an endpoint reference for the provided wsdl, service and portname. * @param wsdlUrl - url of the wsdl that describes the service. * @param serviceName - the <code>QName</code> of the service. * @param portName - the name of the port. * @return EndpointReferenceType - the endpoint reference */ public static EndpointReferenceType getEndpointReference(URL wsdlUrl, QName serviceName, String portName) { EndpointReferenceType reference = WSAEndpointReferenceUtils.createEndpointReferenceWithMetadata(); setServiceAndPortName(reference, serviceName, portName); //TODO To Ensure it is a valid URI syntax. setWSDLLocation(reference, wsdlUrl.toString()); return reference; }
/** * 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; }
private static JAXBContext getJAXBContextForEPR() throws JAXBException { Reference<JAXBContext> rctx = ADDRESSING_CONTEXT.get(); JAXBContext ctx = rctx.get(); if (ctx == null) { ctx = createContextForEPR(); } return ctx; } public static Source convertToXML(EndpointReferenceType epr) {