Search in sources :

Example 6 with CorbaMessage

use of org.apache.cxf.binding.corba.CorbaMessage in project cxf by apache.

the class CorbaStreamInInterceptor method handleReply.

private void handleReply(Message msg) {
    ORB orb;
    ServiceInfo service;
    CorbaDestination destination;
    if (msg.getDestination() != null) {
        destination = (CorbaDestination) msg.getDestination();
    } else {
        destination = (CorbaDestination) msg.getExchange().getDestination();
    }
    service = destination.getBindingInfo().getService();
    CorbaMessage message = (CorbaMessage) msg;
    if (message.getStreamableException() != null || message.getSystemException() != null) {
        message.setContent(Exception.class, message.getExchange().getOutMessage().getContent(Exception.class));
        Endpoint ep = message.getExchange().getEndpoint();
        message.getInterceptorChain().abort();
        if (ep.getInFaultObserver() != null) {
            ep.getInFaultObserver().onMessage(message);
            return;
        }
    }
    CorbaMessage outMessage = (CorbaMessage) message.getExchange().getOutMessage();
    orb = message.getExchange().get(ORB.class);
    HandlerIterator paramIterator = new HandlerIterator(outMessage, false);
    CorbaTypeEventProducer eventProducer = null;
    Exchange exchange = message.getExchange();
    BindingOperationInfo bindingOpInfo = exchange.getBindingOperationInfo();
    BindingMessageInfo msgInfo = bindingOpInfo.getOutput();
    boolean wrap = false;
    if (bindingOpInfo.isUnwrappedCapable()) {
        wrap = true;
    }
    if (wrap) {
        // wrapper element around our args
        // REVISIT, bravi, message name same as the element name
        QName wrapperElementQName = msgInfo.getMessageInfo().getName();
        eventProducer = new WrappedParameterSequenceEventProducer(wrapperElementQName, paramIterator, service, orb);
    } else {
        eventProducer = new ParameterEventProducer(paramIterator, service, orb);
    }
    CorbaStreamReader reader = new CorbaStreamReader(eventProducer);
    message.setContent(XMLStreamReader.class, reader);
}
Also used : BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) WrappedParameterSequenceEventProducer(org.apache.cxf.binding.corba.types.WrappedParameterSequenceEventProducer) CorbaMessage(org.apache.cxf.binding.corba.CorbaMessage) QName(javax.xml.namespace.QName) HandlerIterator(org.apache.cxf.binding.corba.types.HandlerIterator) CorbaStreamReader(org.apache.cxf.binding.corba.runtime.CorbaStreamReader) ServiceInfo(org.apache.cxf.service.model.ServiceInfo) Exchange(org.apache.cxf.message.Exchange) ParameterEventProducer(org.apache.cxf.binding.corba.types.ParameterEventProducer) CorbaDestination(org.apache.cxf.binding.corba.CorbaDestination) BindingMessageInfo(org.apache.cxf.service.model.BindingMessageInfo) Endpoint(org.apache.cxf.endpoint.Endpoint) CorbaTypeEventProducer(org.apache.cxf.binding.corba.types.CorbaTypeEventProducer) ORB(org.omg.CORBA.ORB)

Example 7 with CorbaMessage

use of org.apache.cxf.binding.corba.CorbaMessage in project cxf by apache.

the class CorbaStreamOutEndingInterceptor method handleMessage.

public void handleMessage(Message msg) {
    CorbaMessage message = (CorbaMessage) msg;
    orb = (org.omg.CORBA.ORB) message.get(CorbaConstants.ORB);
    Exchange exchange = message.getExchange();
    BindingOperationInfo boi = exchange.getBindingOperationInfo();
    service = exchange.getEndpoint().getEndpointInfo().getService();
    typeMap = message.getCorbaTypeMap();
    if (ContextUtils.isRequestor(message)) {
        handleOutBoundMessage(message, boi);
    } else {
        handleInBoundMessage(message, boi);
    }
}
Also used : Exchange(org.apache.cxf.message.Exchange) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) CorbaMessage(org.apache.cxf.binding.corba.CorbaMessage)

Aggregations

CorbaMessage (org.apache.cxf.binding.corba.CorbaMessage)7 BindingOperationInfo (org.apache.cxf.service.model.BindingOperationInfo)7 Exchange (org.apache.cxf.message.Exchange)6 QName (javax.xml.namespace.QName)5 CorbaBindingException (org.apache.cxf.binding.corba.CorbaBindingException)3 CorbaDestination (org.apache.cxf.binding.corba.CorbaDestination)3 CorbaStreamReader (org.apache.cxf.binding.corba.runtime.CorbaStreamReader)3 CorbaTypeEventProducer (org.apache.cxf.binding.corba.types.CorbaTypeEventProducer)3 BindingMessageInfo (org.apache.cxf.service.model.BindingMessageInfo)3 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)3 ORB (org.omg.CORBA.ORB)3 HandlerIterator (org.apache.cxf.binding.corba.types.HandlerIterator)2 ParameterEventProducer (org.apache.cxf.binding.corba.types.ParameterEventProducer)2 WrappedParameterSequenceEventProducer (org.apache.cxf.binding.corba.types.WrappedParameterSequenceEventProducer)2 OperationType (org.apache.cxf.binding.corba.wsdl.OperationType)2 Fault (org.apache.cxf.interceptor.Fault)2 BindingInfo (org.apache.cxf.service.model.BindingInfo)2 OperationInfo (org.apache.cxf.service.model.OperationInfo)2 SystemException (org.omg.CORBA.SystemException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1