You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "Alec Bickerton (JIRA)" <ji...@apache.org> on 2011/09/20 14:34:09 UTC
[jira] [Created] (COCOON-2315) Generator and CInclude transformer
do not include the request headers of the caller.
Generator and CInclude transformer do not include the request headers of the caller.
------------------------------------------------------------------------------------
Key: COCOON-2315
URL: https://issues.apache.org/jira/browse/COCOON-2315
Project: Cocoon
Issue Type: Bug
Components: * Cocoon Core
Affects Versions: 2.1.9, 2.1.12-dev (Current SVN)
Reporter: Alec Bickerton
When using the file generator or any sub class. The request headers are not propagated to the source.
e.g.
{code}
<map:match pattern="deviceInfo">
<map:generate src="http://deviceMetaService.example.com/lookup.jsp"/>
<map:serialize/>
</map:match>
{code}
The request received by the http://deviceMetaService.example.com/lookup.jsp will not contain the user-agent header of the original request.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (COCOON-2315) Generator and CInclude transformer do
not include the request headers of the caller.
Posted by "Alfred Nathaniel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alfred Nathaniel closed COCOON-2315.
------------------------------------
Resolution: Not A Problem
This is not a bug but a misconception what the file generator does. As the name implies the file generator is most often used to read files, parse them as XML documents and send the SAX events down the pipeline. The src attribute also allows to use other source protocols as drop-in replacement for files.
In the case of http: the file generator creates a GET request to the given webserver. Parameters or headers from the original request invoking the current pipeline are not forwarded.
If you need to formulate customized HTTP requests you should look at http://cocoon.apache.org/2.1/userdocs/wsproxy-generator.html.
> Generator and CInclude transformer do not include the request headers of the caller.
> ------------------------------------------------------------------------------------
>
> Key: COCOON-2315
> URL: https://issues.apache.org/jira/browse/COCOON-2315
> Project: Cocoon
> Issue Type: Bug
> Components: * Cocoon Core
> Affects Versions: 2.1.9, 2.1.12-dev (Current SVN)
> Reporter: Alec Bickerton
>
> When using the file generator or any sub class. The request headers are not propagated to the source.
> e.g.
> {code}
> <map:match pattern="deviceInfo">
> <map:generate src="http://deviceMetaService.example.com/lookup.jsp"/>
> <map:serialize/>
> </map:match>
> {code}
> The request received by the http://deviceMetaService.example.com/lookup.jsp will not contain the user-agent header of the original request.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (COCOON-2315) WebserviceGenerator should allow to
include the request headers of the caller.
Posted by "Alfred Nathaniel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alfred Nathaniel updated COCOON-2315:
-------------------------------------
Summary: WebserviceGenerator should allow to include the request headers of the caller. (was: Generator and CInclude transformer do not include the request headers of the caller.)
That looks as if you expect Cocoon to act as forward proxy. I suggest you send a description of the actual problem to users@cocoon.apache.org.
> WebserviceGenerator should allow to include the request headers of the caller.
> ------------------------------------------------------------------------------
>
> Key: COCOON-2315
> URL: https://issues.apache.org/jira/browse/COCOON-2315
> Project: Cocoon
> Issue Type: Bug
> Components: * Cocoon Core
> Affects Versions: 2.1.9, 2.1.12-dev (Current SVN)
> Reporter: Alec Bickerton
>
> When using the file generator or any sub class. The request headers are not propagated to the source.
> e.g.
> {code}
> <map:match pattern="deviceInfo">
> <map:generate src="http://deviceMetaService.example.com/lookup.jsp"/>
> <map:serialize/>
> </map:match>
> {code}
> The request received by the http://deviceMetaService.example.com/lookup.jsp will not contain the user-agent header of the original request.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Issue Comment Edited] (COCOON-2315) Generator and CInclude
transformer do not include the request headers of the caller.
Posted by "Alec Bickerton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13109344#comment-13109344 ]
Alec Bickerton edited comment on COCOON-2315 at 9/21/11 8:41 AM:
-----------------------------------------------------------------
Please provide more information as simply using the wsproxy does not propagate the request headers to the service located in the src.
After checking the code only the parameters are propagated.
{code}
ArrayList paramList = new ArrayList();
Enumeration enumeration = request.getParameterNames();
while (enumeration.hasMoreElements()) {
String pname = (String)enumeration.nextElement();
String[] paramsForName = request.getParameterValues(pname);
for (int i = 0; i < paramsForName.length; i++) {
NameValuePair pair = new NameValuePair(pname, paramsForName[i]);
paramList.add(pair);
}
}
if (paramList.size() > 0) {
NameValuePair[] allSubmitParams = new NameValuePair[paramList.size()];
paramList.toArray(allSubmitParams);
String urlQryString = method.getQueryString();
// use HttpClient encoding routines
method.setQueryString(allSubmitParams);
String submitQryString = method.getQueryString();
// set final web service query string
// sometimes the querystring is null here...
if (null == urlQryString) {
method.setQueryString(submitQryString);
} else {
method.setQueryString(urlQryString + "&" + submitQryString);
}
} // if there are submit parameters
{code}
was (Author: abickerton_netm):
Please provide more information as simply using the wsproxy does not propagate the request headers to the service located in the src.
After checking the code only the parameters ar propagated.
{code}
ArrayList paramList = new ArrayList();
Enumeration enumeration = request.getParameterNames();
while (enumeration.hasMoreElements()) {
String pname = (String)enumeration.nextElement();
String[] paramsForName = request.getParameterValues(pname);
for (int i = 0; i < paramsForName.length; i++) {
NameValuePair pair = new NameValuePair(pname, paramsForName[i]);
paramList.add(pair);
}
}
if (paramList.size() > 0) {
NameValuePair[] allSubmitParams = new NameValuePair[paramList.size()];
paramList.toArray(allSubmitParams);
String urlQryString = method.getQueryString();
// use HttpClient encoding routines
method.setQueryString(allSubmitParams);
String submitQryString = method.getQueryString();
// set final web service query string
// sometimes the querystring is null here...
if (null == urlQryString) {
method.setQueryString(submitQryString);
} else {
method.setQueryString(urlQryString + "&" + submitQryString);
}
} // if there are submit parameters
{code}
> Generator and CInclude transformer do not include the request headers of the caller.
> ------------------------------------------------------------------------------------
>
> Key: COCOON-2315
> URL: https://issues.apache.org/jira/browse/COCOON-2315
> Project: Cocoon
> Issue Type: Bug
> Components: * Cocoon Core
> Affects Versions: 2.1.9, 2.1.12-dev (Current SVN)
> Reporter: Alec Bickerton
>
> When using the file generator or any sub class. The request headers are not propagated to the source.
> e.g.
> {code}
> <map:match pattern="deviceInfo">
> <map:generate src="http://deviceMetaService.example.com/lookup.jsp"/>
> <map:serialize/>
> </map:match>
> {code}
> The request received by the http://deviceMetaService.example.com/lookup.jsp will not contain the user-agent header of the original request.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Reopened] (COCOON-2315) Generator and CInclude transformer
do not include the request headers of the caller.
Posted by "Alec Bickerton (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/COCOON-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alec Bickerton reopened COCOON-2315:
------------------------------------
Please provide more information as simply using the wsproxy does not propagate the request headers to the service located in the src.
After checking the code only the parameters ar propagated.
{code}
ArrayList paramList = new ArrayList();
Enumeration enumeration = request.getParameterNames();
while (enumeration.hasMoreElements()) {
String pname = (String)enumeration.nextElement();
String[] paramsForName = request.getParameterValues(pname);
for (int i = 0; i < paramsForName.length; i++) {
NameValuePair pair = new NameValuePair(pname, paramsForName[i]);
paramList.add(pair);
}
}
if (paramList.size() > 0) {
NameValuePair[] allSubmitParams = new NameValuePair[paramList.size()];
paramList.toArray(allSubmitParams);
String urlQryString = method.getQueryString();
// use HttpClient encoding routines
method.setQueryString(allSubmitParams);
String submitQryString = method.getQueryString();
// set final web service query string
// sometimes the querystring is null here...
if (null == urlQryString) {
method.setQueryString(submitQryString);
} else {
method.setQueryString(urlQryString + "&" + submitQryString);
}
} // if there are submit parameters
{code}
> Generator and CInclude transformer do not include the request headers of the caller.
> ------------------------------------------------------------------------------------
>
> Key: COCOON-2315
> URL: https://issues.apache.org/jira/browse/COCOON-2315
> Project: Cocoon
> Issue Type: Bug
> Components: * Cocoon Core
> Affects Versions: 2.1.9, 2.1.12-dev (Current SVN)
> Reporter: Alec Bickerton
>
> When using the file generator or any sub class. The request headers are not propagated to the source.
> e.g.
> {code}
> <map:match pattern="deviceInfo">
> <map:generate src="http://deviceMetaService.example.com/lookup.jsp"/>
> <map:serialize/>
> </map:match>
> {code}
> The request received by the http://deviceMetaService.example.com/lookup.jsp will not contain the user-agent header of the original request.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira