cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <bdelacre...@apache.org>
Subject Re: HTTP POST with XML body
Date Sat, 12 Nov 2005 11:08:18 GMT
Hi Daniel,

Le 11 nov. 05, à 20:54, Daniel Boesswetter a écrit :
> ....None of the Cocoon generators/transformers seemed to do the job 
> (even CInclude has known bugs concerning POST), so I took the 
> WebServiceProxyGenerator (which sounds like a good starting point :) 
> and added the following parameters:

Making this generator more powerful is certainly a good idea!
Many thanks for sharing this here.

> - postbody - any valid Cocoon source URI. The resulting document is 
> sent as the body of the POST request.
> - postbodyenc - the encoding used to serialize the postbody. UTF-8 by 
> default.
> - username and password - used for basic authentication.
> - dropparams - if set to "true" the params from the present request 
> are not passed to the target system (my ERP system was confused by 
> params it didn't expect).

I'm always picky about names so I'll make a few suggestions if you 
don't mind: with the goal of making sitemaps more self-explanatory I'd 
use the following parameter names: post-body, post-body-encoding, 
username, password, drop-request-parameters.

> ...I attached a diff against the 2.1.7 version of 
> WebServiceProxyGenerator. I tested a couple of cases and it seems to 
> solve at least my problems (for now)...

Would it be possible for you to provide some HtmlUnit test cases along 
with your patch, to demonstrate your changes? Having this would help 
make this generator a "first-class citizen" (and you'd be a bit of a 
hero as that block doesn't have automated tests currently ;-)

You can find example of such tests in

   src/blocks/batik/test/htmlunit
   src/blocks/webdav/test/htmlunit
   src/blocks/xsltal/test/htmlunit
   src/test/htmlunit/

they are quite easy to write, you just need to create classes having 
names ending in ...TestCase and put their code under 
src/blocks/proxy/test/htmlunit

To execute the tests use "./build.sh htmlunit-tests" and follow the 
instructions.
Note that I just committed a fix as HtmlUnit tests from blocks were not 
executed, this should be ok now.

-Bertrand




Mime
View raw message