-
1. extracting http header from esb message?
tfennelly May 13, 2011 4:37 AM (in response to sbutt)Are you using the <http:gateway> ? If so, see the HttpGateway docs re getting request info. There you'll see how to get the HttpRequest instance from the ESB message and then from the HttpRequest you can get the list of HttpHeaders.
-
2. extracting http header from esb message?
sbutt May 13, 2011 6:01 AM (in response to tfennelly)Thanks Tom for the info. For a bit inside to my problem, you can have a look here in another thread: http://community.jboss.org/thread/166625?tstart=0
I am using HttpRouter action and haven't used http gateway before. I am now going to look into the docs you have given reference too. May be if you could provide me with some small code snippet example that would be great.
Thanks again! much appreciated.
-
3. extracting http header from esb message?
sbutt May 13, 2011 8:21 AM (in response to tfennelly)hi tom,
this is how i am trying to do as per your suggestion:
<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd" parameterReloadSecs="5">
...
...
<service>
...
<action name="NextServiceRouter" class="org.jboss.soa.esb.actions.StaticRouter">
<property name="destinations">
<route-to service-category="YpsilonService" service-name="Router"/>
</property>
</action>
...
</service>
<service category="YpsilonService" name="Router" description="" invmScope="GLOBAL">
<listeners>
<http-gateway name="Http"/>
</listeners>
<actions mep="RequestResponse">
<!-- Service Aactions.... -->
<action name="httpClient" class="com.traveltainment.integra.middleware.ypsilon.httpClient.httpClientRouter"/>
</actions>
</service>
And the httpClientRouter class
public class httpClientRouter implements ActionLifecycle
{
...
..
..
public Message process(final Message message)
{
try
{
System.out.println("****************************************");
HttpRequest requestInfo = HttpRequest.getRequest(message);
}
..
}}
But in my class above, I could not able to make an instance of class HttpRequest to proceed further?
I am getting compilation error. The HttpRequest is not found.
Do I need to add some common library in my POM?
Pls help.
-
4. extracting http header from esb message?
sbutt May 13, 2011 9:43 AM (in response to sbutt)Hi tom,
A bit of more success, earlier i was using jbossesb 4.4 and hence couldnt find HttpRequest class, but now i have upgraded to 4.8.
Now in my httpRequest object, i need to set the following headers:
POST / HTTP/1.1\r
accept: application/xml\r
accept-encoding: gzip\r
transfer-encoding: identity\r
api-version: 3.2\r
accessmode: conso\r
accessid: conso_id agent_id\r
authmode: pwd\r
session: \r
authorization: Basic dGVzdHVzZXI6bXlzZWNyZXQ=\r
connection: close\r
content-Length: \r\n\r\n
Could you help me set that ?