cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alec Bickerton (JIRA)" <j...@apache.org>
Subject [jira] [Issue Comment Edited] (COCOON-2315) Generator and CInclude transformer do not include the request headers of the caller.
Date Wed, 21 Sep 2011 08:43:09 GMT

    [ 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

        

Mime
View raw message