My english is not good,and i try my best to describe my
problem.......:working:
:blush:
I just want to implement  a content-based router, 
it's incoming is SOAP,
and it can invoke other webservice  based on different SOAP request.

SO i do it as follows:

using  cxf-bc-consumer to accept SOAP request;
using  camel  to route;
using  xslt to transform the infomation,
using  cxf-bc-provider to invoke  other websercices.

here is a piece of my camel config.

 <route>
        <from uri="jbi:service:http://route/RouteProxy"/>   (0)
        <convertBodyTo type="javax.xml.transform.dom.DOMSource"/>
         <choice> 
         <when>
            <xpath>//tns:routeKey/text() = 'bye'</xpath>  (1)
            <to uri="jbi:service:http://xslt/getCDATA"/>     (2)
            <to  uri="jbi:service:http://xslt/bye"/>             (3)
            <to uri="jbi:service:http://server/ByeWorld"/>    (4)
         </when>
     </choice>
    </route>

(0) is cxf-bc-consumer,it's wsdl  has an operation named FixRoute,and this
operation has two parameters: routeKey --key word used to route
routeContent:real content--in CDATA form.
(1)is an xpath expression with routeKey ;
(2) is an xslt to get CDATA from request;
(3) is an xslt  converting  CDATA  content  to JBI excahge like <jbi
message><jbi part>....
(4)is cxf-bc-provider to invoke  other websercices.

from (0) to (3),all works well. But when It comes to (4),I got an error:
org.apache.cxf.interceptor.Fault: unknown operation {http://route}FixRoute

I turned to the servicemix.log  and found out the reason: after (0), the jbi
exchange's operation name has been set  to {http://route}FixRoute
which was provided in (0)'s wsdl file.

so I add a servicemix-bean before(4),It looks like this:

<xpath>//tns:routeKey/text() = 'bye'</xpath>              (1)
            <to uri="jbi:service:http://xslt/getCDATA"/>     (2)
            <to  uri="jbi:service:http://xslt/bye"/>             (3)
            <to uri="jbi:service:http://server/clearOp"/>      (5)->new
added
            <to uri="jbi:service:http://server/ByeWorld"/>    (4)


the bean's code like this:
public class clearOperation implements MessageExchangeListener {
    
    @Resource
    DeliveryChannel channel;
    
    public void onMessageExchange(MessageExchange exchange) throws
MessagingException {
        
         if (exchange.getStatus() == ExchangeStatus.ACTIVE) {
            NormalizedMessage message = exchange.getMessage("in");
                                                exchange.setMessage(message, 
"out");
                                                exchange.setOperation(new 
QName("null"));
                                                channel.send(exchange);
        }
    }
}

I simply set the exchange's Operationname to "null".

The bean also works well, I can find the result in servicemix.log
-----------------------------------------
id: ID:192.168.1.108-121bdc40494-3:73
  status: Done
  role: provider
  service: {http://server}clearOp
  endpoint: clearOp
  operation: null
----------------------------------------
But camel did not send the whole exchange to (4), It seems only send the
exchange's "out" to (4) ,and the operationname still keeps the old one
:"{http://route}FixRoute",so I still got the same error!!


------------------------------------------------------------
11:14:47,828 | DEBUG | pool-flow.seda.servicemix-cxf-se-thread-3 |
CxfSeComponent           | emix.common.AsyncBaseLifeCycle  534 | Received
exchange: status: Active, role: provider
11:14:47,843 | DEBUG | pool-flow.seda.servicemix-cxf-se-thread-3 |
CxfSeComponent           | emix.common.AsyncBaseLifeCycle  596 | Retrieved
correlation id: ID:192.168.1.108-121bdc40494-4:2
11:14:47,921 | DEBUG | pool-flow.seda.servicemix-cxf-se-thread-3 |
DeliveryChannelImpl      | .messaging.DeliveryChannelImpl  425 | Send
ID:192.168.1.108-121bdc40494-3:77 in DeliveryChannel{servicemix-cxf-se}
11:14:47,937 | DEBUG | pool-flow.seda.servicemix-cxf-se-thread-3 |
SecuredBroker            | mix.jbi.security.SecuredBroker   66 | send
exchange with secure broker
11:14:47,937 | DEBUG | pool-flow.seda.servicemix-cxf-se-thread-3 | SedaFlow     
           
| emix.jbi.nmr.flow.AbstractFlow  118 | Called Flow send
11:14:47,937 | DEBUG | pool-flow.seda.servicemix-cxf-se-thread-4 | SedaQueue    
           
| .jbi.nmr.flow.seda.SedaQueue$1  132 |
org.apache.servicemix.jbi.nmr.flow.seda.sedaqueu...@dd5d08 dequeued
exchange: InOut[
  id: ID:192.168.1.108-121bdc40494-3:77
  status: Error
  role: consumer
  interface: {http://server}ByePort
  service: {http://server}ByeWorld
  endpoint: ByeImplPort
  operation: {http://route}FixRoute
  in: <?xml version="1.0" encoding="UTF-8"?><jbi:message
xmlns:jbi="http://java.sun.com/xml/ns/jbi/wsdl-11-wrapper";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; name="sayByeRequest"
type="msg:sayByeRequest" version="1.0"><jbi:part><tns:sayBye
xmlns:tns="http://server";><tns:in0/></tns:sayBye></jbi:part></jbi:message>
  error: org.apache.cxf.interceptor.Fault: unknown operation
{http://route}FixRoute
]
---------------------------------------------------------

How to change an exchange's operationName wthin came?
 
Thanks very much!

-- 
View this message in context: 
http://www.nabble.com/How-to-change-an-exchange%27s-operationName-wthin-came--tp23918517p23918517.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Reply via email to