You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Daniel Fagerstrom <da...@nada.kth.se> on 2003/11/17 10:56:25 UTC

Web Service Transformers in Cocoon (Re: [article] XML.com: EAI using Apache Cocoon 2.1)

It seem popular to write web service transformers these days. I have 
written one that can be found in 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24402, after that I 
implemented it I have found two other implementations: the one described 
in the article: http://xml.com/pub/a/2003/11/12/cocoon-eai.html, that 
can be found in http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24391, 
and still another one described in 
http://webservices.xml.com/pub/a/ws/2003/03/18/cocoon.html. The later 
one is AFAIK not submitted to Cocoon and only works for Cocoon 2.0.3, 
although it probably should be easy to port it to 2.1.

There is also an XSP implementation of web service calls within the 
current Cocoon distribution. There are also a number of components that 
provide functionality for request parameter based web services: 
HttpProxyGenerator, WebServiceProxyGenerator and possibly 
GenericProxyGenerator in the Proxy block as well as the CIncludeTransformer.

There is a lot of overlapping functionality in the different web service 
client components in Cocoon.

IMO it would be a good idea to merge at least the different web service 
transformer proposals. I would prefer to put as much functionality as 
possible in the HTTPClientSource as in my proposal, as it seem to be 
better to focus the functionality in one reusable place than having it 
reproduced in various places. The web service enabled HTTPClientSource 
can then be used from generators and transformers as well as from 
flowscripts. I have not studied Tonys and Steves proposals in any 
detail, but at least in Tonys variant there is some login handling that 
my implementation lacks, it would be nice to transfer that functionality 
to the HTTPClientSource.

For the transformer part I have no strong opinions, I put the 
functionality in the SourceWritingTransformer, as it already contained 
various operation on modifyable sources. But it probably makes sense to 
have it in a specialized transformer instead.

What do you think?

/Daniel

Velle Andrè wrote:
> The article mentions a web service transformer that seems superior to the one in 2.1.3, and states that it has been submitted to the cocoon-dev list. I haven't been able to find anything like this, and it seems interesting. Anyone know anything about it?
> 
> Regards,
> André
> 
> 
>>-----Original Message-----
>>From: Andreas Hochsteger [mailto:e9625392@student.tuwien.ac.at] 
>>Sent: 15. november 2003 09:11
>>To: dev@cocoon.apache.org
>>Subject: [article] XML.com: EAI using Apache Cocoon 2.1
>>
>>
>>I just got a newsletter from XML.com promoting this article: 
>>http://xml.com/pub/a/2003/11/12/cocoon-eai.html
>>
>>It's about "Enterprise Application Integration using Apache 
>>Cocoon 2.1".
> 
> 



Re: Web Service Transformers in Cocoon (Re: [article] XML.com: EAI using Apache Cocoon 2.1)

Posted by Joe Latty <jo...@tias.com.au>.
Daniel,

I have attached the latest WSIncludeTransformer.

Further to the discussion, however, we are doing our SOAP calls up front
now, calling our SOAPController directly from Flow Script. The SOAP
controller is literally the SOAP calls from the WSIncludeTransformer removed
from the transformer.

If anything goes wrong with the call we can take appropriate action (server
down, session timeout, incorrect password etc etc).

Our Woody binding file binds the returned xml to our beans which do a lot of
the logic needed.

Joe

----- Original Message ----- 
From: "Daniel Fagerstrom" <da...@nada.kth.se>
To: <de...@cocoon.apache.org>
Sent: Wednesday, November 19, 2003 9:48 PM
Subject: Re: Web Service Transformers in Cocoon (Re: [article] XML.com: EAI
using Apache Cocoon 2.1)


> Joe Latty wrote:
>
> >We are using the Web Service Transformer, discussed in the XML.com
article,
> >here (where it was originally written) in a production environment. So
far
> >we have had no problems with it.
> >
> >I can post the latest version of the WSIncludeTransformer if anyone is
> >interested.
> >
> Please do! As soon as I find time for it I will make an effort to
> combine the best festures from the various implementations.
>
> >However, having said that, we have found problems with doing SOAP/HTTP
Calls
> >during pipeline processing. When something goes wrong it is difficult to
> >recover gracefully.
> >
> <rant>
> Agree, in the past I tried in vain to convince the community that there
> is a need for selection based on sitemap content and state
> (http://marc.theaimsgroup.com/?l=xml-cocoon-dev&w=2&r=1&s=pipe-aware&q=b).
> Now you can achieve something similar witing three pipelines. One that
> construct the input to the soap transformer and uses the soap
> transformer, one for handling the output if everything wents well and
> one for error handling then you call the first one from a flowscript
> with processPipelineTo, and streams the output of it into a dom tree.
> Then you can analyze the reusult in it and make a senPage to one of the
> result handling pipelines. I must admit that I am not jumping up and
> down, shouting out my joy, when I think of the elegance of this solution
> ;). But it does it work, and after a while I even might start to think
> of it as an idiom or design pattern ;) Or I find the energy for fighting
> for what is good and right again ;)
> </rant>
>
> >And most of our SOAP/HTTP calls are being now done using
> >the Flow controller and Woody.
> >
> >SOAP/HTTP calls return XML which then populates forms/beans using woody
> >binding.
> >
> >var xml = Packages.org.apache.cocoon.util.SOAPController.call(soapCall,
uri,
> >soapMethod, params, timeout);
> >form.load(xml);
> >// form.save(bean);
> >
> >Joe
> >
> I could not find the o.a.c.util.SOAPController in the Cocoon repository,
> is it something you have developed? And if that is the case it would be
> nice if you could commit that component as well.
>
> /Daniel
>
>

Re: Web Service Transformers in Cocoon (Re: [article] XML.com: EAI using Apache Cocoon 2.1)

Posted by Daniel Fagerstrom <da...@nada.kth.se>.
Joe Latty wrote:

>We are using the Web Service Transformer, discussed in the XML.com article,
>here (where it was originally written) in a production environment. So far
>we have had no problems with it.
>
>I can post the latest version of the WSIncludeTransformer if anyone is
>interested.
>
Please do! As soon as I find time for it I will make an effort to 
combine the best festures from the various implementations.

>However, having said that, we have found problems with doing SOAP/HTTP Calls
>during pipeline processing. When something goes wrong it is difficult to
>recover gracefully. 
>
<rant>
Agree, in the past I tried in vain to convince the community that there 
is a need for selection based on sitemap content and state 
(http://marc.theaimsgroup.com/?l=xml-cocoon-dev&w=2&r=1&s=pipe-aware&q=b). 
Now you can achieve something similar witing three pipelines. One that 
construct the input to the soap transformer and uses the soap 
transformer, one for handling the output if everything wents well and 
one for error handling then you call the first one from a flowscript 
with processPipelineTo, and streams the output of it into a dom tree. 
Then you can analyze the reusult in it and make a senPage to one of the 
result handling pipelines. I must admit that I am not jumping up and 
down, shouting out my joy, when I think of the elegance of this solution 
;). But it does it work, and after a while I even might start to think 
of it as an idiom or design pattern ;) Or I find the energy for fighting 
for what is good and right again ;)
</rant>

>And most of our SOAP/HTTP calls are being now done using
>the Flow controller and Woody.
>
>SOAP/HTTP calls return XML which then populates forms/beans using woody
>binding.
>
>var xml = Packages.org.apache.cocoon.util.SOAPController.call(soapCall, uri,
>soapMethod, params, timeout);
>form.load(xml);
>// form.save(bean);
>
>Joe
>
I could not find the o.a.c.util.SOAPController in the Cocoon repository, 
is it something you have developed? And if that is the case it would be 
nice if you could commit that component as well.

/Daniel



Re: Web Service Transformers in Cocoon (Re: [article] XML.com: EAI using Apache Cocoon 2.1)

Posted by Joe Latty <jo...@tias.com.au>.
We are using the Web Service Transformer, discussed in the XML.com article,
here (where it was originally written) in a production environment. So far
we have had no problems with it.

I can post the latest version of the WSIncludeTransformer if anyone is
interested.

