Another suggestion is to leverage sample language's OGNL support (http://camel.apache.org/simple.html) which is pretty cool. I haven't tried it myself tho.
For example in PAYLOAD mode, you can get ... the second SOAP message part by simple("${body.body[1]}") the third SOAP header by simple("${body.headers[2]") In all cases, an Element is returned but you can easily convert it to a string if you like. On 12/14/2010 10:09 AM, William Tam wrote: > > On 12/14/2010 08:51 AM, ext2 wrote: >> Hi: >> >> The cxf component (payload model)will wrapped the soap message in a >> CXFPayLoad or a CXFMessage. Both are not advantage for camel's script >> language to access headers and body xml。 >> I cannot use a simple expression etc: simple language or xpath >> language to access the soap header. That means I must always write a java >> program to query the soap xml even for a very simple usage; > You can try MESSAGE mode. You will get the entire SOAP message in one > XML. CxfPayload gives you access to individual header or body part as a > Element and you don't have to parse the SOAP message. In MESSAGE mode, > you get to parse the SOAP message which sounds like what you want. > >> I am not sure why the camel's cxf component doesn't map soap header >> to message header,soap body to message body. > Camel message header is used by transport header and other Camel > "internal" header. If you jam the SOAP header in there, not only it can > create a mess. How can other components tell it is not a "transport" > header but it is a header of your SOAP message? If you think about it, > the SOAP header is really a part of the a SOAP message which is the > payload of Camel message. Also, the Camel header would be propagated as > protocol" header such as HTTP unless it is filtered out. > >> If so , the end user can use camel as mediator for Web Service >> more simply; >> > That may be true if Camel has only one component - camel-cxf. >> Thanks for suggestion >> >> >>