Search in sources :

Example 11 with BindingOutput

use of javax.wsdl.BindingOutput in project cxf by apache.

the class WSDLToCorbaBinding method addBindingOperations.

private void addBindingOperations(Definition definition, PortType portType, Binding binding) throws Exception {
    List<Operation> ops = CastUtils.cast(portType.getOperations());
    for (Operation op : ops) {
        try {
            BindingOperation bindingOperation = definition.createBindingOperation();
            addCorbaOperationExtElement(bindingOperation, op);
            bindingOperation.setName(op.getName());
            if (op.getInput() != null) {
                BindingInput bindingInput = definition.createBindingInput();
                bindingInput.setName(op.getInput().getName());
                bindingOperation.setBindingInput(bindingInput);
            }
            if (op.getOutput() != null) {
                BindingOutput bindingOutput = definition.createBindingOutput();
                bindingOutput.setName(op.getOutput().getName());
                bindingOperation.setBindingOutput(bindingOutput);
            }
            // add Faults
            if (op.getFaults() != null && op.getFaults().size() > 0) {
                Collection<Fault> faults = CastUtils.cast(op.getFaults().values());
                for (Fault fault : faults) {
                    BindingFault bindingFault = definition.createBindingFault();
                    bindingFault.setName(fault.getName());
                    bindingOperation.addBindingFault(bindingFault);
                }
            }
            bindingOperation.setOperation(op);
            binding.addBindingOperation(bindingOperation);
        } catch (Exception ex) {
            LOG.warning("Operation " + op.getName() + " not mapped to CORBA binding.");
        }
    }
}
Also used : BindingOperation(javax.wsdl.BindingOperation) BindingOutput(javax.wsdl.BindingOutput) BindingFault(javax.wsdl.BindingFault) Fault(javax.wsdl.Fault) BindingFault(javax.wsdl.BindingFault) Operation(javax.wsdl.Operation) BindingOperation(javax.wsdl.BindingOperation) BindingInput(javax.wsdl.BindingInput) WSDLException(javax.wsdl.WSDLException) ToolException(org.apache.cxf.tools.common.ToolException)

Example 12 with BindingOutput

use of javax.wsdl.BindingOutput in project cxf by apache.

the class WSDLToSoapProcessor method getBindingOutput.

private BindingOutput getBindingOutput(Output output) throws ToolException {
    BindingOutput bo = wsdlDefinition.createBindingOutput();
    bo.setName(output.getName());
    // As command line won't specify the details of body/header for message
    // parts
    // All output message's parts will be added into one soap body element
    bo.addExtensibilityElement(getSoapBody(BindingOutput.class));
    return bo;
}
Also used : BindingOutput(javax.wsdl.BindingOutput)

Example 13 with BindingOutput

use of javax.wsdl.BindingOutput in project cxf by apache.

the class PartialWSDLProcessor method getBindingOutput.

private static BindingOutput getBindingOutput(Output output, Definition wsdlDefinition, ExtensionRegistry extReg) throws Exception {
    BindingOutput bo = wsdlDefinition.createBindingOutput();
    bo.setName(output.getName());
    bo.addExtensibilityElement(getSoapBody(BindingOutput.class, extReg));
    return bo;
}
Also used : BindingOutput(javax.wsdl.BindingOutput)

Example 14 with BindingOutput

use of javax.wsdl.BindingOutput in project cxf by apache.

the class ServiceWSDLBuilder method buildBindingOutput.

protected void buildBindingOutput(Definition def, BindingOperation bindingOperation, BindingMessageInfo bindingMessageInfo) {
    if (bindingMessageInfo != null) {
        final BindingOutput bindingOutput = def.createBindingOutput();
        addDocumentation(bindingOutput, bindingMessageInfo.getDocumentation());
        bindingOutput.setName(bindingMessageInfo.getMessageInfo().getName().getLocalPart());
        bindingOperation.setBindingOutput(bindingOutput);
        addExtensibilityAttributes(def, bindingOutput, bindingMessageInfo.getExtensionAttributes());
        addExtensibilityElements(def, bindingOutput, getWSDL11Extensors(bindingMessageInfo));
    }
}
Also used : BindingOutput(javax.wsdl.BindingOutput)

Example 15 with BindingOutput

use of javax.wsdl.BindingOutput in project pentaho-kettle by pentaho.

the class WsdlUtils method getSOAPBindingUse.

/**
 * Get the SOAP Use type for the specified operation.
 *
 * @param binding
 *          A WSDL Binding instance.
 * @param operationName
 *          The name of the operation.
 * @return Either 'literal' or 'encoded'.
 * @throws RuntimeException
 *           If the use type cannot be determined.
 */
protected static String getSOAPBindingUse(Binding binding, String operationName) {
    BindingOperation bindingOperation = binding.getBindingOperation(operationName, null, null);
    if (bindingOperation == null) {
        throw new IllegalArgumentException("Can not find operation: " + operationName);
    }
    // first try getting the use setting from the input message
    BindingInput bindingInput = bindingOperation.getBindingInput();
    if (bindingInput != null) {
        ExtensibilityElement soapBodyElem = WsdlUtils.findExtensibilityElement(bindingInput, SOAP_BODY_ELEMENT_NAME);
        if (soapBodyElem != null) {
            if (soapBodyElem instanceof SOAP12BodyImpl) {
                return ((SOAP12BodyImpl) soapBodyElem).getUse();
            } else {
                return ((SOAPBody) soapBodyElem).getUse();
            }
        }
    }
    // if there was no input message try getting the use from the output message
    BindingOutput bindingOutput = bindingOperation.getBindingOutput();
    if (bindingOutput != null) {
        ExtensibilityElement soapBodyElem = WsdlUtils.findExtensibilityElement(bindingOutput, SOAP_BODY_ELEMENT_NAME);
        if (soapBodyElem != null) {
            if (soapBodyElem instanceof SOAP12BodyImpl) {
                return ((SOAP12BodyImpl) soapBodyElem).getUse();
            } else {
                return ((SOAPBody) soapBodyElem).getUse();
            }
        }
    }
    throw new RuntimeException("Unable to determine SOAP use for operation: " + operationName);
}
Also used : BindingOperation(javax.wsdl.BindingOperation) SOAPBody(javax.wsdl.extensions.soap.SOAPBody) BindingOutput(javax.wsdl.BindingOutput) SOAP12BodyImpl(com.ibm.wsdl.extensions.soap12.SOAP12BodyImpl) BindingInput(javax.wsdl.BindingInput) ExtensibilityElement(javax.wsdl.extensions.ExtensibilityElement)

Aggregations

BindingOutput (javax.wsdl.BindingOutput)15 BindingOperation (javax.wsdl.BindingOperation)9 BindingInput (javax.wsdl.BindingInput)6 ArrayList (java.util.ArrayList)3 Message (javax.wsdl.Message)3 Operation (javax.wsdl.Operation)3 Output (javax.wsdl.Output)3 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)3 SOAPBody (javax.wsdl.extensions.soap.SOAPBody)3 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)3 Input (javax.wsdl.Input)2 WSDLException (javax.wsdl.WSDLException)2 SOAPOperation (javax.wsdl.extensions.soap.SOAPOperation)2 SOAP12Body (javax.wsdl.extensions.soap12.SOAP12Body)2 QName (javax.xml.namespace.QName)2 OMNode (org.apache.axiom.om.OMNode)2 SOAPFaultCode (org.apache.axiom.soap.SOAPFaultCode)2 Document (org.w3c.dom.Document)2 Element (org.w3c.dom.Element)2 Node (org.w3c.dom.Node)2