Package org.apache.schemas.yoko.bindings.corba

Examples of org.apache.schemas.yoko.bindings.corba.OperationType


        assertEquals(bindingOp.getBindingOutput().getName(), "_get_test_idResponse");
        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
        while (bOp.hasNext()) {    
            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
            if (extElement.getElementType().getLocalPart().equals("operation")) {
                OperationType corbaOpType = (OperationType)extElement;                
                assertEquals(corbaOpType.getName(), "_get_test_id");               
                assertEquals(corbaOpType.getReturn().getName(), "return");
                assertEquals(corbaOpType.getReturn().getIdltype(), CorbaConstants.NT_CORBA_FLOAT);
            }
        }
    }
View Full Code Here


        assertEquals(bindingOp.getBindingOutput().getName(), "_set_test_idResponse");
        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
        while (bOp.hasNext()) {    
            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
            if (extElement.getElementType().getLocalPart().equals("operation")) {
                OperationType corbaOpType = (OperationType)extElement;                
                assertEquals(corbaOpType.getName(), "_set_test_id");    
                assertEquals(1, corbaOpType.getParam().size());               
                assertEquals(corbaOpType.getParam().get(0).getName(), "_arg");
                assertEquals(corbaOpType.getParam().get(0).getMode().value(), "in");
                assertEquals(corbaOpType.getParam().get(0).getIdltype(), CorbaConstants.NT_CORBA_FLOAT);
            }
        }
    }
View Full Code Here

        assertEquals(bindingOp.getBindingOutput().getName(), "test_voidResponse");
        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
        while (bOp.hasNext()) {    
            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
            if (extElement.getElementType().getLocalPart().equals("operation")) {
                OperationType corbaOpType = (OperationType)extElement;                
                assertEquals(corbaOpType.getName(), "test_void");    
                assertEquals(0, corbaOpType.getParam().size());                               
            }
        }
    }           
View Full Code Here

        assertEquals(bindingOp.getBindingOutput().getName(), name + "Response");
        Iterator bOp = bindingOp.getExtensibilityElements().iterator();
        while (bOp.hasNext()) {    
            ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
            if (extElement.getElementType().getLocalPart().equals("operation")) {
                OperationType corbaOpType = (OperationType)extElement;                
                assertEquals(corbaOpType.getName(), name);    
                assertEquals(3, corbaOpType.getParam().size());               
                assertEquals(corbaOpType.getParam().get(0).getName(), "x");
                assertEquals(corbaOpType.getParam().get(0).getMode().value(), "in");
                assertEquals(corbaOpType.getParam().get(0).getIdltype(),
                             corbaType);                              
                assertEquals(corbaOpType.getReturn().getName(), "return");
                assertEquals(corbaOpType.getReturn().getIdltype(), corbaType);

            }
        }
    }
