cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Collen <colle...@umn.edu>
Subject Re: wsproxy and request parameters
Date Mon, 22 Sep 2003 18:06:30 GMT
Jeff Ramsdale wrote:

<snip/>

> It hadn't occured to me that this was a problem with wsproxy. I just thought
> I needed to do something to convert the format. But then I realized that I
> had to manually change my all my "&"s to "&amp;"s. Which format should the
> user be expected to use for the src attribute of the generator? It seems to
> me the more human-readable form makes the most sense, with encoding
> happening in the wsproxy.


Jeff,

Could you try the following test and tell me if you get search results?

In your sitemap (Note the YOUR_AMAZON_KEY in the global-variables):

<map:pipelines>

<map:component-configurations>
   <global-variables>
       <amazon-key>YOUR_AMAZON_KEY</amazon-key>
   </global-variables>
</map:component-configurations>

<map:pipeline>
  <map:match pattern="*.html">
   <map:read src="{1}.html" mime-type="text/html"/>
  </map:match>

  <map:match pattern="actorSearch">
   <map:generate type="wsproxy" 
src="http://xml.amazon.com/onca/xml3?t=webservices-20&amp;dev-t={global:amazon-key}&amp;&amp;mode=vhs&amp;type=lite&amp;page=1&amp;f=xml"/>
   <map:serialize type="xml"/>
  </map:match>

</map:pipeline>

</map:pipelines>



And then use the following form.html file:

<html><body>
<form method="post" action="actorSearch">
     <input type="text" name="ActorSearch" />
     <input type="submit"/>
</form>
</body></html>

I think what is happening in your example is that when you use {request-param:actor}, that
is being 
decoded by the RequestParameterInputModule, and is therefore being sent unencoded to Amazon
(I could 
be wrong on this). The WSProxy automatically sends all request parameters which were sent
from the 
original form, so if you have a field called "ActorSearch" in your field, the WSProxy will
also send 
ActorSearch=foo to the remote service.

This is nice, but it's not always useful if you don't want to use Amazon's form field names,
so I 
can see why you might have wanted to use the different input name in your form.   AFAIK, it's
up to 
the "sender" of the URL to make sure that request parameter names and values are URL-encoded,
so I 
am debating whether this might warrant an input module which performs URL encoding.

Thoughts?

Regards,

Tony


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message