Package org.apache.cxf.message

Examples of org.apache.cxf.message.Exchange


        unmarshaller.unmarshal(headerElement, clz);
        EasyMock.expectLastCall().andReturn(jaxbElement);
    }

    private void setUpOutbound(Message message, boolean outbound) {
        Exchange exchange = new ExchangeImpl();
        exchange.setOutMessage(outbound ? message : new MessageImpl());
        message.setExchange(exchange);
    }
View Full Code Here


   
   
    public void testgetDataWriter() throws Exception {
        CorbaOutInterceptor outInterceptor = new CorbaOutInterceptor();       
        CorbaMessage message = control.createMock(CorbaMessage.class);
        Exchange exchange = control.createMock(Exchange.class);
        Service service = control.createMock(Service.class);
        DataBinding databinding = control.createMock(DataBinding.class);       
       
        EasyMock.expect(message.getExchange()).andReturn(exchange);
        EasyMock.expect(ServiceModelUtil.getService(exchange)).andReturn(service);
View Full Code Here

    
                        faultOccurred = true;
                                           
                        StringBuilder description = new StringBuilder();
                        if (message.getExchange() != null) {
                            Exchange exchange = message.getExchange();
                            Service service = exchange.get(Service.class);
                            if (service != null) {
                                description.append('\'');
                                description.append(service.getName());
                                OperationInfo opInfo = exchange.get(OperationInfo.class);
                                if (opInfo != null) {
                                    description.append("#").append(opInfo.getName());
                                }
                                description.append("\' ");
                            }
View Full Code Here

    public void handleMessage(Message msg) {
        try {
            CorbaMessage message = (CorbaMessage) msg;
            orb = (org.omg.CORBA.ORB) message.get(CorbaConstants.ORB);
            corbaStaxObject = new CorbaStaxObject(orb);
            Exchange exchange = message.getExchange();
            typeMaps = new ArrayList<CorbaTypeMap>();

            service = exchange.get(ServiceInfo.class);
            List<TypeMappingType> corbaTypes = service.getDescription().getExtensors(TypeMappingType.class);
            if (corbaTypes != null) {
                CorbaUtils.createCorbaTypeMap(typeMaps, corbaTypes);
                corbaStaxObject.setTypeMaps(typeMaps);
                corbaStaxObject.setServiceInfo(service);
            }       
            getXMLOutputFactory().setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);

            // TODO: where does encoding constant go?
            //String encoding = (String)message.get("Encoding");           
            BindingOperationInfo boi = exchange.get(BindingOperationInfo.class);
       
            if (ContextUtils.isRequestor(message)) {
                handleOutBoundMessage(message, boi);
            } else {
                handleInBoundMessage(message, boi);
View Full Code Here

        Method m = CorbaConduit.class.getDeclaredMethod("buildRequest",
            new Class[] {CorbaMessage.class, OperationType.class});
        CorbaConduit conduit = EasyMock.createMock(CorbaConduit.class, new Method[] {m});      
       
        CorbaMessage msg = control.createMock(CorbaMessage.class);
        Exchange exg = control.createMock(Exchange.class);
        EasyMock.expect(msg.getExchange()).andReturn(exg);
        BindingOperationInfo bopInfo = control.createMock(BindingOperationInfo.class);
        EasyMock.expect(exg.get(BindingOperationInfo.class)).andReturn(bopInfo);
        OperationType opType = control.createMock(OperationType.class);
        bopInfo.getExtensor(OperationType.class);
        EasyMock.expectLastCall().andReturn(opType);
        conduit.buildRequest(msg, opType);
        EasyMock.expectLastCall();
View Full Code Here

    }
   
    public void testBuildRequest() throws Exception {
        CorbaConduit conduit = setupCorbaConduit(false);           
        CorbaMessage message = control.createMock(CorbaMessage.class);
        Exchange exchange = control.createMock(Exchange.class);
        EasyMock.expect(message.getExchange());
        EasyMock.expectLastCall().andReturn(exchange);       
        ServiceInfo service = control.createMock(ServiceInfo.class);
        EasyMock.expect(exchange.get(ServiceInfo.class)).andReturn(service);
        List<CorbaTypeMap> list = control.createMock(List.class);
        List<CorbaTypeMap> typeMaps = control.createMock(List.class);
        EasyMock.expect(service.getExtensors(CorbaTypeMap.class)).andReturn(list);               
       
        OperationType opType = control.createMock(OperationType.class);
View Full Code Here

        CorbaDestination destination = control.createMock(CorbaDestination.class);
        BindingInfo bInfo = control.createMock(BindingInfo.class);
        ServiceInfo sInfo = control.createMock(ServiceInfo.class);
        DescriptionInfo dInfo = control.createMock(DescriptionInfo.class)
        EasyMock.expect(msg.getDestination()).andReturn(null);
        Exchange exchange = control.createMock(Exchange.class);
        EasyMock.expect(msg.getExchange()).andReturn(exchange);
        EasyMock.expect(exchange.getDestination()).andReturn(destination);       
        EasyMock.expect(destination.getBindingInfo()).andReturn(bInfo);
        EasyMock.expect(bInfo.getService()).andReturn(sInfo);
        EasyMock.expect(dInfo.getExtensors(TypeMappingType.class)).andReturn(null);
        EasyMock.expect(sInfo.getDescription()).andReturn(dInfo);
        EasyMock.expect(msg.containsKey(Message.REQUESTOR_ROLE)).andReturn(true);
View Full Code Here

        EasyMock.expect(destination.getEndPointInfo()).andReturn(endpointInfo);               
        QName qname = new QName("" , "Test", "");
        EasyMock.expect(bInfo.getOperation(qname)).andReturn(bopInfo);
        EasyMock.expect(bopInfo.getOperationInfo()).andReturn(opInfo);                       
        CorbaMessage message = control.createMock(CorbaMessage.class);
        Exchange exchange = control.createMock(Exchange.class);
        EndpointReferenceType etype = control.createMock(EndpointReferenceType.class);
        MessageInfo mInfo = control.createMock(MessageInfo.class);
        EasyMock.expect(message.getExchange()).andReturn(exchange);     
        EasyMock.expect(destination.getAddress()).andReturn(etype);
        EasyMock.expect(opInfo.getInput()).andReturn(mInfo);
        exchange.setInMessage(message);
        EasyMock.expectLastCall();       
        OperationType opType = control.createMock(OperationType.class);
        List<ParamType> paramTypes = control.createMock(List.class);
        EasyMock.expect(opType.getParam()).andReturn(paramTypes);
        EasyMock.expect(paramTypes.size()).andReturn(0);
View Full Code Here

        OperationType opType = null;
        BindingInfo bInfo = destination.getBindingInfo();             
        InterfaceInfo info = bInfo.getInterface();       
        EventDataReader reader = (EventDataReader) ContextUtils.getDataReader(message);
        
        Exchange exchange = message.getExchange();
        orb = (ORB)exchange.get(ORB.class);
        if (corbaStaxObject != null) {
            corbaStaxObject.setOrb(orb);
        } else {
            corbaStaxObject = new CorbaStaxObject(orb);
        }

        String opName = message.getExchange().get(String.class);
        Iterator i = bInfo.getOperations().iterator();

        BindingOperationInfo bopInfo = null;
        while (i.hasNext()) {
            bopInfo = (BindingOperationInfo)i.next();
            if (bopInfo.getName().getLocalPart().equals(opName)) {
                opType = bopInfo.getExtensor(OperationType.class);
                opQName = bopInfo.getName();
                break;
            }
        }
        ServerRequest request = exchange.get(ServerRequest.class);
        NVList list = prepareArguments(message, destination, info, opType, opQName);
        request.arguments(list);
        message.setList(list);           
   
        OperationInfo opInfo = processWrappedOperation(bopInfo, false);
View Full Code Here

        EventDataReader reader;
        reader = (EventDataReader) ContextUtils.getDataReader(message);
        BindingInfo bInfo = destination.getBindingInfo();             
        InterfaceInfo info = bInfo.getInterface();
       
        Exchange exchange = message.getExchange();
        BindingOperationInfo bopInfo = exchange.get(BindingOperationInfo.class);

        // Handle the parameters that are given for the operation
        List<ParamType> paramTypes = null;    
        ArgType argType = null;
       
        if (opType != null) {
            paramTypes = opType.getParam();    
            argType = opType.getReturn();
        }
        CorbaMessage outMessage = (CorbaMessage)exchange.getOutMessage();
       
        opType = bopInfo.getExtensor(OperationType.class);

        OperationInfo opInfo = processWrappedOperation(bopInfo, true);
View Full Code Here

TOP

Related Classes of org.apache.cxf.message.Exchange

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.