cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Chamberlain <>
Subject Re: CInclude POST (by Payload)
Date Wed, 29 Aug 2007 11:26:38 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<body bgcolor="#ffffff" text="#000000">
Hi Grzegorz,<br>
Thanks for your quick reply.<br>
I'm afraid I don't know the correct terminology.&nbsp; By "payload" I meant
by using the output stream of the established connection.&nbsp; In Java
terms, it looks like this:<tt><br>
&nbsp; // Prepare XML request<br>
&nbsp; ByteArrayOutputStream baos = new ByteArrayOutputStream();<br>
&nbsp; baos.write(...);<br>
&nbsp; // Open and prepare connection<br>
&nbsp; URL&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
url&nbsp;&nbsp;&nbsp;&nbsp; = new URL(<a class="moz-txt-link-rfc2396E"
&nbsp; </tt><tt>URLConnection urlConn = url.openConnection();</tt><br>
<tt>&nbsp; urlConn.setDoInput(true);<br>
&nbsp; urlConn.setDoOutput(true);<br>
&nbsp; urlConn.setRequestProperty("Content-Encoding", "text/xml");<br>
&nbsp; urlConn.setRequestProperty("Content-Type", "application/xml");<br>
&nbsp; urlConn.setRequestProperty("Content-Length",
&nbsp; // Send XML request<br>
&nbsp; urlConn.getOutputStream().write(baos.toByteArray());<br>
&nbsp; // Read response<br>
&nbsp; BufferedInputStream in = new
</tt>I'll take a look at Cocoon 2.2 and S&eacute;bastien's query.&nbsp; Although
our project has been underway for a while, we've only been using the
XSLT and SQL transformers, so I'm hoping the differences won't be great.<br>
Grzegorz Kossakowski wrote:
<blockquote cite="" type="cite">
  <pre wrap="">Andrew Chamberlain pisze:
  <blockquote type="cite">
    <pre wrap="">Hi All,

Just wondering if anyone can help.  As part of a service I'm
constructing, I need to send an XML request to an external service by
HTTP Post.  For this, I'm looking at using the CInclude transformer, but
all the examples I can find seem to use a parameter to pass the data,
rather than sending it as part of the payload (which the external
service expects).
  <pre wrap=""><!---->
What do you mean by "part of the payload"?

  <blockquote type="cite">
    <pre wrap="">Has anyone managed to do this, or am I looking at the need for an
external Java class?  Any advice/ideas would be much appreciated.

I'm using Cocoon (2.1.10) under JBoss (4.0.5 GA).
  <pre wrap=""><!---->
When it comes to 2.1.x version, I think you will have to extend CInclude transformer or write
own. S&eacute;bastien Geindre has asked question about similar functionality yesterday
but he uses Cocoon
2.2, that thread[1] may be helpful for you to get an idea what Cocoon 2.2 can offer you in
regard to

If you want more help you will need to tell us what kind of data do you want to POST and where
comes from. Switching to C2.2 is also worth consideration if your project is in early stages

[1] <a class="moz-txt-link-freetext" href=""></a>


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message