However, having said that, we have found problems with doing SOAP/HTTP Calls
during pipeline processing. When something goes wrong it is difficult to
recover gracefully. And most of our SOAP/HTTP calls are being now done using
the Flow controller and Woody.

SOAP/HTTP calls return XML which then populates forms/beans using woody
binding.

var xml = Packages.org.apache.cocoon.util.SOAPController.call(soapCall, uri,
soapMethod, params, timeout);
form.load(xml);
// form.save(bean);

Joe


----- Original Message ----- 
From: "Reinhard Poetz" <re...@apache.org>
To: <de...@cocoon.apache.org>
Sent: Monday, November 17, 2003 11:02 PM
Subject: RE: Web Service Transformers in Cocoon (Re: [article] XML.com: EAI
using Apache Cocoon 2.1)



Okay, I think it is time to find the 'official' way how to
deal with WebServices in Cocoon. There are many implementations
around and this is rather confusing (at least for me).

I summarized all available implementations that I know and
added them to a new Wiki page:
http://wiki.cocoondev.org/Wiki.jsp?page=WebServices

Please add your usecases and what you need (use) in Cocoon to implement
it.

Take this as starting point in order to get a 'official' web service
integration in Cocoon and to give our users clear advice what to take.

--
Reinhard


> -----Original Message-----
> From: Daniel Fagerstrom [mailto:danielf@nada.kth.se]
> Sent: Monday, November 17, 2003 10:56 AM
> To: dev@cocoon.apache.org
> Cc: steve@candlelightsoftware.com; tony@cultech.com.au
> Subject: Web Service Transformers in Cocoon (Re: [article]
> XML.com: EAI using Apache Cocoon 2.1)
>
>
> It seem popular to write web service transformers these days. I have
> written one that can be found in
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24402, after that I
> implemented it I have found two other implementations: the
> one described
> in the article: http://xml.com/pub/a/2003/11/12/cocoon-eai.html, that
> can be found in
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24391,
> and still another one described in
> http://webservices.xml.com/pub/a/ws/2003/03/18/cocoon.html. The later
> one is AFAIK not submitted to Cocoon and only works for Cocoon 2.0.3,
> although it probably should be easy to port it to 2.1.
>
> There is also an XSP implementation of web service calls within the
> current Cocoon distribution. There are also a number of
> components that
> provide functionality for request parameter based web services:
> HttpProxyGenerator, WebServiceProxyGenerator and possibly
> GenericProxyGenerator in the Proxy block as well as the
> CIncludeTransformer.
>
> There is a lot of overlapping functionality in the different
> web service
> client components in Cocoon.
>
> IMO it would be a good idea to merge at least the different
> web service
> transformer proposals. I would prefer to put as much functionality as
> possible in the HTTPClientSource as in my proposal, as it seem to be
> better to focus the functionality in one reusable place than
> having it
> reproduced in various places. The web service enabled
> HTTPClientSource
> can then be used from generators and transformers as well as from
> flowscripts. I have not studied Tonys and Steves proposals in any
> detail, but at least in Tonys variant there is some login
> handling that
> my implementation lacks, it would be nice to transfer that
> functionality
> to the HTTPClientSource.
>
> For the transformer part I have no strong opinions, I put the
> functionality in the SourceWritingTransformer, as it already
> contained
> various operation on modifyable sources. But it probably
> makes sense to
> have it in a specialized transformer instead.
>
> What do you think?
>
> /Daniel
>
> Velle Andrè wrote:
> > The article mentions a web service transformer that seems
> superior to
> > the one in 2.1.3, and states that it has been submitted to the
> > cocoon-dev list. I haven't been able to find anything like
> this, and
> > it seems interesting. Anyone know anything about it?
> >
> > Regards,
> > André
> >
> >
> >>-----Original Message-----
> >>From: Andreas Hochsteger [mailto:e9625392@student.tuwien.ac.at]
> >>Sent: 15. november 2003 09:11
> >>To: dev@cocoon.apache.org
> >>Subject: [article] XML.com: EAI using Apache Cocoon 2.1
> >>
> >>
> >>I just got a newsletter from XML.com promoting this article:
> >>http://xml.com/pub/a/2003/11/12/cocoon-eai.html
> >>
> >>It's about "Enterprise Application Integration using Apache
> >>Cocoon 2.1".
> >
> >
>


