You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Robert Simmons Jr." <kr...@arcor.de> on 2004/10/24 14:55:33 UTC
SOAP deprecated with cocoon?
I was looking for examples of how to make my applications SOAP available. I
have a web app for people to set up their subscriptions to information
wires. But I would like them to be able to access this via their PDA using
SOAP.
Can someone point me in the right direction?
-- Regards
-- Robert Simmons Jr.
Author: Hardcore Java, Published March 2004 by O'Reilly
http://www.oreilly.com/catalog/hardcorejv/
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: SOAP deprecated with cocoon?
Posted by Nick Goupinets <ng...@openskysolutions.ca>.
Hi Robert,
I think you can take advantage of SOAP logic sheets:
http://wiki.apache.org/cocoon/SOAPLogicsheet
If you need something more sophisticated, you can also write your own
cocoon component. For a "quick and dirty" solution, it's possible to
create a Java class that sends a soap request via HTTP (that's how the
logic sheet is implemented btw) or employs, say, AXIS.
Then, the results can be serialized into WML, or anything else,
depending on what your needs are.
Sincerely,
Nick Goupinets.
Robert Simmons Jr. wrote:
> I was looking for examples of how to make my applications SOAP available. I
> have a web app for people to set up their subscriptions to information
> wires. But I would like them to be able to access this via their PDA using
> SOAP.
>
> Can someone point me in the right direction?
>
>
> -- Regards
> -- Robert Simmons Jr.
>
> Author: Hardcore Java, Published March 2004 by O'Reilly
> http://www.oreilly.com/catalog/hardcorejv/
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: SOAP deprecated with cocoon?
Posted by "Robert Simmons Jr." <kr...@arcor.de>.
Unfortunately the example in that block consists of all of two files which
are so simplistic to not be useful. .
-- Robert
"Giacomo Pati" <gi...@apache.org> wrote in message
news:Pine.LNX.4.61.0410241545440.12722@lapgp.otego.com...
> On Sun, 24 Oct 2004, Robert Simmons Jr. wrote:
>
>> I was looking for examples of how to make my applications SOAP available.
>> I
>> have a web app for people to set up their subscriptions to information
>> wires. But I would like them to be able to access this via their PDA
>> using
>> SOAP.
>>
>> Can someone point me in the right direction?
>
> Have a look at the axis block in rsc/block/axis.
>
>>
>>
>> -- Regards
>> -- Robert Simmons Jr.
>>
>> Author: Hardcore Java, Published March 2004 by O'Reilly
>> http://www.oreilly.com/catalog/hardcorejv/
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
> --
> Giacomo Pati
> Otego AG, Switzerland - http://www.otego.com
> Orixo, the XML business alliance - http://www.orixo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: SOAP deprecated with cocoon?
Posted by Giacomo Pati <gi...@apache.org>.
On Sun, 24 Oct 2004, Robert Simmons Jr. wrote:
> I was looking for examples of how to make my applications SOAP available. I
> have a web app for people to set up their subscriptions to information
> wires. But I would like them to be able to access this via their PDA using
> SOAP.
>
> Can someone point me in the right direction?
Have a look at the axis block in rsc/block/axis.
>
>
> -- Regards
> -- Robert Simmons Jr.
>
> Author: Hardcore Java, Published March 2004 by O'Reilly
> http://www.oreilly.com/catalog/hardcorejv/
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
--
Giacomo Pati
Otego AG, Switzerland - http://www.otego.com
Orixo, the XML business alliance - http://www.orixo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: SOAP deprecated with cocoon?
Posted by Scott Schwab <ss...@tripos.com>.
An approach I have used, to SOAPafy my Cocoon actions is to work with
the SOAP Message format, not RPC, and then ignore the SOAP wrapper
tags. Let me explain by example:
I have a method which runs a database search based on a keyword passed
in by the user.
I define a simple XML wrapper for the keyword:
<searchIt>foo</searchIt>
I have a SOAP client send the request in the body of the SOAP request,
so the request looks like:
<SOAP-ENV:Envelope ...>
<SOAP-ENV:Header>...</SOAP-ENV:Header>
<SOAP-ENV:Body>
<searchIt>foo</searchIt>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I send this request, through HTTP to a normal Cocoon endpoint, with a
matcher firing off of the URL I give it.
The pipeline for the request looks like:
<map:match pattern="searchItReq">
<!-- us the stream generator to just flow the SOAP request -->
<!-- as is into the
pipeline -->
<map:generate type="stream"/>
<!-- use a style sheet with a template to match the "searchIt"
tag, produce the -->
<!-- the XML for the next action. It is very important that
this stylesheet passes -->
<!-- unrecognized tags, as is, through the it (see below for
the xslt for that) -->
<map:transform type="xslt" src="searchManagement.xslt"/>
<!-- this is a call to another pipeline, which build an actual
SQL statement with a XSTL, -->
<!-- passes that to the SQLTransformer (see Cocoon' website)
Still, any XSLT -->
<!-- transformer passes unrecognized XML tags though.
-->
<map:call resource="pipe-searchSQL"/>
<!-- this XSLT expects the SQL response as formatted by the
SQLTransformer output -->
<!-- and builds the expect response. Again, all the transformer
passes unrecognized -->
<!-- XML tags though. When building the response, it stills
ignore any SOAP tag, -->
<!-- it just resplaces tags tied the searchIt or SQL
response -->
<map:transform type="xslt" src="searchGroup.xslt"/>
<!-- send XML back -->
<map:serialize type="xml"/>
</map:match>
The response returned to the SOAP client would be:
<SOAP-ENV:Envelope ...>
<SOAP-ENV:Header>...</SOAP-ENV:Header>
<SOAP-ENV:Body>
<yourResults>bar</yourResults>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
All the SOAP-ENV tags are passed unmodified from the request's SOAP-ENV
tags.
The good of this approach:
It is pretty easy to tweak your response, as most of it is done in XSTL.
If your not a AXIS expert, you can add still add lots of functionality
through plain Cocoon.
The bad:
You lose many of SOAP's data type checking.
Calls to RPC methods will require more work to mimic in Cocoon.
I had to write my own reader to place in the <map:handle-errors> catch,
to properly format Cocoon messages into SOAP response.
Generating an WSDL is a manual exercise.
The ugly:
Pure SOAP snobs will not like it.
It leads to many smaller stylesheets.
Alternatives?
For Attachment handling, existing SOAP services, I took the AXISRPC...
stuff as a base, and built a generator which calls the AXIS engine to
process the request (Clue: .wsdd goes in your WEB-INF/class/..
directory) and spew the resulting XML into an XML pipeline, so I can
post process it, if needed. Sorry , as it stands I can not contribute
this code, due to my company current or lack of policy.
I hope this helps, "Building Web Services with Java" by Steve Graham,
... was a good source of information on the guts of a SOAP message.
As mentioned above the XSLT to pass tags unmolested is:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
Later,
Scott Schwab
-- these comments are my personal comments and may or may not represent
my employer's view --
Robert Simmons Jr. wrote:
>I was looking for examples of how to make my applications SOAP available. I
>have a web app for people to set up their subscriptions to information
>wires. But I would like them to be able to access this via their PDA using
>SOAP.
>
>Can someone point me in the right direction?
>
>
>-- Regards
>-- Robert Simmons Jr.
>
>Author: Hardcore Java, Published March 2004 by O'Reilly
>http://www.oreilly.com/catalog/hardcorejv/
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org