Package org.apache.cxf.binding.corba

Examples of org.apache.cxf.binding.corba.CorbaStreamable


    public void testReadStreamable() {
        QName objName = new QName("object");
        QName objIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "char", CorbaConstants.NP_WSDL_CORBA);
        TypeCode objTypeCode = orb.get_primitive_tc(TCKind.tk_char);
        CorbaPrimitiveHandler obj = new CorbaPrimitiveHandler(objName, objIdlType, objTypeCode, null);
        CorbaStreamable streamable = new CorbaStreamableImpl(obj, objName);
       
        OutputStream oStream = orb.create_output_stream();
        oStream.write_char('c');
       
        InputStream iStream = oStream.create_input_stream();
        streamable._read(iStream);
        CorbaPrimitiveHandler streamableObj = (CorbaPrimitiveHandler)streamable.getObject();
        Object o = streamableObj.getValue();
       
        assertTrue(o instanceof Character);
        Character charValue = (Character)o;
        assertTrue(charValue.charValue() == 'c');
View Full Code Here


        QName objName = new QName("object");
        QName objIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "wstring", CorbaConstants.NP_WSDL_CORBA);
        TypeCode objTypeCode = orb.get_primitive_tc(TCKind.tk_wstring);
        CorbaPrimitiveHandler obj = new CorbaPrimitiveHandler(objName, objIdlType, objTypeCode, null);
        obj.setValueFromData("TestWString");
        CorbaStreamable streamable = new CorbaStreamableImpl(obj, objName);
       
        OutputStream oStream = orb.create_output_stream();
        streamable._write(oStream);
       
        InputStream iStream = oStream.create_input_stream();
        String value = iStream.read_wstring();
        assertEquals("TestWString", value);
    }
View Full Code Here

                // we want to add a wrapper around this so that we can add some more information?
                message.setContent(Exception.class, sysEx);
                return;
            }

            CorbaStreamable exStreamable = message.getStreamableException();
            if (exStreamable != null) {
                DataReader<XMLStreamReader> reader = getDataReader(message);

                BindingOperationInfo bopInfo = message.getExchange().get(BindingOperationInfo.class);
                OperationInfo opInfo = bopInfo.getOperationInfo();
               
                ServiceInfo service = message.getExchange().get(ServiceInfo.class);
               
                org.omg.CORBA.ORB orb = (org.omg.CORBA.ORB) message.get(CorbaConstants.ORB);
                if (orb == null) {
                    orb = message.getExchange().get(org.omg.CORBA.ORB.class);
                }
                QName elName = new QName("", exStreamable.getName());
                FaultInfo fault = getFaultInfo(opInfo, elName);
               
                CorbaTypeEventProducer faultEventProducer =
                    CorbaHandlerUtils.getTypeEventProducer(exStreamable.getObject(),
                                                           service,
                                                           orb);
                CorbaStreamReader streamReader = new CorbaStreamReader(faultEventProducer);

                Object e = reader.read(fault.getMessageParts().get(0), streamReader);
View Full Code Here

        CorbaFaultStreamWriter faultWriter = new CorbaFaultStreamWriter(orb, exType,
                                                message.getCorbaTypeMap(), service);
        writer.write(fault, faultPart, faultWriter);

        CorbaObjectHandler[] objs = faultWriter.getCorbaObjects();     
        CorbaStreamable streamable = message.createStreamableObject(objs[0], elName);
        message.setStreamableException(streamable);
    }
View Full Code Here

        CorbaFaultStreamWriter faultWriter = new CorbaFaultStreamWriter(orb, exType,
                message.getCorbaTypeMap(), service);
        writer.write(fault, faultPart, faultWriter);

        CorbaObjectHandler[] objs = faultWriter.getCorbaObjects();     
        CorbaStreamable streamable = message.createStreamableObject(objs[0], elName);
        message.setStreamableException(streamable);
    }
View Full Code Here

TOP

Related Classes of org.apache.cxf.binding.corba.CorbaStreamable

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.