| Summary: | HTTP Gateway and URL Query Request Parameters | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise SOA Platform 5 | Reporter: | Burr Sutter <burr.sutter> | ||||
| Component: | Documentation, JBossESB | Assignee: | Dana Mison <dmison> | ||||
| Status: | CLOSED NEXTRELEASE | QA Contact: | |||||
| Severity: | urgent | Docs Contact: | |||||
| Priority: | urgent | ||||||
| Version: | 5.0.0 ER6 | ||||||
| Target Milestone: | --- | ||||||
| Target Release: | 5.1.0 GA | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| URL: | http://jira.jboss.org/jira/browse/SOA-1807 | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2011-01-27 10:04:41 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Attachments: |
|
||||||
Attachment: Added: MyFirstESBProject.zip 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.
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> 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;
}
}
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 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); It's also in the HttpMessageComposer javadocs Thanks Kevin! After further testing, I am saying this is a doc bug. Assigning to Darrin. This is a candidate for SOA 5.1.0 Labels: Added: ESB_Programmers_Guide Complexity: Added: Medium Writer: Added: Darrin Release Notes Docs Status: Added: Not Yet Documented This was fixed upstream & picked up when updating the product docs. Will be documented as a docs fix in the release notes Release Notes Docs Status: Removed: Not Yet Documented Added: Not Required |
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