camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: how to return a valid answer in a spring-ws consumer route (spring dsl)
Date Fri, 19 Jun 2015 06:15:29 GMT
Hi

When use getOut on an exchange then please read this FAQ
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html

On Thu, Jun 18, 2015 at 10:47 PM, Ronny Aerts <ronny.aerts@intris.be> wrote:
> Hello camel community,
>
> I'am trying to figure out how I can return a simple answer in spring-ws soap web service
consumer.
>
> I have a simple route like:
> <bean id="endpointMapping" class="org.apache.camel.component.spring.ws.bean.CamelEndpointMapping"
/>
>
> <route id="tris.apcs.pcm.callback.notifyMessages.route">
>                <description>webservice implementation to capture the notifyMessages</description>
>                <from uri="spring-ws://rootqname:{http://portcommunity.haven.antwerpen.be/}notifyMessages?endpointMapping=#endpointMapping"
/>
>                <to uri="language://javascript:classpath:TRIS/apcs/pcm/wrap-in-notifyMessagesResponse.js?transform=false"/>
> </route>
>
> My route is called without any problem but it returns only http 200 ok response and the
soap is empty (Content-Length: 0). The wrap-in-notifyMessagesResponse.js creates an xml and
outputs it in the "out" of the exchange.
> var dbf = javax.xml.parsers.DocumentBuilderFactory.newInstance();
> var db = dbf.newDocumentBuilder();
> var output = db.newDocument();
> var root = output.appendChild(output.createElementNS("http://portcommunity.haven.antwerpen.be/",
"por:notifyMessagesResponse"));
>
> request.setBody(output);
> exchange.getOut().setBody(output);
>
> I have to remark that I can also use spring dsl and not java code!
>
> Can someone please point me in the direction of producing valid soap output.
> --
> vriendelijke groeten,
> Ronny Aerts<mailto:ronny.aerts@intris.be> - Intris nv - Wapenstilstandlaan 47,
2600 Berchem, Belgiƫ
> R&D Integration Architect
> Prince II<http://nl.wikipedia.org/wiki/PRINCE2> certified - ITIL<http://nl.wikipedia.org/wiki/Information_Technology_Infrastructure_Library>
certified
> Tel: +32-3-326.50.75
>
> Intris nv
> Wapenstilstandlaan 47
> B-2600 Berchem  Tel.  +32 3 326 50 75
> Fax  +32 3 326 42 23
> www.intris.be<http://www.intris.be/>    [http://www.intris.be/mail/AEO_Sticker_108pxRGB.jpg]
<http://www.intris.be>
>
> DISCLAIMER
> This is an e-mail from Intris. The information contained in this communication is intended
solely for use by the individual or entity to whom it is addressed.
> Use of this communication by others is prohibited. If the e-mail message was sent to
you by mistake, please notify support@intris.be<mailto:support@intris.be>, destroy it
without reading, using, copying or disclosing its contents to any other person.
> We accept no liability for damage related to data and/or documents which are communicated
by electronic mail.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/

Mime
View raw message