for (EndpointInfo ep : si.getEndpoints()) { enames.add(ep.getName()); QName catchAll = new QName("http://cxf.apache.org/jaxws/provider", "invoke"); for (BindingOperationInfo bop : bind.getOperations()) { OperationInfo o = bop.getOperationInfo(); if (bop.isUnwrappedCapable()) { bop.getOperationInfo().setUnwrappedOperation(null); if (o.getInput() != null) { final List<MessagePartInfo> messageParts; if (o.getInput().getMessagePartsNumber() == 0) { bop.getInput().setMessageParts(messageParts); inf.setConcreteName(new QName(o.getName().getNamespaceURI(), bop.getOutput().setMessageParts(messageParts); BindingOperationInfo bop = bind.getOperation(catchAll); if (bop == null) { OperationInfo op = bind.getInterface().getOperation(catchAll); if (op == null) { op = bind.getInterface().addOperation(catchAll); bind.addOperation(bo);
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);
@Override public String toString() { return "[BindingInfo " + getBindingId() + "]"; } }
bindingInfo.getService().setProperty("soap.force.doclit.bare", Boolean.TRUE); if (this.getServiceFactory().isPopulateFromClass()) { for (EndpointInfo ei : bindingInfo.getService().getEndpoints()) { ei.setProperty("soap.no.validate.parts", Boolean.TRUE); for (BindingOperationInfo op : bindingInfo.getOperations()) { op.setProperty("operation.is.synthetic", Boolean.TRUE); op.getOperationInfo().setProperty("operation.is.synthetic", Boolean.TRUE);
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; }
/** * Creates a "default" BindingInfo object for the service. Can return a subclass * which can then process the extensors within the subclass. By default, just * creates it for the first ServiceInfo in the service */ public BindingInfo createBindingInfo(Service service, String namespace, Object config) { BindingInfo bi = createBindingInfo(service.getServiceInfos().get(0), namespace, config); if (bi.getName() == null) { bi.setName(new QName(service.getName().getNamespaceURI(), service.getName().getLocalPart() + "Binding")); } return bi; }
private BindingOperationInfo getOperation(Message message, QName opName) { BindingOperationInfo bop = ServiceModelUtil.getOperation(message.getExchange(), opName); if (bop == null) { Endpoint ep = message.getExchange().getEndpoint(); if (ep == null) { return null; } BindingInfo service = ep.getEndpointInfo().getBinding(); boolean output = !isRequestor(message); for (BindingOperationInfo info : service.getOperations()) { if (info.getName().getLocalPart().equals(opName.getLocalPart())) { SoapBody body = null; if (output) { body = info.getOutput().getExtensor(SoapBody.class); } else { body = info.getInput().getExtensor(SoapBody.class); } if (body != null && opName.getNamespaceURI().equals(body.getNamespaceURI())) { return info; } } } } return bop; } public void handleMessage(Message message) {
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; }
private boolean checkBindingOperationInOut(BindingMessageInfo bmi) { if ((bmi.getMessageInfo() != null) && (bmi.getMessageInfo().getName() != null) && (bmi.getBindingOperation() != null) && (bmi.getBindingOperation().getName() != null) && (bmi.getBindingOperation().getBinding() != null) && (bmi.getBindingOperation().getBinding().getName() != null)) { if ((Type.INPUT == bmi.getMessageInfo().getType()) && wsdl11XPointer.matchesBindingOperationInput( bmi.getMessageInfo().getName().getNamespaceURI(), bmi.getBindingOperation().getBinding().getName().getLocalPart(), bmi.getBindingOperation().getName().getLocalPart())) { return true; } if ((Type.OUTPUT == bmi.getMessageInfo().getType()) && wsdl11XPointer.matchesBindingOperationOutput( bmi.getMessageInfo().getName().getNamespaceURI(), bmi.getBindingOperation().getBinding().getName().getLocalPart(), bmi.getBindingOperation().getName().getLocalPart())) { return true; } } return false; }
protected void buildBinding(Definition definition, Collection<BindingInfo> bindingInfos, Collection<PortType> portTypes) { Binding binding = null; for (BindingInfo bindingInfo : bindingInfos) { binding = definition.createBinding(); addDocumentation(binding, bindingInfo.getDocumentation()); binding.setUndefined(false); for (PortType portType : portTypes) { if (portType.getQName().equals(bindingInfo.getInterface().getName())) { binding.setPortType(portType); break; } } binding.setQName(bindingInfo.getName()); if (!bindingInfo.getName().getNamespaceURI().equals(definition.getTargetNamespace())) { addNamespace(bindingInfo.getName().getNamespaceURI(), definition); } buildBindingOperation(definition, binding, bindingInfo.getOperations()); addExtensibilityElements(definition, binding, getWSDL11Extensors(bindingInfo)); definition.addBinding(binding); } }
onlyExtensors = true; } else { bi = new BindingInfo(service, ns.toString()); bi.setName(binding.getQName()); copyExtensors(bi, binding.getExtensibilityElements()); copyExtensionAttributes(bi, binding); bop2 = bi.getOperation(new QName(binding.getQName().getNamespaceURI(), bop.getName())); } else { bop2 = bi.buildOperation(new QName(binding.getQName().getNamespaceURI(), bop.getName()), inName, outName); if (bop2 != null) { bi.addOperation(bop2); BindingFaultInfo bif = bop2.getFault(new QName(service.getTargetNamespace(), f .getName())); copyExtensors(bif, bop.getBindingFault(f.getName()).getExtensibilityElements()); service.addBinding(bi); DescriptionInfo d = service.getDescription(); if (null != d) { d.getDescribed().add(bi);
protected BindingInfo initializeBindingInfo(ServiceInfo service, Binding binding, BindingInfo bi) { bi.setName(binding.getQName()); copyExtensors(bi, binding, null); outName = bop.getBindingOutput().getName(); String portTypeNs = binding.getPortType().getQName().getNamespaceURI(); QName opName = new QName(portTypeNs, bop.getName()); BindingOperationInfo bop2 = bi.getOperation(opName); if (bop2 == null) { bop2 = bi.buildOperation(opName, inName, outName); if (bop2 != null) { bi.addOperation(bop2); copyExtensors(bop2, bop, bop2); if (bop.getBindingInput() != null) { copyExtensors(bop2.getInput(), bop.getBindingInput(), bop2); copyExtensors(bop2.getOutput(), bop.getBindingOutput(), bop2); + " must have a name attribute."); copyExtensors(bop2.getFault(new QName(service.getTargetNamespace(), f.getName())), bop.getBindingFault(f.getName()), bop2);
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 boolean checkBindingOperationFault(BindingFaultInfo bfi) { return (bfi.getFaultInfo() != null) && (bfi.getFaultInfo().getFaultName() != null) && (bfi.getBindingOperation().getName() != null) && (bfi.getBindingOperation().getBinding() != null) && (bfi.getBindingOperation().getBinding().getName() != null) && wsdl11XPointer.matchesBindingOperationFault( bfi.getFaultInfo().getFaultName().getNamespaceURI(), bfi.getBindingOperation().getBinding().getName().getLocalPart(), bfi.getBindingOperation().getName().getLocalPart(), bfi.getFaultInfo().getFaultName().getLocalPart()); }
public BindingInfo createBindingInfo(Service service, String namespace, Object obj) { BindingInfo info = new BindingInfo(null, JAXRSBindingFactory.JAXRS_BINDING_ID); info.setName(new QName(JAXRSBindingFactory.JAXRS_BINDING_ID, "binding")); return info; }
public static BindingOperationInfo getOperation(Exchange exchange, String opName) { Endpoint ep = exchange.get(Endpoint.class); if (ep == null) { return null; } BindingInfo service = ep.getEndpointInfo().getBinding(); for (BindingOperationInfo b : service.getOperations()) { if (b.getName().getLocalPart().equals(opName)) { return b; } } return null; }
public static BindingOperationInfo getOperation(Exchange exchange, String opName) { Endpoint ep = exchange.getEndpoint(); if (ep == null) { return null; } BindingInfo service = ep.getEndpointInfo().getBinding(); for (BindingOperationInfo b : service.getOperations()) { if (b.getName().getLocalPart().equals(opName)) { return b; } } return null; }
private boolean isValidEndpoint(EndpointInfo endpoint) { BindingInfo binding = endpoint.getBinding(); Map<QName, QName> uniqueNames = new HashMap<>(); Map<QName, Set<String>> actions = new HashMap<>(); Collection<BindingOperationInfo> bos = binding.getOperations(); for (BindingOperationInfo bo : bos) { OperationInfo op = binding.getInterface().getOperation(bo.getName()); if (op.getInput() != null && op.getInput().getMessagePartsNumber() == 1) { MessagePartInfo part = op.getInput().getFirstMessagePart(); if (part.getElementQName() == null) { continue; endpoint.getName(), op.getName(), opName, mName); addErrorMessage(msg.toString()); return false; for (BindingFaultInfo fault : bo.getFaults()) { if (fault.getFaultInfo().getMessagePartsNumber() > 1) { Message msg = new Message("FAULT_WITH_MULTIPLE_PARTS", LOG, fault.getFaultInfo().getName() .getLocalPart()); addErrorMessage(msg.toString()); return false;
private boolean checkXMLFormat(BindingInfo binding) { Collection<BindingOperationInfo> bos = binding.getOperations(); boolean result = true; boolean needRootNode = false; for (BindingOperationInfo bo : bos) { OperationInfo op = binding.getInterface().getOperation(bo.getName()); needRootNode = false; if (op.getInput().getMessageParts().size() == 0 || op.getInput().getMessageParts().size() > 1) { needRootNode = true; String path = "Binding(" + binding.getName().getLocalPart() + "):BindingOperation(" + bo.getName() + ")"; List<ExtensibilityElement> inExtensors = bo.getInput().getExtensors(ExtensibilityElement.class); Iterator<ExtensibilityElement> itIn = null; if (inExtensors != null) { if (op.getOutput() != null) { needRootNode = false; if (op.getOutput().getMessageParts().size() == 0 bo.getOutput().getExtensors(ExtensibilityElement.class); Iterator<ExtensibilityElement> itOut = null; if (outExtensors != null) {
private JavaPort processPort(JavaModel model, ServiceInfo si, EndpointInfo port) throws ToolException { BindingInfo binding = port.getBinding(); String portType = binding.getInterface().getName().getLocalPart(); JavaInterface intf = PortTypeProcessor.getInterface(context, si, binding.getInterface()); JavaPort jport = new JavaPort(NameUtil.mangleNameToClassName(port.getName().getLocalPart())); jport.setPackageName(intf.getPackageName()); jport.setPortName(port.getName().getLocalPart()); jport.setBindingAdress(port.getAddress()); jport.setBindingName(binding.getName().getLocalPart()); new org.apache.cxf.common.i18n.Message("BINDING_SPECIFY_ONE_PROTOCOL", LOG, binding.getName()); throw new ToolException(msg); Collection<BindingOperationInfo> operations = binding.getOperations(); for (BindingOperationInfo bop : operations) { processOperation(model, bop, binding);