[ https://issues.apache.org/jira/browse/CAMEL-3504?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12978724#action_12978724 ]
Charles Moulliard commented on CAMEL-3504: ------------------------------------------ I have made the modification suggested but it fails on Apache ServiceMix {code} public String generateSoapMessageXQuery(@XQuery("//payload") Document payload, TypeConverter converter) { String xml = converter.convertTo(String.class, payload); LOGGER.log(Level.INFO, "Exchange received : " + xml); return xml; } {code} result {code} Exchange received : <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:prox="http://proxy.choregie.fr"> <soapenv:Header/> <soapenv:Body> <prox:getServiceFromBus> <serviceName>service1</serviceName> <payload> <prox:getDocumentById> <prox:documentId> <id>123</id> </prox:documentId> </prox:getDocumentById> </payload> </prox:getServiceFromBus> </soapenv:Body> </soapenv:Envelope> {code} > Annotation @XQuery does not work in POJO > ----------------------------------------- > > Key: CAMEL-3504 > URL: https://issues.apache.org/jira/browse/CAMEL-3504 > Project: Camel > Issue Type: Bug > Components: camel-saxon > Affects Versions: 2.4.0 > Reporter: Charles Moulliard > Assignee: Claus Ibsen > Priority: Minor > Fix For: 2.6.0 > > > When we try to extract content from XML using a XQuery annotation in the > method signature, we receive the full XML message and not the content defined > by the XQuery expression > 1) camel route > {code} > <camelContext trace="true" xmlns="http://camel.apache.org/schema/spring"> > <route> > <from uri="cxf:bean:busServicesFinder?dataFormat=MESSAGE"/> > <convertBodyTo type="String"/> > <log message="WebService called" loggingLevel="INFO"/> > <choice> > <when> > <xpath>//serviceName = 'service1'</xpath> > <log message="Service = service1" loggingLevel="INFO"/> > <bean ref="soapBean"/> > </when> > <otherwise> > <log message="Service not equal to service1" > loggingLevel="INFO"/> > </otherwise> > </choice> > <log message="Reply to client" loggingLevel="INFO"/> > <transform> > <simple>OK</simple> > </transform> > </route> > </camelContext> > {code} > 2) POJO > public String generateSoapMessage(@XQuery("//payload") String payload) > 3) XML received > {code} > <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" > xmlns:prox="http://proxy.client.fr"> > <soapenv:Header/> > <soapenv:Body> > <prox:getServiceFromBus> > <serviceName>service1</serviceName> > <payload> > <inputReportIncident> > <incidentId>01</incidentId> > <incidentDate>2010-10-04</incidentDate> > <givenName>Charles</givenName> > <familyName>Moulliard</familyName> > <summary>This is a test repart</summary> > <details>server is down</details> > <email>cmoulli...@fusesource.com</email> > <phone>+32 473 604 014</phone> > </inputReportIncident> > </payload> > </prox:getServiceFromBus> > </soapenv:Body> > </soapenv:Envelope> > {code} -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.