Search in sources :

Example 1 with ArgType

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

the class CorbaStreamOutInterceptor method handleInBoundMessage.

private void handleInBoundMessage(CorbaMessage message, BindingOperationInfo boi) {
    boolean wrap = false;
    if (boi.isUnwrappedCapable()) {
        wrap = true;
    }
    OperationType opType = boi.getExtensor(OperationType.class);
    ArgType returnParam = opType.getReturn();
    List<ParamType> paramTypes = opType.getParam();
    List<ArgType> params = new ArrayList<>();
    if (returnParam != null) {
        params.add(returnParam);
    }
    for (Iterator<ParamType> iter = paramTypes.iterator(); iter.hasNext(); ) {
        ParamType param = iter.next();
        if (!param.getMode().equals(ModeType.IN)) {
            params.add(param);
        }
    }
    CorbaStreamWriter writer = new CorbaStreamWriter(orb, params, typeMap, service, wrap);
    message.setContent(XMLStreamWriter.class, writer);
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) CorbaStreamWriter(org.apache.cxf.binding.corba.runtime.CorbaStreamWriter) ArrayList(java.util.ArrayList) OperationType(org.apache.cxf.binding.corba.wsdl.OperationType) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Example 2 with ArgType

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

the class CorbaStreamOutEndingInterceptor method handleOutBoundMessage.

private void handleOutBoundMessage(CorbaMessage message, BindingOperationInfo boi) {
    OperationInfo opInfo = boi.getOperationInfo();
    OperationType opType = boi.getExtensor(OperationType.class);
    List<ParamType> paramTypes = opType.getParam();
    MessageInfo outMsgInfo = opInfo.getOutput();
    String wrapNSUri = null;
    boolean wrap = false;
    if (boi.isUnwrappedCapable()) {
        wrap = true;
        if (outMsgInfo != null) {
            wrapNSUri = getWrappedParamNamespace(outMsgInfo);
            if (!CorbaUtils.isElementFormQualified(service, wrapNSUri)) {
                wrapNSUri = "";
            }
        }
    }
    CorbaStreamWriter writer = (CorbaStreamWriter) message.getContent(XMLStreamWriter.class);
    CorbaObjectHandler[] objs = writer.getCorbaObjects();
    int count = 0;
    int msgIndex = 0;
    ArgType returnParam = opType.getReturn();
    if (returnParam != null) {
        QName retName;
        if (wrap) {
            retName = new QName(wrapNSUri, returnParam.getName());
        } else {
            retName = getMessageParamQName(outMsgInfo, returnParam.getName(), msgIndex);
        }
        QName retIdlType = returnParam.getIdltype();
        CorbaObjectHandler obj = CorbaHandlerUtils.initializeObjectHandler(orb, retName, retIdlType, typeMap, service);
        CorbaStreamable streamable = message.createStreamableObject(obj, retName);
        message.setStreamableReturn(streamable);
        msgIndex++;
    }
    for (Iterator<ParamType> iter = paramTypes.iterator(); iter.hasNext(); ) {
        ParamType param = iter.next();
        QName idlType = param.getIdltype();
        QName paramName;
        final CorbaObjectHandler obj;
        if (param.getMode().equals(ModeType.OUT)) {
            if (wrap) {
                paramName = new QName(wrapNSUri, param.getName());
            } else {
                paramName = getMessageParamQName(outMsgInfo, param.getName(), msgIndex);
            }
            obj = CorbaHandlerUtils.initializeObjectHandler(orb, paramName, idlType, typeMap, service);
            msgIndex++;
        } else {
            obj = objs[count++];
            paramName = obj.getName();
        }
        CorbaStreamable streamable = message.createStreamableObject(obj, paramName);
        ModeType paramMode = param.getMode();
        if ("in".equals(paramMode.value())) {
            streamable.setMode(org.omg.CORBA.ARG_IN.value);
        } else if ("inout".equals(paramMode.value())) {
            streamable.setMode(org.omg.CORBA.ARG_INOUT.value);
        }
        // default mode is out
        message.addStreamableArgument(streamable);
    }
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) CorbaStreamable(org.apache.cxf.binding.corba.CorbaStreamable) QName(javax.xml.namespace.QName) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType) MessageInfo(org.apache.cxf.service.model.MessageInfo) CorbaStreamWriter(org.apache.cxf.binding.corba.runtime.CorbaStreamWriter) XMLStreamWriter(javax.xml.stream.XMLStreamWriter) CorbaObjectHandler(org.apache.cxf.binding.corba.types.CorbaObjectHandler) ModeType(org.apache.cxf.binding.corba.wsdl.ModeType) OperationType(org.apache.cxf.binding.corba.wsdl.OperationType)

