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>"); }
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); } }
public ServiceModelSchemaValidator(ServiceInfo serviceInfo) { super(serviceInfo); schemaCollection = serviceInfo.getXmlSchemaCollection(); complaints = new StringBuilder(); }
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); } }
public BindingInfo createBindingInfo(ServiceInfo service, String namespace, Object config) { BindingInfo info = new BindingInfo(service, "http://cxf.apache.org/bindings/xformat"); info.setName(new QName(service.getName().getNamespaceURI(), service.getName().getLocalPart() + "XMLBinding")); for (OperationInfo op : service.getInterface().getOperations()) { adjustConcreteNames(op.getInput()); adjustConcreteNames(op.getOutput()); BindingOperationInfo bop = info.buildOperation(op.getName(), op.getInputName(), op.getOutputName()); info.addOperation(bop); } return info; }
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); for (BindingInfo bind : si.getBindings()) { for (BindingOperationInfo bop : bind.getOperations()) { OperationInfo o = bop.getOperationInfo(); if (bop.isUnwrappedCapable()) { bop.getOperationInfo().setUnwrappedOperation(null); bop.setUnwrappedOperation(null); if (o.getInput() != null) { final List<MessagePartInfo> messageParts; if (o.getInput().getMessagePartsNumber() == 0) { MessagePartInfo inf = o.getInput().addMessagePart(o.getName()); inf.setConcreteName(o.getName());
public QName getBindingName(ServiceInfo si) { if (bindingName == null) { return new QName(si.getName().getNamespaceURI(), si.getName().getLocalPart() + bindingNamePostfix); } return bindingName; }
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; }
QName name = new QName(serviceName.getNamespaceURI(), port.getName()); Service service = sf.create(); for (ServiceInfo si : service.getServiceInfos()) { for (EndpointInfo ei : si.getEndpoints()) { String bindingID = BindingID.getJaxwsBindingID(ei.getTransportId()); addPort(ei.getName(), bindingID, ei.getAddress());
@Override public boolean appliesTo(EndpointInfo ei) { if (ei == null) { return false; } return (ei.getService() != null) && (ei.getService().getName() != null) && (ei.getName() != null) && wsdl11XPointer.matchesPort(ei.getService().getTargetNamespace(), ei.getService().getName().getLocalPart(), ei.getName().getLocalPart()); }
public static Service createServiceModel() { ServiceInfo serviceInfo = new ServiceInfo(); // does not make sense for protobuf services serviceInfo.setName(new QName("", "protobuf_service_" + System.identityHashCode(serviceInfo))); InterfaceInfo interfaceInfo = new InterfaceInfo(serviceInfo, serviceInfo.getName()); serviceInfo.setInterface(interfaceInfo); Service service = new ServiceImpl(serviceInfo); return service; }
WSAW_USINGADDRESSING_QNAME); el.setRequired(addressing.required()); bindingInfo.addExtensor(el); StringBuilder polRefId = new StringBuilder(bindingInfo.getName().getLocalPart()); polRefId.append("_WSAM_Addressing_Policy"); UnknownExtensibilityElement uel = new UnknownExtensibilityElement(); uel.setElement(pr); uel.setElementType(DOMUtils.getElementQName(pr)); bindingInfo.addExtensor(uel); uel.setElement(pr); uel.setElementType(DOMUtils.getElementQName(pr)); if (bindingInfo.getService().getDescription() == null) { DescriptionInfo description = new DescriptionInfo(); description.setName(bindingInfo.getService().getName()); bindingInfo.getService().setDescription(description); bindingInfo.getService().getDescription().addExtensor(uel);
public static SchemaInfo getSchema(ServiceInfo serviceInfo, MessagePartInfo messagePartInfo) { SchemaInfo schemaInfo = null; String tns = null; if (messagePartInfo.isElement()) { tns = messagePartInfo.getElementQName().getNamespaceURI(); } else { tns = messagePartInfo.getTypeQName().getNamespaceURI(); } for (SchemaInfo schema : serviceInfo.getSchemas()) { if (tns.equals(schema.getNamespaceURI())) { schemaInfo = schema; } } return schemaInfo; }
@Override public boolean appliesTo(BindingMessageInfo bmi) { String serviceName = bmi.getBindingOperation().getBinding().getService().getName().getLocalPart(); if ("JavaFirstAttachmentPolicyService".equals(serviceName) && "usernamepassword".equals(url)) { return ("doInputMessagePolicy".equals(bmi.getBindingOperation().getName().getLocalPart()) && MessageInfo.Type.INPUT.equals(bmi.getMessageInfo().getType())) || ("doOutputMessagePolicy".equals(bmi.getBindingOperation().getName().getLocalPart()) && MessageInfo.Type.OUTPUT.equals(bmi.getMessageInfo().getType())); } else if ("SslUsernamePasswordAttachmentService".equals(serviceName) && "sslusernamepassword".equals(url)) { return MessageInfo.Type.INPUT.equals(bmi.getMessageInfo().getType()); } else { return false; } }
public static EndpointInfo findBestEndpointInfo(QName qn, List<ServiceInfo> serviceInfos) { for (ServiceInfo serviceInfo : serviceInfos) { Collection<EndpointInfo> eps = serviceInfo.getEndpoints(); for (EndpointInfo ep : eps) { if (ep.getInterface().getName().equals(qn)) { return ep; } } } EndpointInfo best = null; for (ServiceInfo serviceInfo : serviceInfos) { Collection<EndpointInfo> eps = serviceInfo.getEndpoints(); for (EndpointInfo ep : eps) { if (best == null) { best = ep; } if ("http://schemas.xmlsoap.org/wsdl/soap/".equals(ep.getTransportId())) { return ep; } } } return best; }
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)); }
private boolean isSameTNS(final ServiceInfo service) { return service.getName().getNamespaceURI().equals(service.getInterface().getName().getNamespaceURI()); }
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; }
private MessageInfo getMessage(QName operationName, boolean isIn) { for (OperationInfo operation : service.getInterface().getOperations()) { if (operationName.equals(operation.getName()) && isIn) { return operation.getInput(); } return operation.getOutput(); } return null; }