Search in sources :

Example 21 with BindingInput

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

the class ServiceWSDLBuilder method buildBindingInput.

protected void buildBindingInput(Definition def, BindingOperation bindingOperation, BindingMessageInfo bindingMessageInfo) {
    if (bindingMessageInfo != null) {
        final BindingInput bindingInput = def.createBindingInput();
        addDocumentation(bindingInput, bindingMessageInfo.getDocumentation());
        bindingInput.setName(bindingMessageInfo.getMessageInfo().getName().getLocalPart());
        bindingOperation.setBindingInput(bindingInput);
        addExtensibilityAttributes(def, bindingInput, bindingMessageInfo.getExtensionAttributes());
        addExtensibilityElements(def, bindingInput, getWSDL11Extensors(bindingMessageInfo));
    }
}
Also used : BindingInput(javax.wsdl.BindingInput)

Example 22 with BindingInput

use of javax.wsdl.BindingInput 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

BindingInput (javax.wsdl.BindingInput)22 BindingOperation (javax.wsdl.BindingOperation)16 Binding (javax.wsdl.Binding)7 QName (javax.xml.namespace.QName)7 BindingOutput (javax.wsdl.BindingOutput)6 SOAPBinding (javax.wsdl.extensions.soap.SOAPBinding)6 SOAPBody (javax.wsdl.extensions.soap.SOAPBody)6 ToolException (org.apache.cxf.tools.common.ToolException)5 Test (org.junit.Test)5 File (java.io.File)4 Message (javax.wsdl.Message)4 Operation (javax.wsdl.Operation)4 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)4 SOAP12Binding (javax.wsdl.extensions.soap12.SOAP12Binding)4 SoapBinding (org.apache.cxf.binding.soap.wsdl.extensions.SoapBinding)4 SoapBody (org.apache.cxf.binding.soap.wsdl.extensions.SoapBody)4 SoapOperation (org.apache.cxf.binding.soap.wsdl.extensions.SoapOperation)4 ArrayList (java.util.ArrayList)3 Input (javax.wsdl.Input)3 SOAPOperation (javax.wsdl.extensions.soap.SOAPOperation)3