Bug 779419 - (SOA-1807) HTTP Gateway and URL Query Request Parameters
HTTP Gateway and URL Query Request Parameters
Status: CLOSED NEXTRELEASE
Product: JBoss Enterprise SOA Platform 5
Classification: JBoss
Component: Documentation, JBossESB (Show other bugs)
5.0.0 ER6
Unspecified Unspecified
urgent Severity urgent
: ---
: 5.1.0 GA
Assigned To: Darrin Mison
http://jira.jboss.org/jira/browse/SOA...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2010-01-08 14:14 EST by Burr Sutter
Modified: 2011-02-17 06:12 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-01-27 05:04:41 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


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


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker SOA-1807 None None None Never

  None (edit)
Description Burr Sutter 2010-01-08 14:14:50 EST
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 14:16:00 EST
Attachment: Added: MyFirstESBProject.zip
Comment 2 Burr Sutter 2010-01-08 14:19:29 EST
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 14:25:58 EST
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 14:26:22 EST
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 14:27:15 EST
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 14:45:57 EST
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 14:57:51 EST
It's also in the HttpMessageComposer javadocs
Comment 8 Burr Sutter 2010-01-08 15:20:21 EST
Thanks Kevin! After further testing, I am saying this is a doc bug.   Assigning to Darrin.
Comment 9 Anne-Louise Tangring 2010-09-21 15:05:34 EDT
This is a candidate for SOA 5.1.0
Comment 10 Darrin Mison 2010-12-16 23:17:07 EST
Labels: Added: ESB_Programmers_Guide
Complexity: Added: Medium
Comment 12 Darrin Mison 2011-01-04 19:12:25 EST
Writer: Added: Darrin
Comment 13 Darrin Mison 2011-01-27 01:27:09 EST
Release Notes Docs Status: Added: Not Yet Documented
Comment 14 Darrin Mison 2011-01-27 05:04:41 EST
This was fixed upstream & picked up when updating the product docs.  Will be documented as a docs fix in the release notes
Comment 15 Darrin Mison 2011-02-17 06:12:19 EST
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.