cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Johann Bertscheit <>
Subject How to transform URL-parameters and XML-input into a XML-DOM structure in a Cocoon 1.5 producer?
Date Wed, 29 Dec 1999 11:23:40 GMT
Hi cocoon-fans,

I try to use cocoon as a pure XML-Framework for B2B communication.
In order to achieve this it is neccsessary to transform user input (in
form of URL / XML - data) to internal XML.

I have the following problem with cocoon 1.5:
I want to write a producer with the following semantics:

the producer should transform:
1.) URL-parameters into a XML-DOM structure (the simple case - the URL
can be accessed with HttpServletRequest request.getQueryString)
2.) XML-input (from the http-request) into a XML-DOM structure:
(the more difficult case:
- how to get the type of input (the Content-type) and if it is of type
- how to get the whole POSTed XML-input into a string?
- is it possible to access non normal POSTs (a normal browser POST would
be of Content-type: application/x-www-form-urlencoded - that is not the
case here: I have Content-type: text/xml)

How to achieve this?
Does anyone had the same problem and already has such kind of producer?
I havn't found a predefined producer for this purpose.

{I tried to use the new Cocoon-Producer  "ProducerFromRequest" but it
dont works in the cocoon 1.5 environment:
java.lang.IllegalStateException: Already called getInputStream

Does someone know what the problem is here?}

I know that I must access HttpServletRequest but maybe someone has
already sample code for this purpose.

To be more specific here an example of what I want to implement:

- It sould be possible to send the following pure-URL request to sent to

{ echo 'GET /invoke/PriceData?matno=BNX:3000N&ifa=34352542&qty=1
HTTP/1.0'; echo ''; sleep 1;} | telnet cocoon-host 4444

this should be mapped by the producer to a XML-Structure:


- It sould be possible to send the following pure-XML request (XML-POST)
should be sent to Cocoon:

{ echo 'POST /invoke/PriceData HTTP/1.0\nContent-type:
sleep 10;} | telnet cocoon-host 4444


- it should be possible to send a mixture of URL and XML input
parameters >> a merge of above two cases

How to access the required information in the context of a

Thanks in advance!


                                /   \
                               ( o o )
|                                                                        |
| Johannes A. Bertscheit     Phone: +49 821 54 40 46                     |
| Dipl.Informatiker (Univ.)  FAX:   +49 821 52 37 34                     |
| JB Management & Consulting Mobil: +49 172 84 05 109                    |
| Faerberstrasse 5           EMail:             |
| D-86157 Augsburg           EMail-Mobil: |
| Germany                                                                |
|                          .oooO                                         |
|                          (   )   Oooo.                                 |
+----------------------------\ (----(   )--------------------------------+
                              \_)    ) /

View raw message