.getExtensors(ExtensibilityElement.class); if (portExtensors != null) { Iterator<ExtensibilityElement> extensionElements = portExtensors.iterator(); QName wsaEpr = new QName(Names.WSA_NAMESPACE_NAME, "EndpointReference"); while (extensionElements.hasNext()) { ExtensibilityElement ext = extensionElements.next(); if (ext instanceof UnknownExtensibilityElement && wsaEpr.equals(ext.getElementType())) { Element eprEle = ((UnknownExtensibilityElement)ext).getElement(); List<Element> addressElements = DOMUtils.getChildrenWithName(eprEle, addressElements.get(0).setTextContent(this.endpoint.getEndpointInfo().getAddress()); builder.address(this.endpoint.getEndpointInfo().getAddress()); builder.serviceName(this.endpoint.getService().getName()); builder.endpointName(this.endpoint.getEndpointInfo().getName()); if (this.endpoint.getEndpointInfo().getService().getDescription() != null) { builder.wsdlDocumentLocation(this.endpoint.getEndpointInfo().getService().getDescription() .getBaseURI());
for (ServiceInfo si : getService().getServiceInfos()) { for (EndpointInfo ep : si.getEndpoints()) { enames.add(ep.getName()); QName catchAll = new QName("http://cxf.apache.org/jaxws/provider", "invoke"); for (ServiceInfo si : getService().getServiceInfos()) { si.setProperty("soap.force.doclit.bare", Boolean.TRUE); if (!isFromWsdl()) { for (EndpointInfo ei : si.getEndpoints()) { ei.setProperty("soap.no.validate.parts", Boolean.TRUE); if (o.getOutput().getMessagePartsNumber() == 0) { MessagePartInfo inf = o.getOutput().addMessagePart(o.getName()); inf.setConcreteName(new QName(o.getName().getNamespaceURI(), o.getName().getLocalPart() + "Response")); messageParts = o.getOutput().getMessageParts();
private String getNamespaceToUse(Service service) { if ("true".equals(service.get("org.apache.cxf.databinding.namespace"))) { return null; } String tns = null; if (service.getServiceInfos().size() > 0) { tns = service.getServiceInfos().get(0).getInterface().getName().getNamespaceURI(); } else { tns = service.getName().getNamespaceURI(); } return tns; }
@Override public org.apache.cxf.service.Service create() { org.apache.cxf.service.Service s = super.create(); s.put(ENDPOINT_CLASS, implInfo.getEndpointClass()); if (s.getDataBinding() != null) { setMTOMFeatures(s.getDataBinding()); } return s; }
EndpointInfo ei = null; if (portName == null) { ei = service.getServiceInfos().get(0).getEndpoints().iterator().next(); } else { ei = service.getEndpointInfo(portName); if (ei == null) { PortInfoImpl portInfo = getPortInfo(portName); if (portInfo != null && portInfo.getAddress() != null && !portInfo.getAddress().equals(ei.getAddress())) { ei.setAddress(portInfo.getAddress());
WSDLServiceFactory sf = new WSDLServiceFactory(bus, wsdlURL, serviceName); dispatchService = sf.create(); dispatchService.setDataBinding(db); serviceFactory = sf; } else { for (ServiceInfo si : dispatchService.getServiceInfos()) { si.setProperty("soap.force.doclit.bare", Boolean.TRUE); if (null == wsdlURL) { for (EndpointInfo ei : si.getEndpoints()) { ei.setProperty("soap.no.validate.parts", Boolean.TRUE); for (BindingInfo bind : si.getBindings()) { for (BindingOperationInfo bop : bind.getOperations()) {
protected BindingOperationInfo getBindingOperationFromEndpoint(Endpoint ep, final String operationName) { QName q = new QName(ep.getService().getName().getNamespaceURI(), operationName); BindingOperationInfo bop = ep.getBinding().getBindingInfo().getOperation(q); return bop; }
private void initializePorts() { try { Definition def = bus.getExtension(WSDLManager.class).getDefinition(wsdlURL); javax.wsdl.Service serv = def.getService(serviceName); if (serv == null) { QName name = new QName(serviceName.getNamespaceURI(), port.getName()); for (ServiceInfo si : service.getServiceInfos()) { for (EndpointInfo ei : si.getEndpoints()) { String bindingID = BindingID.getJaxwsBindingID(ei.getTransportId()); addPort(ei.getName(), bindingID, ei.getAddress());
StringBuilder getBaseServiceName(Endpoint endpoint, boolean isClient, String clientId) { StringBuilder buffer = new StringBuilder(); if (endpoint.get("org.apache.cxf.management.service.counter.name") != null) { buffer.append((String)endpoint.get("org.apache.cxf.management.service.counter.name")); } else { Service service = endpoint.getService(); String serviceName = "\"" + escapePatternChars(service.getName().toString()) + "\""; String portName = "\"" + endpoint.getEndpointInfo().getName().getLocalPart() + "\""; buffer.append(ManagementConstants.DEFAULT_DOMAIN_NAME + ":"); buffer.append(ManagementConstants.BUS_ID_PROP + "=" + bus.getId() + ","); buffer.append(ManagementConstants.TYPE_PROP).append("=Metrics"); if (isClient) { buffer.append(".Client,"); } else { buffer.append(".Server,"); } buffer.append(ManagementConstants.SERVICE_NAME_PROP + "=" + serviceName + ","); buffer.append(ManagementConstants.PORT_NAME_PROP + "=" + portName + ","); if (clientId != null) { buffer.append("Client=" + clientId + ","); } } return buffer; }
public Server getServerForService(QName serviceName) throws WSDLException { ServerRegistry svrMan = bus.getExtension(ServerRegistry.class); for (Server s : svrMan.getServers()) { Service svc = s.getEndpoint().getService(); if (svc.getName().equals(serviceName)) { return s; } } return null; }
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); BindingOperationInfo boi = ex.getBindingOperationInfo(); if (Boolean.TRUE.equals(message.get(Message.PARTIAL_RESPONSE_MESSAGE)) || boi == null) { return; Method method = ex.get(Method.class); BindingMessageInfo bmi; MessageInfo wrappedMessageInfo = message.get(MessageInfo.class); MessageInfo messageInfo; if (wrappedMessageInfo == boi.getOperationInfo().getInput()) { message.put(MessageInfo.class, messageInfo); message.put(BindingMessageInfo.class, bmi); ex.put(BindingOperationInfo.class, boi2); if (helper == null) { Service service = ServiceModelUtil.getService(message.getExchange()); DataBinding dataBinding = service.getDataBinding(); if (dataBinding instanceof WrapperCapableDatabinding) { helper = createWrapperHelper((WrapperCapableDatabinding)dataBinding, MessagePartInfo mpi = null; for (MessagePartInfo mpi2 : wrappedMessageInfo.getMessageParts()) { if (mpi2.getConcreteName().equals(part.getConcreteName())) { mpi = mpi2;
protected InterfaceInfo getInterfaceInfo() { if (getEndpointInfo() != null) { return getEndpointInfo().getInterface(); } QName qn = this.getInterfaceName(); for (ServiceInfo si : getService().getServiceInfos()) { if (qn.equals(si.getInterface().getName())) { return si.getInterface(); } } throw new ServiceConstructionException(new Message("COULD_NOT_FIND_PORTTYPE", LOG, qn)); }
public void startServer(Server serv) { if (serv.getEndpoint().getBinding() instanceof SoapBinding) { QName qn = serv.getEndpoint().getService().getName(); if (!"http://mex.ws.cxf.apache.org/".equals(qn.getNamespaceURI())) { serv.getEndpoint().getInInterceptors().add(new MEXInInterceptor(serv)); } } }
/** * Obtain handler chain from annotations. * @param server * */ private void buildHandlerChain(Server server) { AnnotationHandlerChainBuilder builder = new AnnotationHandlerChainBuilder(); @SuppressWarnings("rawtypes") List<Handler> chain = new ArrayList<>(handlers); chain.addAll(builder.buildHandlerChainFromClass(getServiceBeanClass(), server.getEndpoint().getEndpointInfo().getName(), server.getEndpoint().getService().getName(), this.getBindingId())); for (Handler<?> h : chain) { injectResources(h); } ((JaxWsEndpointImpl)server.getEndpoint()).getJaxwsBinding().setHandlerChain(chain); }
protected Server isColocated(List<Server> servers, Endpoint endpoint, BindingOperationInfo boi) { if (servers != null) { Service senderService = endpoint.getService(); EndpointInfo senderEI = endpoint.getEndpointInfo(); for (Server s : servers) { Endpoint receiverEndpoint = s.getEndpoint(); Service receiverService = receiverEndpoint.getService(); EndpointInfo receiverEI = receiverEndpoint.getEndpointInfo(); if (receiverService.getName().equals(senderService.getName()) && receiverEI.getName().equals(senderEI.getName())) { //Check For Operation Match. BindingOperationInfo receiverOI = receiverEI.getBinding().getOperation(boi.getName()); if (receiverOI != null && isCompatibleOperationInfo(boi, receiverOI)) { return s; } } } } return null; }
public RMEndpoint findReliableEndpoint(QName qn) { for (RMEndpoint rpe : reliableEndpoints.values()) { if (qn.equals(rpe.getApplicationEndpoint().getService().getName())) { return rpe; } } return null; }
public void handleMessage(Message message) throws Fault { Exchange ex = message.getExchange(); Set<Endpoint> endpoints = CastUtils.cast((Set<?>)ex.get(MultipleEndpointObserver.ENDPOINTS)); Endpoint ep = selectEndpoint(message, endpoints); if (ep == null) { return; } ex.put(Endpoint.class, ep); ex.put(Binding.class, ep.getBinding()); ex.put(Service.class, ep.getService()); InterceptorChain chain = message.getInterceptorChain(); chain.add(ep.getInInterceptors()); chain.add(ep.getBinding().getInInterceptors()); chain.add(ep.getService().getInInterceptors()); chain.setFaultObserver(ep.getOutFaultObserver()); }
public EndpointReference getEndpointReference(final Element... referenceParameters) { final org.apache.cxf.message.Message msg = getWrappedMessage(); final Endpoint ep = msg.getExchange().get(Endpoint.class); final W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder(); builder.address(ep.getEndpointInfo().getAddress()); builder.serviceName(ep.getService().getName()); builder.endpointName(ep.getEndpointInfo().getName()); if (referenceParameters != null) { for (final Element referenceParameter : referenceParameters) { builder.referenceParameter(referenceParameter); } } return builder.build(); }
@AroundInvoke public Object intercept(InvocationContext context) throws Exception { Endpoint endpoint = this.exchange.get(Endpoint.class); Service service = endpoint.getService(); Binding binding = ((JaxWsEndpointImpl) endpoint).getJaxwsBinding(); this.exchange.put(InvocationContext.class, context); EJBMethodInvoker invoker = (EJBMethodInvoker) service.getInvoker(); return invoker.directEjbInvoke(this.exchange, this.method, this.params); Message inMessage = this.exchange.getInMessage(); PhaseInterceptorChain chain = new PhaseInterceptorChain(this.bus.getExtension(PhaseManager.class).getInPhases()); chain.setFaultObserver(endpoint.getOutFaultObserver()); copyDataBindingInterceptors(chain, inMessage.getInterceptorChain()); InterceptorChain oldChain = inMessage.getInterceptorChain(); inMessage.setInterceptorChain(chain); try { chain.doIntercept(inMessage);
protected void initializeInterceptors(Exchange ex, PhaseInterceptorChain chain) { Endpoint e = ex.getEndpoint(); Client c = ex.get(Client.class); chain.add(getBus().getOutFaultInterceptors()); if (c != null) { chain.add(c.getOutFaultInterceptors()); } chain.add(e.getService().getOutFaultInterceptors()); chain.add(e.getOutFaultInterceptors()); chain.add(e.getBinding().getOutFaultInterceptors()); if (e.getService().getDataBinding() instanceof InterceptorProvider) { chain.add(((InterceptorProvider)e.getService().getDataBinding()).getOutFaultInterceptors()); } addToChain(chain, ex.getInMessage()); addToChain(chain, ex.getOutFaultMessage()); } private void addToChain(PhaseInterceptorChain chain, Message m) {