Search in sources :

Example 1 with ParamType

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

the class CorbaStreamInInterceptor method prepareArguments.

protected NVList prepareArguments(CorbaMessage corbaMsg, InterfaceInfo info, OperationType opType, QName opQName, CorbaTypeMap typeMap, CorbaDestination destination, ServiceInfo service) {
    BindingInfo bInfo = destination.getBindingInfo();
    EndpointInfo eptInfo = destination.getEndPointInfo();
    BindingOperationInfo bOpInfo = bInfo.getOperation(opQName);
    OperationInfo opInfo = bOpInfo.getOperationInfo();
    Exchange exg = corbaMsg.getExchange();
    exg.put(BindingInfo.class, bInfo);
    exg.put(InterfaceInfo.class, info);
    exg.put(EndpointInfo.class, eptInfo);
    exg.put(EndpointReferenceType.class, destination.getAddress());
    exg.put(ServiceInfo.class, service);
    exg.put(BindingOperationInfo.class, bOpInfo);
    exg.put(OperationInfo.class, opInfo);
    exg.put(MessageInfo.class, opInfo.getInput());
    exg.put(String.class, opQName.getLocalPart());
    exg.setInMessage(corbaMsg);
    corbaMsg.put(MessageInfo.class, opInfo.getInput());
    List<ParamType> paramTypes = opType.getParam();
    CorbaStreamable[] arguments = new CorbaStreamable[paramTypes.size()];
    return prepareDIIArgsList(corbaMsg, bOpInfo, arguments, paramTypes, typeMap, exg.get(ORB.class), service);
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) OperationInfo(org.apache.cxf.service.model.OperationInfo) Exchange(org.apache.cxf.message.Exchange) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) CorbaStreamable(org.apache.cxf.binding.corba.CorbaStreamable) BindingInfo(org.apache.cxf.service.model.BindingInfo) ParamType(org.apache.cxf.binding.corba.wsdl.ParamType) ORB(org.omg.CORBA.ORB)

Example 2 with ParamType

use of org.apache.cxf.binding.corba.wsdl.ParamType 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;
        CorbaObjectHandler obj = null;
        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 (paramMode.value().equals("in")) {
            streamable.setMode(org.omg.CORBA.ARG_IN.value);
        } else if (paramMode.value().equals("inout")) {
            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 ParamType

use of org.apache.cxf.binding.corba.wsdl.ParamType 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 4 with ParamType

use of org.apache.cxf.binding.corba.wsdl.ParamType 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 5 with ParamType

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

the class WSDLParameter method processInputParams.

private void processInputParams(WSDLToCorbaBinding wsdlToCorbaBinding, Operation operation, SchemaCollection xmlSchemaList, List<ParamType> inputs) throws Exception {
    Input input = operation.getInput();
    if (input != null) {
        Message msg = input.getMessage();
        List<Part> parts = CastUtils.cast(msg.getOrderedParts(null));
        for (Part part : parts) {
            XmlSchemaType schemaType = null;
            boolean isObjectRef = isObjectReference(xmlSchemaList, part.getElementName());
            if (part.getElementName() != null && !isObjectRef) {
                XmlSchemaElement el = getElement(part, xmlSchemaList);
                if (el != null) {
                    if (el.getSchemaType() != null) {
                        schemaType = el.getSchemaType();
                    }
                    QName typeName = el.getSchemaTypeName();
                    if (typeName == null) {
                        typeName = el.getQName();
                    }
                    QName idltype = getIdlType(wsdlToCorbaBinding, schemaType, typeName, el.isNillable());
                    ParamType paramtype = createParam(wsdlToCorbaBinding, "in", part.getName(), idltype);
                    if (paramtype != null) {
                        inputs.add(paramtype);
                    }
                }
            } else if (part.getTypeName() != null) {
                schemaType = getType(part, xmlSchemaList);
                QName typeName = part.getTypeName();
                if (isObjectRef) {
                    typeName = part.getElementName();
                }
                QName idltype = getIdlType(wsdlToCorbaBinding, schemaType, typeName, false);
                ParamType paramtype = createParam(wsdlToCorbaBinding, "in", part.getName(), idltype);
                if (paramtype != null) {
                    inputs.add(paramtype);
                }
            }
        }
    }
}
Also used : Input(javax.wsdl.Input) Message(javax.wsdl.Message) Part(javax.wsdl.Part) XmlSchemaElement(org.apache.ws.commons.schema.XmlSchemaElement) QName(javax.xml.namespace.QName) XmlSchemaType(org.apache.ws.commons.schema.XmlSchemaType) 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