camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antb59 <ant...@gmail.com>
Subject Re: Http bridgeEndpoint to proxy a distant server
Date Fri, 10 Oct 2014 11:06:16 GMT
Hello,

After checks, it seems that the trace you mentionned is not an error.

If I do a simple proxy just like in this example :
http://camel.apache.org/how-to-use-camel-as-a-http-proxy-between-a-client-and-server.html

	<route id="Identification">
		<from uri="restlet:/identification?restletMethod=POST" />
		<to uri="http://localhost:8012/identification.xml?bridgeEndpoint=true" />
	</route>

The trace you mentionned is present in DEBUG. In this case the http request
is correctly processed and the restlet returns the result to the user.


The fact is I don't manage to manipulate the distant server response.

The following configuration works :

	<route id="Identification">
		<from uri="restlet:/identification?restletMethod=POST" />
		<to uri="http://localhost:8012/identification.xml?bridgeEndpoint=true" />
		<convertBodyTo type="java.lang.String"/>
	</route>

=> return of restlet : 
<?xml version="1.0" encoding="iso-8859-1"?><identificationResponse
status="0" />

The following configuration doesn't work :

	<route id="Identification">
		<from uri="restlet:/identification?restletMethod=POST" />
		<to uri="http://localhost:8012/identification.xml?bridgeEndpoint=true" />
		<convertBodyTo type="java.lang.String"/>
		<marshal ref="xmljson" />
	</route>

=> No return from restlet, the response is hanging until timeout

With the following route, the result seems to be truncated :

	<route id="Identification">
		<from uri="restlet:/identification?restletMethod=POST" />
		<to uri="http://localhost:8012/identification.xml?bridgeEndpoint=true" />
		<transform>
			<simple>Test : ${bodyAs(String)}</simple>
		</transform>
	</route>

=> Return from the restlet :
Test : <?xml version="1.0" encoding="iso-8859-1"?><identificationResponse
statu

The end of the response seems to be truncated.

Maybe my problem is linked to InputStream return by the distant server ?
How can I solve this using only DSL ?

Regards,
Antoine.




--
View this message in context: http://camel.465427.n5.nabble.com/Http-bridgeEndpoint-to-proxy-a-distant-server-tp5757448p5757474.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message