View Full Code Here

                Iterator bOp = bindingOperation.getExtensibilityElements().iterator();
                while (bOp.hasNext()) {
                    ExtensibilityElement extElement = (ExtensibilityElement)bOp.next();
                    if (extElement.getElementType().getLocalPart().equals("operation")) {
                        OperationType corbaOpType = (OperationType)extElement;
                        assertEquals(corbaOpType.getName(), "op_a");
                        assertEquals(1, corbaOpType.getParam().size());
                        assertNotNull(corbaOpType.getReturn());
                        ParamType paramtype = corbaOpType.getParam().get(0);
                        assertEquals(paramtype.getName(), "part1");
                        QName idltype = new QName("http://schemas.apache.org/idl/anon.idl/corba/typemap/",
                                                  "ArrayType", "ns1");
                        assertEquals(paramtype.getIdltype(), idltype);
                        assertEquals(paramtype.getMode().toString(), "IN");
View Full Code Here

        node = node.getNextSibling();
    }

    private BindingOperation createBindingOperation(Binding wsdlBinding, Operation op) {
        BindingOperation bindingOperation = definition.createBindingOperation();
        OperationType operationType = null;
        try {
            operationType = (OperationType)extReg.createExtension(BindingOperation.class,
                                                                  CorbaConstants.NE_CORBA_OPERATION);
        } catch (WSDLException ex) {
            throw new RuntimeException(ex);
        }
        operationType.setName(op.getName());
        bindingOperation.addExtensibilityElement(operationType);
        bindingOperation.setOperation(op);
        bindingOperation.setName(op.getName());
        binding.addBindingOperation(bindingOperation);
        return bindingOperation;
View Full Code Here

        corbaBF.init(bus);
        manager.registerBinding(CorbaConstants.NU_WSDL_CORBA, corbaBF);
       
        EndpointReferenceType endpoint = testUtils.getSimpleTestEndpointReference();
        String opName = "testSimpleMethod";
        OperationType operation = CorbaUtils.getCorbaOperationType(opName, bus, endpoint);
        assertNotNull(operation);
    }
View Full Code Here

            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);

            // Get information about the operation being invoked from the WSDL definition.
            // We need this to marshal data correctly
            OperationType opElement =
                CorbaUtils.getCorbaOperationType(callback.getOperationName(), bus, endpointRef);
            if (opElement == null) {
                throw new CorbaBindingException("Unable to find operation definition");
            }

            // Handle the parameters that are given for the operation
            List<ParamType> paramTypes = opElement.getParam();
            boolean hasOutParamReturn =
                addMarshalParams(callback, paramTypes, corbaCtx, objContext,
                                 inputFactory, outputFactory, writer);

            // Check to see if we have an input or output message and handle the return type
            // appropriately
            boolean isInputMessage = (Boolean) mc.get(ObjectMessageContext.MESSAGE_INPUT);
            if (!isInputMessage && callback.getWebResult() != null && !hasOutParamReturn) {
                ByteArrayOutputStream outStream = new ByteArrayOutputStream();
                XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
                writer.write(objContext.getReturn(), callback.getWebResultQName(), evtWriter);

                ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
                XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
                CorbaObjectHandler obj = readObjectFromStax(evtReader,
                                                            opElement.getReturn().getIdltype(),
                                                            false);
                CorbaStreamable streamable = new CorbaStreamable(obj, callback.getWebResultQName());
                corbaCtx.getMessage().setStreamableReturn(streamable);
            } else if (isInputMessage && callback.getWebResult() != null && !hasOutParamReturn) {
                QName retName = callback.getWebResultQName();
                QName retIdlType = opElement.getReturn().getIdltype();
                CorbaObjectHandler obj =
                    CorbaHandlerUtils.initializeObjectHandler(orb, retName, retIdlType, typeMaps);
                CorbaStreamable streamable = new CorbaStreamable(obj, retName);
                corbaCtx.getMessage().setStreamableReturn(streamable);
            }
View Full Code Here

                throw new WebServiceException("Unable to create data writer");
            }

            // Get information about the operation being invoked from the WSDL definition.
            // We need this to marshal data correctly
            OperationType opElement =
                CorbaUtils.getCorbaOperationType(callback.getOperationName(), bus, endpointRef);
            if (opElement == null) {
                throw new CorbaBindingException("Unable to find operation definition");
            }

            XMLInputFactory inputFactory = XMLInputFactory.newInstance();
            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
           
            Throwable except = objContext.getException();
            Method faultInfoMethod = except.getClass().getMethod("getFaultInfo");
            Object faultInfo = faultInfoMethod.invoke(except);
            WebFault wfAnnotation = except.getClass().getAnnotation(WebFault.class);
            QName elName = new QName(wfAnnotation.targetNamespace(), except.getClass().getSimpleName());
           
            ByteArrayOutputStream outStream = new ByteArrayOutputStream();
            XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
            writer.write(faultInfo, elName, evtWriter);
           
            QName exIdlType = null;
            List<RaisesType> exList = opElement.getRaises();
            for (Iterator<RaisesType> iter = exList.iterator(); iter.hasNext();) {
                // REVISIT: Note that this assumes that exception names need to be unique.  We should make
                // sure that this is really the case.
                RaisesType raises = iter.next();
                if (raises.getException().getLocalPart().equals(elName.getLocalPart())) {
View Full Code Here

            DataReader<XMLEventReader> reader = callback.createReader(XMLEventReader.class);
            if (reader == null) {
                throw new WebServiceException("Unable to create data reader");
            }

            OperationType opElement =
                CorbaUtils.getCorbaOperationType(callback.getOperationName(), bus, endpointRef);
            if (opElement == null) {
                throw new CorbaBindingException("Unable to find operation definition");
            }

            // We need the list of CORBA parameters to see if we have a single OUT parameter with no
            // return type.  Celtix handles this case a bit differently than everything else
            List<ParamType> params = opElement.getParam();

            // Handle the parameters that are given for the operation
            XMLInputFactory inputFactory = XMLInputFactory.newInstance();
            XMLOutputFactory outputFactory = XMLOutputFactory.newInstance();
            outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
View Full Code Here

TOP

Related Classes of org.apache.schemas.yoko.bindings.corba.OperationType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.