Java Code Examples for org.apache.cxf.service.model.BindingInfo#setName()

The following examples show how to use org.apache.cxf.service.model.BindingInfo#setName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: XMLBindingFactory.java    From cxf with Apache License 2.0 5 votes vote down vote up
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;
}
 
Example 2
Source File: AbstractBindingFactory.java    From cxf with Apache License 2.0 5 votes vote down vote up
/**
 * 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;
}
 
Example 3
Source File: JAXRSBindingFactory.java    From cxf with Apache License 2.0 4 votes vote down vote up
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;
}
 
Example 4
Source File: AbstractWSDLBindingFactory.java    From cxf with Apache License 2.0 4 votes vote down vote up
protected BindingInfo initializeBindingInfo(ServiceInfo service, Binding binding, BindingInfo bi) {
    bi.setName(binding.getQName());
    copyExtensors(bi, binding, null);

    for (BindingOperation bop : cast(binding.getBindingOperations(), BindingOperation.class)) {
        String inName = null;
        String outName = null;
        if (bop.getBindingInput() != null) {
            inName = bop.getBindingInput().getName();
        }
        if (bop.getBindingOutput() != 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);
            }
        }
        if (bop2 != null) {
            copyExtensors(bop2, bop, bop2);
            if (bop.getBindingInput() != null) {
                copyExtensors(bop2.getInput(), bop.getBindingInput(), bop2);
            }
            if (bop.getBindingOutput() != null) {
                copyExtensors(bop2.getOutput(), bop.getBindingOutput(), bop2);
            }
            for (BindingFault f : cast(bop.getBindingFaults().values(), BindingFault.class)) {
                if (StringUtils.isEmpty(f.getName())) {
                    throw new IllegalArgumentException("wsdl:fault and soap:fault elements"
                                                       + " must have a name attribute.");
                }
                copyExtensors(bop2.getFault(new QName(service.getTargetNamespace(), f.getName())),
                              bop.getBindingFault(f.getName()), bop2);
            }
        }
    }
    return bi;
}