Back Forum Reply New

from gateway example

Hello,
Could anybody show me an example usin SI for the following case:
- app. is listen to from request;
-- a request comes in REST style;
- app. respond back ;
-- a response contains the data in JSON format.
Appreciate you help

Have you looked at Spring Integration samples?
You can get more info here: 2010/09...ation-samples/

There is a sample called multipart-from which is very close to what you are looking for.

Of cause, I did, especially on multipart-from.

The example uses inbound channel adapter. Is it possible to implement the same by fromRequestHandlingMessagingGateway
or fromRequestHandlingController ?

All I am saying is substitute adapters with gateways. Have you tried it?
I'll make an additional example for it, but you don't have to wait. Just give it a shot.

I just posted a new sample which is a simple echo service which uses both inbound and outbound from gateways
spring-i...ter/basic/from

Let me know if that helps

I did not found org..integration.samples.from.DemoH  ttpClient
Than I ran the sample via mvn jetty:run, made the call via browser and got following. Looks like it works (more or less) but how to set correct properties in the request (Content-Type: charset=UTF-8)?Code:
Problem accessing /from/receiveGateway. Reason:
   *

Caused by:

java.nio.charset.IllegalCharsetNameException: *
at java.nio.charset.Charset.checkName(Unknown Source)
at java.nio.charset.Charset.lookup2(Unknown Source)
at java.nio.charset.Charset.lookup(Unknown Source)
at java.nio.charset.Charset.forName(Unknown Source)
at org..from.fromHeaders.getAcceptCharset(fromHeaders.java:184)
at org..integration.from.support.DefaultfromHeaderMapper.getfromHeader(DefaultfromHeaderMapper.java:665)
at org..integration.from.support.DefaultfromHeaderMapper.toHeaders(DefaultfromHeaderMapper.java:292)
at org..integration.from.support.DefaultfromHeaderMapper.toHeaders(DefaultfromHeaderMapper.java:50)
at org..integration.from.inbound.fromRequestHandlingEndpointSupport.doHandleRequest(fromRequestHandlingEndpointSupport.java:260)
at org..integration.from.inbound.fromRequestHandlingMessagingGateway.handleRequest(fromRequestHandlingMessagingGateway.java:91)
at org..web.servlet.mvc.fromRequestHandlerAdapter.handle(fromRequestHandlerAdapter.java:49)
at org..web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)
at org..web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)
at org..web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)
at org..web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:549)
at javax.servlet.from.fromServlet.service(fromServlet.java:707)
at javax.servlet.from.fromServlet.service(fromServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.fromConnection.handleRequest(fromConnection.java:542)
at org.mortbay.jetty.fromConnection$RequestHandler.headerComplete(fromConnection.java:928)
at org.mortbay.jetty.fromParser.parseNext(fromParser.java:549)
at org.mortbay.jetty.fromParser.parseAvailable(fromParser.java:212)
at org.mortbay.jetty.fromConnection.handle(fromConnection.java:404)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:410)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)Sorry its org..integration.samples.from.fromC  lientDemo. I just fixed the readme.
And no, it will not work from the browser. You must invoke it through the client which is from Outboud Gateway.
¥
Back Forum Reply New