soap
  • cxf
  • apache-camel
  • 2012-12-19 55 views 2 likes 
    2

    我試圖從CXF端點檢索SOAP消息,然後將其發送到基於內容的路由器,該路由器以XML文件的形式路由到目錄。基於駱駝內容的路由器XPath空soap返回

    這是我的駱駝上下文路徑:

    <route> 
        <from uri="cxf:bean:reportIncident?dataFormat=MESSAGE"/> 
        <choice> 
         <when> 
          <xpath>/*/*/*[local-name()='inputReportIncident']/*[local-name()='familyName']='Holt'</xpath> 
          <to uri="file:target/messages/contentbasedrouting/a?fileName=a.xml"/> 
         </when> 
         <otherwise> 
          <to uri="file:target/messages/contentbasedrouting/otherwise?fileName=otherwise.xml"/> 
         </otherwise> 
        </choice> 
    </route> 
    

    基於內容的路由器工作正常,但它發出了一個空白的XML文件的目錄,我的SOAP消息已經一去不復返了。

    如果我從一個目錄而不是CXF端點拿起SOAP消息,它可以正常工作。如果我這樣做:

    <from uri="file:target/messages/incoming"/> 
    

    相反的:

    <from uri="cxf:bean:reportIncident?dataFormat=MESSAGE"/> 
    

    任何想法,爲什麼?

    謝謝

    +2

    好吧,我想出了爲什麼。流類型只能讀取一次。爲了能夠多次處理消息內容,該流需要被緩存。爲此,請將streamCache =「true」添加到。有關更多信息,請參閱http://camel.apache.org/stream-caching.html。 – Graham

    回答

    1

    是的,它的應有的流。看到這個FAQ:http://camel.apache.org/why-is-my-message-body-empty.html

    相關問題