private String computeAction(OperationInfo op, String postFix) { StringBuilder s = new StringBuilder(op.getName().getNamespaceURI()); if (s.charAt(s.length() - 1) != '/') { s.append('/'); } s.append(op.getInterface().getName().getLocalPart()) .append('/').append(op.getName().getLocalPart()).append(postFix); return s.toString(); }
private void writerSoapEndpoint(PrintWriter writer, String basePath, AbstractDestination sd) { String absoluteURL = getAbsoluteAddress(basePath, sd); if (absoluteURL == null) { return; } writer.write("<tr><td>"); writer.write("<span class=\"porttypename\">" + sd.getEndpointInfo().getInterface().getName().getLocalPart() + "</span>"); writer.write("<ul>"); for (OperationInfo oi : sd.getEndpointInfo().getInterface().getOperations()) { if (!Boolean.TRUE.equals(oi.getProperty("operation.is.synthetic"))) { writer.write("<li>" + oi.getName().getLocalPart() + "</li>"); } } writer.write("</ul>"); writer.write("</td><td>"); writer.write("<span class=\"field\">Endpoint address:</span> " + "<span class=\"value\">" + absoluteURL + "</span>"); writer.write("<br/><span class=\"field\">WSDL :</span> " + "<a href=\"" + absoluteURL + "?wsdl\">" + sd.getEndpointInfo().getService().getName() + "</a>"); writer.write("<br/><span class=\"field\">Target namespace:</span> " + "<span class=\"value\">" + sd.getEndpointInfo().getService().getTargetNamespace() + "</span>"); addAtomLinkIfNeeded(absoluteURL, atomMap, writer); writer.write("</td></tr>"); }
SchemaInfo si = interfaceInfo.getService().getSchema(ns); if (si != null) { q = si.isElementFormQualified();
private void addInvokeOperation(QName operationName, boolean oneWay) { ServiceInfo info = client.getEndpoint().getEndpointInfo().getService(); OperationInfo invokeOpInfo = info.getInterface() .getOperation(oneWay ? INVOKE_ONEWAY_QNAME : INVOKE_QNAME); OperationInfo opInfo = info.getInterface().addOperation(operationName); opInfo.setInput(invokeOpInfo.getInputName(), invokeOpInfo.getInput()); if (!oneWay) { opInfo.setOutput(invokeOpInfo.getOutputName(), invokeOpInfo.getOutput()); } for (BindingInfo bind : client.getEndpoint().getEndpointInfo().getService().getBindings()) { BindingOperationInfo bo = new BindingOperationInfo(bind, opInfo); bind.addOperation(bo); } }
for (EndpointInfo ep : si.getEndpoints()) { enames.add(ep.getName()); QName catchAll = new QName("http://cxf.apache.org/jaxws/provider", "invoke"); si.setProperty("soap.force.doclit.bare", Boolean.TRUE); if (!isFromWsdl()) { for (EndpointInfo ei : si.getEndpoints()) { ei.setProperty("soap.no.validate.parts", Boolean.TRUE); if (bop.isUnwrappedCapable()) { bop.getOperationInfo().setUnwrappedOperation(null); bop.setUnwrappedOperation(null); inf.setTypeClass(c); break; OperationInfo op = bind.getInterface().getOperation(catchAll); if (op == null) { op = bind.getInterface().addOperation(catchAll); String name = catchAll.getLocalPart(); MessageInfo mInfo = op.createMessage(new QName(catchAll.getNamespaceURI(),
public BindingInfo createBindingInfo(ServiceInfo service, String namespace, Object config) { NMRBindingInfo info = new NMRBindingInfo(service, NMRConstants.NS_NMR_BINDING); info.setName(new QName(service.getName().getNamespaceURI(), service.getName().getLocalPart() + "NMRBinding")); for (OperationInfo op : service.getInterface().getOperations()) { BindingOperationInfo bop = info.buildOperation(op.getName(), op.getInputName(), op.getOutputName()); info.addOperation(bop); } return info; }
cxfService = factory.create(); ei = cxfService.getServiceInfos().iterator().next() .getEndpoints().iterator().next(); if (serviceInfo.getName().equals(service) && getEndpoint() != null && serviceInfo .getEndpoint(new QName(serviceInfo .getName().getNamespaceURI(), getEndpoint())) != null) { ei = serviceInfo.getEndpoint(new QName(serviceInfo schemaUtil.getSchemas(definition, serInfo); serInfo = ei.getService(); List<ServiceInfo> serviceInfos = new ArrayList<ServiceInfo>(); serviceInfos.add(serInfo); serInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null); serInfo.getInterface().setProperty(WSDLServiceBuilder.WSDL_PORTTYPE, null); for (OperationInfo opInfo : serInfo.getInterface().getOperations()) { opInfo.setProperty(WSDLServiceBuilder.WSDL_OPERATION, null); endpoint = ei.getName().getLocalPart(); this.ep.putAll(this.getProperties()); ei.setAddress(locationURI.toString());
private void buildMessage(AbstractMessageContainer minfo, Message msg) { SchemaCollection schemas = minfo.getOperation().getInterface().getService() .getXmlSchemaCollection(); List<?> orderedParam = msg.getOrderedParts(null); for (Part part : cast(orderedParam, Part.class)) { MessagePartInfo pi = minfo.addMessagePart(new QName(minfo.getName().getNamespaceURI(), part .getName())); if (part.getTypeName() != null) { pi.setTypeQName(part.getTypeName()); pi.setElement(false); pi.setXmlSchema(schemas.getTypeByQName(part.getTypeName())); } else if (part.getElementName() != null) { pi.setElementQName(part.getElementName());
@Override public QName getOperationName(InterfaceInfo service, Method method) { boolean fromWsdl = this.getServiceFactory().isFromWsdl(); String ns = service.getName().getNamespaceURI(); String local = method.getName(); QName name = new QName(ns, local); if (fromWsdl && service.getOperation(name) != null) { //just matching the ops in the class to the ops on the wsdl //probably should check the params and such return name; } if (service.getOperation(name) == null) { return name; } int i = 1; while (true) { name = new QName(ns, local + i); if (service.getOperation(name) == null) { return name; } else { i++; } } }
private static OperationInfo addRenewOperation(InterfaceInfo ii, String namespace, String servNamespace) { OperationInfo oi = ii.addOperation(new QName(servNamespace, "RenewSecurityToken")); MessageInfo mii = oi.createMessage(new QName(servNamespace, "RenewSecurityTokenMsg"), MessageInfo.Type.INPUT); oi.setInput("RenewSecurityTokenMsg", mii); MessagePartInfo mpi = mii.addMessagePart("request"); mpi.setElementQName(new QName(namespace, "RequestSecurityToken")); MessageInfo mio = oi.createMessage(new QName(servNamespace, "RenewSecurityTokenResponseMsg"), MessageInfo.Type.OUTPUT); oi.setOutput("RenewSecurityTokenResponseMsg", mio); mpi = mio.addMessagePart("response"); if (WST_NS_05_02.equals(namespace)) { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponse")); } else { mpi.setElementQName(new QName(namespace, "RequestSecurityTokenResponseCollection")); } return oi; }
ServiceInfo si = new ServiceInfo(); infos.add(si); QName qname = JAXRSUtils.getClassQName(cri.getServiceClass()); si.setName(qname); InterfaceInfo inf = new InterfaceInfo(si, qname); si.setInterface(inf); for (OperationResourceInfo ori : cri.getMethodDispatcher().getOperationResourceInfos()) { Method m = ori.getMethodToInvoke(); QName oname = new QName(qname.getNamespaceURI(), m.getName()); OperationInfo oi = inf.addOperation(oname); createMessagePartInfo(oi, m.getReturnType(), qname, m, false); for (Parameter pm : ori.getParameters()) {
@Override public QName getOperationName(InterfaceInfo intf, Method method) { method = getDeclaredMethod(method); WebMethod wm = method.getAnnotation(WebMethod.class); if (wm != null) { String name = wm.operationName(); if (name.length() == 0) { name = method.getName(); } return new QName(intf.getName().getNamespaceURI(), name); } return new QName(intf.getName().getNamespaceURI(), method.getName()); }
definition = new ServiceWSDLBuilder(getBus(), server.getEndpoint().getService().getServiceInfos() .iterator().next()).build(); EndpointInfo ei = server.getEndpoint().getService().getServiceInfos().iterator().next() .getEndpoints().iterator().next(); for (ServiceInfo serviceInfo : server.getEndpoint().getService().getServiceInfos()) { if (serviceInfo.getName().equals(service) && getEndpoint() != null && serviceInfo.getEndpoint(new QName(serviceInfo.getName().getNamespaceURI(), getEndpoint())) != null) { ei = serviceInfo.getEndpoint(new QName(serviceInfo.getName().getNamespaceURI(), schemaUtil.getSchemas(definition, serInfo); serInfo = ei.getService(); List<ServiceInfo> serviceInfos = new ArrayList<ServiceInfo>(); serviceInfos.add(serInfo); serInfo.setProperty(WSDLServiceBuilder.WSDL_DEFINITION, null); serInfo.getInterface().setProperty(WSDLServiceBuilder.WSDL_PORTTYPE, null); for (OperationInfo opInfo : serInfo.getInterface().getOperations()) { opInfo.setProperty(WSDLServiceBuilder.WSDL_OPERATION, null);
public BindingOperationInfo buildOperation(QName opName, String inName, String outName) { for (OperationInfo op : getInterface().getOperations()) { if (opName.equals(op.getName()) && nameEquals(inName, op.getInputName(), op.getName().getLocalPart() + "Request") && nameEquals(outName, op.getOutputName(), op.getName().getLocalPart() + "Response")) { return new BindingOperationInfo(this, op); } } return null; }
Logger getMessageLogger(Message message) { Endpoint ep = message.getExchange().getEndpoint(); if (ep == null || ep.getEndpointInfo() == null) { return getLogger(); } EndpointInfo endpoint = ep.getEndpointInfo(); if (endpoint.getService() == null) { return getLogger(); } Logger logger = endpoint.getProperty("MessageLogger", Logger.class); if (logger == null) { String serviceName = endpoint.getService().getName().getLocalPart(); InterfaceInfo iface = endpoint.getService().getInterface(); String portName = endpoint.getName().getLocalPart(); String portTypeName = iface.getName().getLocalPart(); String logName = "org.apache.cxf.services." + serviceName + "." + portName + "." + portTypeName; logger = LogUtils.getL7dLogger(this.getClass(), null, logName); endpoint.setProperty("MessageLogger", logger); } return logger; }
private void addInvokeOperation(boolean oneWay) { String name = oneWay ? INVOKE_ONEWAY_NAME : INVOKE_NAME; ServiceInfo info = client.getEndpoint().getEndpointInfo().getService(); OperationInfo opInfo = info.getInterface() .addOperation(oneWay ? INVOKE_ONEWAY_QNAME : INVOKE_QNAME); MessageInfo mInfo = opInfo.createMessage(new QName(DISPATCH_NS, name + "Request"), Type.INPUT); opInfo.setInput(name + "Request", mInfo); MessagePartInfo mpi = mInfo.addMessagePart("parameters"); if (context == null) { mpi.setTypeClass(cl); } mpi.setElement(true); if (!oneWay) { mInfo = opInfo.createMessage(new QName(DISPATCH_NS, name + "Response"), Type.OUTPUT); opInfo.setOutput(name + "Response", mInfo); mpi = mInfo.addMessagePart("parameters"); mpi.setElement(true); if (context == null) { mpi.setTypeClass(cl); } } for (BindingInfo bind : client.getEndpoint().getEndpointInfo().getService().getBindings()) { BindingOperationInfo bo = new BindingOperationInfo(bind, opInfo); bind.addOperation(bo); } }
private static final QName STS_SERVICE_NAME = new QName(WST_NS_05_12 + "/", "SecurityTokenService"); ServiceInfo si = new ServiceInfo(); QName iName = new QName(ns, sc ? "SecureConversationTokenService" : "SecurityTokenService"); si.setName(iName); InterfaceInfo ii = new InterfaceInfo(si, iName); OperationInfo roi = addRenewOperation(ii, namespace, ns); si.setInterface(ii); service = new ServiceImpl(si); transportId = ci.getTransportIds().get(0); EndpointInfo ei = new EndpointInfo(si, transportId); ei.setBinding(bi); ei.setName(epName == null ? iName : epName); ei.setAddress(location); si.addEndpoint(ei);
void buildCloseSequenceOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getCloseSequenceOperationName()); messageInfo = operationInfo.createMessage(consts.getCloseSequenceOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); if (RM11Constants.NAMESPACE_URI.equals(protocol.getWSRMNamespace())) { MessagePartInfo partInfo = messageInfo.addMessagePart(CLOSE_PART_NAME); partInfo.setElementQName(consts.getCloseSequenceOperationName()); partInfo.setElement(true); partInfo.setTypeClass(CloseSequenceType.class); messageInfo = operationInfo.createMessage( RM11Constants.INSTANCE.getCloseSequenceResponseOperationName(), MessageInfo.Type.OUTPUT); operationInfo.setOutput(messageInfo.getName().getLocalPart(), messageInfo); partInfo = messageInfo.addMessagePart(CLOSE_RESPONSE_PART_NAME); partInfo.setElementQName(RM11Constants.INSTANCE.getCloseSequenceResponseOperationName()); partInfo.setElement(true); partInfo.setTypeClass(CloseSequenceResponseType.class); partInfo.setIndex(0); } }
addPolicy(ii, ii.getService(), p, cls, ii.getName().getLocalPart() + "PortTypePolicy"); it.remove(); break; addPolicy(ii.getService(), ii.getService(), p, cls, ii.getService().getName().getLocalPart() + "ServicePolicy"); it.remove(); break; List<Policy> stuff = CastUtils.cast((List<?>)ii.getProperty(EXTRA_POLICIES)); if (stuff != null) { for (Policy p2 : list) { ii.setProperty(EXTRA_POLICIES, list);
void buildAckRequestedOperationInfo(InterfaceInfo ii, ProtocolVariation protocol) { OperationInfo operationInfo = null; MessageInfo messageInfo = null; RMConstants consts = protocol.getConstants(); operationInfo = ii.addOperation(consts.getAckRequestedOperationName()); messageInfo = operationInfo.createMessage(consts.getAckRequestedOperationName(), MessageInfo.Type.INPUT); operationInfo.setInput(messageInfo.getName().getLocalPart(), messageInfo); }