Bug 779419 (SOA-1807) - HTTP Gateway and URL Query Request Parameters
Summary: HTTP Gateway and URL Query Request Parameters
Keywords:
Status: CLOSED NEXTRELEASE
Alias: SOA-1807
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Documentation, JBossESB
Version: 5.0.0 ER6
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: ---
: 5.1.0 GA
Assignee: Dana Mison
QA Contact:
URL: http://jira.jboss.org/jira/browse/SOA...
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-01-08 19:14 UTC by Burr Sutter
Modified: 2011-02-17 11:12 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-01-27 10:04:41 UTC
Type: Bug


Attachments (Terms of Use)
MyFirstESBProject.zip (5.66 KB, application/zip)
2010-01-08 19:16 UTC, Burr Sutter
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker SOA-1807 0 None None None Never

Description Burr Sutter 2010-01-08 19:14:50 UTC
Complexity: Medium
Date of First Response: 2010-01-08 14:27:15
project_key: SOA

According to this documentation:

The following line of code should allow me access to the URL query string:
Map params = (Map) message.getProperties().getProperty("RequestParameterMap");

Where my URL is:
http://localhost:8080/MyFirstESBProject/http/hitme?stuff=happens

In this case, params = null

Attached is the project. 

Could be end-user error - not correctly configured in my jboss-esb.xml
Could be doc error

Comment 1 Burr Sutter 2010-01-08 19:16:00 UTC
Attachment: Added: MyFirstESBProject.zip


Comment 2 Burr Sutter 2010-01-08 19:19:29 UTC
The docs also suggest:
Map params = (Map) message.getProperties().getProperty("RequestInfoMap");

It also returns null.

My goal is to get to the "stuff" and "happens" pieces of the URL. 

This is on a HTTP GET.



Comment 3 Burr Sutter 2010-01-08 19:25:58 UTC
The jboss-esb.xml

<?xml version="1.0"?>
<jbossesb parameterReloadSecs="5"
 xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.2.0.xsd">
 <providers>
  <http-provider name="myHTTPProvider">
   <http-bus busid="myHTTPProviderChannel"/>
  </http-provider>
 </providers>
 <services>
  <service category="MyServiceCategory" description="A Description"
   invmScope="GLOBAL" name="MyHTTPService">
   <listeners>
    <http-gateway busidref="myHTTPProviderChannel" name="MyHTTPGateway"
     payloadAs="STRING" urlPattern="hitme"/>
   </listeners>
   <actions mep="RequestResponse">
    <action class="myactions.MyAction" name="myCustomAction2"/>
   </actions>
  </service>
 </services>
</jbossesb>

Comment 4 Burr Sutter 2010-01-08 19:26:22 UTC
The action code:

package myactions;

import java.util.Map;

import org.jboss.soa.esb.actions.AbstractActionLifecycle;
import org.jboss.soa.esb.helpers.ConfigTree;
import org.jboss.soa.esb.message.Message;

public class MyAction extends AbstractActionLifecycle {
	public MyAction(ConfigTree config) {
	}

	public Message process(Message message) {
		String messageString = (String) message.getBody().get();
		// Map params = (Map) message.getProperties().getProperty("RequestParameterMap");
		Map params = (Map) message.getProperties().getProperty("RequestInfoMap");
		System.out.println("Params: " + params);
		System.out.println("Default message body is: " + messageString);
		message.getBody().add("***" + messageString + "***");
		return message;
	}
}

Comment 5 Kevin Conner 2010-01-08 19:27:15 UTC
This looks like it is a documentation error, can you try the following instead?

final HttpRequest httpRequest = HttpRequest getRequest(message) ;
final Map<String, String[]> params = httpRequest.getQueryParams() ;

Does this work for you?

Kev

Comment 6 Burr Sutter 2010-01-08 19:45:57 UTC
I should have put in the link to the docs I am reviewing:
http://documentation-stage.bne.redhat.com/docs/en-US/JBoss_Enterprise_SOA_Platform/5.0.0/html/ESB_Programmers_Guide/ch09s09s04.html

And the following does work:
final HttpRequest httpRequest = HttpRequest.getRequest(message);
final Map<String, String[]> params = httpRequest.getQueryParams() ;
System.out.println("Params: " + params);




Comment 7 Kevin Conner 2010-01-08 19:57:51 UTC
It's also in the HttpMessageComposer javadocs

Comment 8 Burr Sutter 2010-01-08 20:20:21 UTC
Thanks Kevin! After further testing, I am saying this is a doc bug.   Assigning to Darrin.

Comment 9 Anne-Louise Tangring 2010-09-21 19:05:34 UTC
This is a candidate for SOA 5.1.0


Comment 10 Dana Mison 2010-12-17 04:17:07 UTC
Labels: Added: ESB_Programmers_Guide
Complexity: Added: Medium


Comment 12 Dana Mison 2011-01-05 00:12:25 UTC
Writer: Added: Darrin


Comment 13 Dana Mison 2011-01-27 06:27:09 UTC
Release Notes Docs Status: Added: Not Yet Documented


Comment 14 Dana Mison 2011-01-27 10:04:41 UTC
This was fixed upstream & picked up when updating the product docs.  Will be documented as a docs fix in the release notes

Comment 15 Dana Mison 2011-02-17 11:12:19 UTC
Release Notes Docs Status: Removed: Not Yet Documented Added: Not Required



Note You need to log in before you can comment on or make changes to this bug.