Search in sources :

Example 11 with ParamType

use of org.apache.cxf.binding.corba.wsdl.ParamType in project cxf by apache.

the class AttributeVisitor method generateSetter.

private void generateSetter(AST typeNode, AST nameNode) {
    // generate wrapped doc element in parameter
    XmlSchemaElement inParameters = generateWrappedDocElement(typeNode, SETTER_PREFIX + nameNode.toString(), PARAM_NAME);
    // generate wrapped doc element out parameter
    XmlSchemaElement outParameters = generateWrappedDocElement(null, SETTER_PREFIX + nameNode.toString() + RESULT_POSTFIX, RETURN_PARAM_NAME);
    // generate input message
    Message inMsg = generateMessage(inParameters, SETTER_PREFIX + nameNode.toString());
    // generate output message
    Message outMsg = generateMessage(outParameters, SETTER_PREFIX + nameNode.toString() + RESPONSE_POSTFIX);
    // generate operation
    String name = SETTER_PREFIX + nameNode.toString();
    Operation op = generateOperation(name, inMsg, outMsg);
    // generate corba return param
    ParamType corbaParam = generateCorbaParam(typeNode);
    // generate corba operation
    OperationType corbaOp = generateCorbaOperation(op, corbaParam, null);
    // generate binding
    generateCorbaBindingOperation(binding, op, corbaOp);
}
Also used : Message(javax.wsdl.Message) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) Operation(javax.wsdl.Operation) BindingOperation(javax.wsdl.BindingOperation) OperationType(org.apache.cxf.binding.corba.wsdl.OperationType) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Example 12 with ParamType

use of org.apache.cxf.binding.corba.wsdl.ParamType in project cxf by apache.

the class ParamDclVisitor method addCorbaParam.

private void addCorbaParam(CorbaType corbaType, ModeType mode, String partName, Scope fullyQualifiedName) {
    ParamType param = new ParamType();
    param.setName(partName);
    param.setMode(mode);
    if (corbaType == null) {
        ParamDeferredAction paramAction = new ParamDeferredAction(param);
        wsdlVisitor.getDeferredActions().add(fullyQualifiedName, paramAction);
    } else {
        param.setIdltype(corbaType.getQName());
    }
    corbaOperation.getParam().add(param);
}
Also used : ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Example 13 with ParamType

use of org.apache.cxf.binding.corba.wsdl.ParamType in project cxf by apache.

the class WSDLParameter method processWrappedOutputParam.

private void processWrappedOutputParam(WSDLToCorbaBinding wsdlToCorbaBinding, XmlSchemaElement el, List<ParamType> inputs, List<ParamType> outputs) throws Exception {
    ParamType paramtype = null;
    for (int i = 0; i < inputs.size(); i++) {
        if (inputs.get(i).getName().equals(el.getQName().getLocalPart())) {
            inputs.remove(i);
            QName typeName = el.getSchemaTypeName();
            if (typeName == null) {
                typeName = el.getQName();
            }
            QName idltype = getIdlType(wsdlToCorbaBinding, el.getSchemaType(), typeName, el.isNillable());
            paramtype = createParam(wsdlToCorbaBinding, "inout", el.getQName().getLocalPart(), idltype);
            if (paramtype != null) {
                inputs.add(paramtype);
            }
        }
    }
    if (paramtype == null) {
        QName typeName = el.getSchemaTypeName();
        if (typeName == null) {
            typeName = el.getQName();
        }
        QName idltype = getIdlType(wsdlToCorbaBinding, el.getSchemaType(), typeName, el.isNillable());
        paramtype = createParam(wsdlToCorbaBinding, "out", el.getQName().getLocalPart(), idltype);
        if (paramtype != null) {
            outputs.add(paramtype);
        }
    }
}
Also used : QName(javax.xml.namespace.QName) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Example 14 with ParamType

use of org.apache.cxf.binding.corba.wsdl.ParamType in project cxf by apache.