RE: Web Service Transformers in Cocoon (Re: [article] XML.com: EAI using Apache Cocoon 2.1)

Posted by Reinhard Poetz <re...@apache.org>.
Okay, I think it is time to find the 'official' way how to 
deal with WebServices in Cocoon. There are many implementations 
around and this is rather confusing (at least for me). 

I summarized all available implementations that I know and 
added them to a new Wiki page: 
http://wiki.cocoondev.org/Wiki.jsp?page=WebServices

Please add your usecases and what you need (use) in Cocoon to implement
it.

Take this as starting point in order to get a 'official' web service
integration in Cocoon and to give our users clear advice what to take.

--
Reinhard


> -----Original Message-----
> From: Daniel Fagerstrom [mailto:danielf@nada.kth.se] 
> Sent: Monday, November 17, 2003 10:56 AM
> To: dev@cocoon.apache.org
> Cc: steve@candlelightsoftware.com; tony@cultech.com.au
> Subject: Web Service Transformers in Cocoon (Re: [article] 
> XML.com: EAI using Apache Cocoon 2.1)
> 
> 
> It seem popular to write web service transformers these days. I have 
> written one that can be found in 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24402, after that I 
> implemented it I have found two other implementations: the 
> one described 
> in the article: http://xml.com/pub/a/2003/11/12/cocoon-eai.html, that 
> can be found in 
> http://nagoya.apache.org/bugzilla/show_bug.cgi?id=24391, 
> and still another one described in 
> http://webservices.xml.com/pub/a/ws/2003/03/18/cocoon.html. The later 
> one is AFAIK not submitted to Cocoon and only works for Cocoon 2.0.3, 
> although it probably should be easy to port it to 2.1.
> 
> There is also an XSP implementation of web service calls within the 
> current Cocoon distribution. There are also a number of 
> components that 
> provide functionality for request parameter based web services: 
> HttpProxyGenerator, WebServiceProxyGenerator and possibly 
> GenericProxyGenerator in the Proxy block as well as the 
> CIncludeTransformer.
> 
> There is a lot of overlapping functionality in the different 
> web service 
> client components in Cocoon.
> 
> IMO it would be a good idea to merge at least the different 
> web service 
> transformer proposals. I would prefer to put as much functionality as 
> possible in the HTTPClientSource as in my proposal, as it seem to be 
> better to focus the functionality in one reusable place than 
> having it 
> reproduced in various places. The web service enabled 
> HTTPClientSource 
> can then be used from generators and transformers as well as from 
> flowscripts. I have not studied Tonys and Steves proposals in any 
> detail, but at least in Tonys variant there is some login 
> handling that 
> my implementation lacks, it would be nice to transfer that 
> functionality 
> to the HTTPClientSource.
> 
> For the transformer part I have no strong opinions, I put the 
> functionality in the SourceWritingTransformer, as it already 
> contained 
> various operation on modifyable sources. But it probably 
> makes sense to 
> have it in a specialized transformer instead.
> 
> What do you think?
> 
> /Daniel
> 
> Velle Andrè wrote:
> > The article mentions a web service transformer that seems 
> superior to 
> > the one in 2.1.3, and states that it has been submitted to the 
> > cocoon-dev list. I haven't been able to find anything like 
> this, and 
> > it seems interesting. Anyone know anything about it?
> > 
> > Regards,
> > André
> > 
> > 
> >>-----Original Message-----
> >>From: Andreas Hochsteger [mailto:e9625392@student.tuwien.ac.at]
> >>Sent: 15. november 2003 09:11
> >>To: dev@cocoon.apache.org
> >>Subject: [article] XML.com: EAI using Apache Cocoon 2.1
> >>
> >>
> >>I just got a newsletter from XML.com promoting this article:
> >>http://xml.com/pub/a/2003/11/12/cocoon-eai.html
> >>
> >>It's about "Enterprise Application Integration using Apache
> >>Cocoon 2.1".
> > 
> > 
>