Example 3 with ArgType

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

the class CorbaStreamOutInterceptor method handleOutBoundMessage.

private void handleOutBoundMessage(CorbaMessage message, BindingOperationInfo boi) {
    boolean wrap = false;
    if (boi.isUnwrappedCapable()) {
        wrap = true;
    }
    OperationType opType = boi.getExtensor(OperationType.class);
    List<ParamType> paramTypes = opType.getParam();
    List<ArgType> params = new ArrayList<>();
    for (Iterator<ParamType> iter = paramTypes.iterator(); iter.hasNext(); ) {
        ParamType param = iter.next();
        if (!param.getMode().equals(ModeType.OUT)) {
            params.add(param);
        }
    }
    CorbaStreamWriter writer = new CorbaStreamWriter(orb, params, typeMap, service, wrap);
    message.setContent(XMLStreamWriter.class, writer);
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) CorbaStreamWriter(org.apache.cxf.binding.corba.runtime.CorbaStreamWriter) ArrayList(java.util.ArrayList) OperationType(org.apache.cxf.binding.corba.wsdl.OperationType) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Example 4 with ArgType

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

the class AttributeVisitor method generateGetter.

private void generateGetter(AST typeNode, AST nameNode) {
    // generate wrapped doc element in parameter
    XmlSchemaElement inParameters = generateWrappedDocElement(null, GETTER_PREFIX + nameNode.toString(), PARAM_NAME);
    // generate wrapped doc element out parameter
    XmlSchemaElement outParameters = generateWrappedDocElement(typeNode, GETTER_PREFIX + nameNode.toString() + RESULT_POSTFIX, RETURN_PARAM_NAME);
    // generate input message
    Message inMsg = generateMessage(inParameters, GETTER_PREFIX + nameNode.toString());
    // generate output message
    Message outMsg = generateMessage(outParameters, GETTER_PREFIX + nameNode.toString() + RESPONSE_POSTFIX);
    // generate operation
    String name = GETTER_PREFIX + nameNode.toString();
    Operation op = generateOperation(name, inMsg, outMsg);
    // generate corba return param
    ArgType corbaReturn = generateCorbaReturnParam(typeNode);
    // generate corba operation
    OperationType corbaOp = generateCorbaOperation(op, null, corbaReturn);
    // generate binding
    generateCorbaBindingOperation(binding, op, corbaOp);
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) 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)

Example 5 with ArgType

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

the class WSDLParameter method processReturnParams.

private void processReturnParams(List<ParamType> outputs, List<ArgType> returns) {
    if (!outputs.isEmpty()) {
        ParamType d2 = outputs.get(0);
        if ("out".equals(d2.getMode().value())) {
            ArgType argType = new ArgType();
            argType.setName(d2.getName());
            argType.setIdltype(d2.getIdltype());
            returns.add(argType);
            outputs.remove(0);
        }
    }
}
Also used : ArgType(org.apache.cxf.binding.corba.wsdl.ArgType) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType)

Aggregations

ArgType (org.apache.cxf.binding.corba.wsdl.ArgType)12 ParamType (org.apache.cxf.binding.corba.wsdl.ParamType)8 OperationType (org.apache.cxf.binding.corba.wsdl.OperationType)6 CorbaStreamWriter (org.apache.cxf.binding.corba.runtime.CorbaStreamWriter)4 ArrayList (java.util.ArrayList)3 QName (javax.xml.namespace.QName)3 XMLStreamWriter (javax.xml.stream.XMLStreamWriter)2 CorbaStreamable (org.apache.cxf.binding.corba.CorbaStreamable)2 CorbaObjectHandler (org.apache.cxf.binding.corba.types.CorbaObjectHandler)2 ModeType (org.apache.cxf.binding.corba.wsdl.ModeType)2 RaisesType (org.apache.cxf.binding.corba.wsdl.RaisesType)2 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)2 MessageInfo (org.apache.cxf.service.model.MessageInfo)2 OperationInfo (org.apache.cxf.service.model.OperationInfo)2 ToolException (org.apache.cxf.tools.common.ToolException)2 IdlString (org.apache.cxf.tools.corba.common.idltypes.IdlString)2 BindingFault (javax.wsdl.BindingFault)1 BindingOperation (javax.wsdl.BindingOperation)1 Fault (javax.wsdl.Fault)1 Message (javax.wsdl.Message)1