You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users-fr@cocoon.apache.org by Guillaume Helle <gu...@capgemini.com> on 2005/12/12 17:36:43 UTC
Je cherche un XMLConsumer qui ne fasse rien... ;-)
Bonjour,
je me suis écris un RESTPostGenerator qui reçoit des POST xml de clients riches, les traite et retourne un flux XML aux client via le Serializer standard...
Ma sitemap ressemble à ça :
<map:match pattern="post/*/*.*/*">
<map:generate type="RestPost">
<map:parameter name="defaultContentType" value="text/xml"/>
<map:parameter name="source" value="{1}"/>
<map:parameter name="package" value="{2}"/>
<map:parameter name="service" value="{3}"/>
<map:parameter name="action" value="{4}"/>
</map:generate>
<map:serialize type="xml">
<encoding>UTF-8</encoding>
</map:serialize>
Mon problème est qu'à la fin de la méthode generate() du RESTPostGenerator on appelle :
InputSource is = new InputSource(new ByteArrayInputStream(retour.getBytes("UTF-8")));
logger.debug("RESTGenerator returning XML Stream : "+retour);
parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
parser.parse(is, super.xmlConsumer);
Hors mon flux XML (ma String retour) est conséquente et je perds du temps à parser ce flux XML alors qu'il me suffirait juste de retourner ce stream XML à mon client...
Comment éviter cela?
Merci pour vos conseils!
Amicalement,
Guillaume
This message contains information that may be privileged or confidential and is the property of the Capgemini Group. It is intended only for the person to whom it is addressed. If you are not the intended recipient, you are not authorized to read, print, retain, copy, disseminate, distribute, or use this message or any part thereof. If you receive this message in error, please notify the sender immediately and delete all copies of this message.
---------------------------------------------------------------------
Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/
Pour vous desinscrire : mailto:users-fr-unsubscribe@cocoon.apache.org
Autres commandes : mailto:users-fr-help@cocoon.apache.org
Re: Je cherche un XMLConsumer qui ne fasse rien... ;-)
Posted by Sylvain Wallez <sy...@apache.org>.
Guillaume Helle wrote:
> Bonjour,
>
> je me suis écris un RESTPostGenerator qui reçoit des POST xml de clients riches, les traite et retourne un flux XML aux client via le Serializer standard...
>
> Ma sitemap ressemble à ça :
>
> <map:match pattern="post/*/*.*/*">
>
> <map:generate type="RestPost">
>
> <map:parameter name="defaultContentType" value="text/xml"/>
>
> <map:parameter name="source" value="{1}"/>
>
> <map:parameter name="package" value="{2}"/>
>
> <map:parameter name="service" value="{3}"/>
>
> <map:parameter name="action" value="{4}"/>
>
> </map:generate>
>
> <map:serialize type="xml">
>
> <encoding>UTF-8</encoding>
>
> </map:serialize>
>
>
>
>
>
> Mon problème est qu'à la fin de la méthode generate() du RESTPostGenerator on appelle :
>
> InputSource is = new InputSource(new ByteArrayInputStream(retour.getBytes("UTF-8")));
> logger.debug("RESTGenerator returning XML Stream : "+retour);
> parser = (SAXParser) this.manager.lookup(SAXParser.ROLE);
> parser.parse(is, super.xmlConsumer);
>
> Hors mon flux XML (ma String retour) est conséquente et je perds du temps à parser ce flux XML alors qu'il me suffirait juste de retourner ce stream XML à mon client...
>
> Comment éviter cela?
>
Avec un RESTPostReader :-)
Sylvain
--
Sylvain Wallez Anyware Technologies
http://bluxte.net http://www.anyware-tech.com
Apache Software Foundation Member Research & Technology Director
---------------------------------------------------------------------
Liste francophone Apache Cocoon -- http://cocoon.apache.org/fr/
Pour vous desinscrire : mailto:users-fr-unsubscribe@cocoon.apache.org
Autres commandes : mailto:users-fr-help@cocoon.apache.org