the class WSDLParameter method createParam.

private static ParamType createParam(WSDLToCorbaBinding wsdlToCorbaBinding, String mode, String name, QName idltype) throws Exception {
    ParamType paramtype = new ParamType();
    ModeType modeType = ModeType.fromValue(mode);
    paramtype.setName(name);
    paramtype.setMode(modeType);
    paramtype.setIdltype(idltype);
    return paramtype;
}
Also used : ModeType(org.apache.cxf.binding.corba.wsdl.ModeType) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Example 15 with ParamType

use of org.apache.cxf.binding.corba.wsdl.ParamType in project cxf by apache.

the class WSDLParameter method processWrappedInputParams.

private void processWrappedInputParams(WSDLToCorbaBinding wsdlToCorbaBinding, Operation operation, SchemaCollection xmlSchemaList, List<ParamType> inputs) throws Exception {
    Input input = operation.getInput();
    if (input != null) {
        Message msg = input.getMessage();
        Part part = (Part) msg.getOrderedParts(null).iterator().next();
        XmlSchemaElement el = getElement(part, xmlSchemaList);
        if (el == null) {
            return;
        }
        XmlSchemaComplexType schemaType = null;
        if (el.getSchemaType() != null) {
            schemaType = (XmlSchemaComplexType) el.getSchemaType();
        }
        XmlSchemaSequence seq = (XmlSchemaSequence) schemaType.getParticle();
        if (seq != null) {
            for (XmlSchemaSequenceMember seqItem : seq.getItems()) {
                if (seqItem instanceof XmlSchemaElement) {
                    el = (XmlSchemaElement) seqItem;
                    // REVISIT, handle element ref's?
                    QName typeName = el.getSchemaTypeName();
                    if (typeName == null) {
                        typeName = el.getQName();
                    }
                    QName idltype = getIdlType(wsdlToCorbaBinding, el.getSchemaType(), typeName, el.isNillable());
                    ParamType paramtype = createParam(wsdlToCorbaBinding, "in", el.getQName().getLocalPart(), idltype);
                    if (paramtype != null) {
                        inputs.add(paramtype);
                    }
                }
            }
        }
    }
}
Also used : XmlSchemaSequence(org.apache.ws.commons.schema.XmlSchemaSequence) Input(javax.wsdl.Input) Message(javax.wsdl.Message) Part(javax.wsdl.Part) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) QName(javax.xml.namespace.QName) XmlSchemaSequenceMember(org.apache.ws.commons.schema.XmlSchemaSequenceMember) XmlSchemaComplexType(org.apache.ws.commons.schema.XmlSchemaComplexType) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Aggregations

ParamType (org.apache.cxf.binding.corba.wsdl.ParamType)21 QName (javax.xml.namespace.QName)9 ArgType (org.apache.cxf.binding.corba.wsdl.ArgType)8 OperationType (org.apache.cxf.binding.corba.wsdl.OperationType)8 Message (javax.wsdl.Message)4 CorbaStreamWriter (org.apache.cxf.binding.corba.runtime.CorbaStreamWriter)4 ModeType (org.apache.cxf.binding.corba.wsdl.ModeType)4 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)4 OperationInfo (org.apache.cxf.service.model.OperationInfo)4 XmlSchemaElement (org.apache.ws.commons.schema.XmlSchemaElement)4 ArrayList (java.util.ArrayList)3 BindingOperation (javax.wsdl.BindingOperation)3 Part (javax.wsdl.Part)3 CorbaStreamable (org.apache.cxf.binding.corba.CorbaStreamable)3 CorbaObjectHandler (org.apache.cxf.binding.corba.types.CorbaObjectHandler)3 MessageInfo (org.apache.cxf.service.model.MessageInfo)3 File (java.io.File)2 Binding (javax.wsdl.Binding)2 Definition (javax.wsdl.Definition)2 Input (javax.wsdl.Input)2