cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ulf Sahlin" <ulf.sah...@s2communications.se>
Subject Re: Concerning a) Woody bindings, b) Web Service publishing using existing Generator?
Date Fri, 19 Mar 2004 01:17:28 GMT

> >>><map:match pattern="*.service">
> >>>  <map:read type="soap-rpc" mime-type="text/xml"/>
> >>>  <map:generate src="generator.xsp">
> >>>    <map:parameter name="myparam"
> >>>value="{axis.getParameter('/soap:Envelope/soap:Body/myparam')}"/>
> >>
> >>If you store this XML structure somewhere the XModuleSource should work:
> >>http://wiki.cocoondev.org/Wiki.jsp?page=XModuleSource.
> >
> >
> > Bear in mind that I need to make use of the XSP Generators
> since I generate
> > the XML data from it. Afaik there can be only one Generator in a Cocoon
> > pipeline. The methods used for reading XMLized input I've looked into
> > unfortunately replace the ServerPages generator. If the XModule
> is used in
> > the same manner as request.getParameter I see the possibilities!
>
> XModuleSource is a source, not a sitemap component, so it is not a
> replacement for XSPGenerator (in good or bad sense). Furthermore there
> is still the possibility of aggregation.
>
> But you are right, using it in map:parameter directly would not be
> possible, but for example in combination with XMLFileModule (which can
> not only read files but probably from all resolvable sources).

As a SOAP call is an XML structure packaged within the request object maybe
I could serialize that. I guess what I'm looking for is the way to get that
data into an xpath-readable object. As this XML data is bundled within the
actual request call I'm a little confused in how to use it as a
XModuleSource.

Example SOAP call over HTTP:

---------

POST /InStock HTTP/1.1
Host: www.stock.org
Content-Type: application/soap+xml; charset=utf-8
Content-Length: nnn

<?xml version="1.0"?>
<soap:Envelope
  xmlns:soap="http://www.w3.org/2001/12/soap-envelope"
  soap:encodingStyle="http://www.w3.org/2001/12/soap-encoding">
  <soap:Body xmlns:m="http://www.stock.org/stock">
    <m:GetStockPrice>
      <m:StockName>IBM</m:StockName>
    </m:GetStockPrice>
  </soap:Body>
</soap:Envelope>

--------

Naturally in this case I would like to read the
/soap:Envelope/soap:Body/m:getStockPrice/m:StockName parameter to use it in
my ejb finder within the XSP Generator.


> > I didn't find any examples in cocoon/samples/ (I'm using 2.1.3). XModule
> > being in Scratchpad could be a reason.
>
> Yes, it's new.
>
> > Could you please expand on your XModule thoughts, in particular
> how to use
> > it to read the contents of a SOAP call to extract parameters to
> be used in
> > the generator (as I pseudo-sketched above). I truly appreciate
> your help!
>
> It depends on which you get the result of the SOAP call in or where you
> store it. The above pseudo code using a reader first and a generator
> afterwards is not possible.
>
> But wait, there is also a SOAP call from inside XSP possible ...
> searching for the samples ... http://127.0.0.1:8888/samples/xsp/soap/ in
> your local Cocoon installation. Maybe so it's easier.
>
> Joerg

There is very good support indeed for calling external web services from
within Cocoon, such as (taken from samples):

--------

<soap:call url="http://services.xmethods.net:9090/soap">
    <ns1:getRate xmlns:ns1="urn:xmethods-CurrencyExchange"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance">
        <soap:enc/>
        <country1 xsi:type="xsd:string">euro</country1>
        <country2 xsi:type="xsd:string">united states</country2>
    </ns1:getRate>
</soap:call>

--------

Still this only uses another server's SOAP services hence it isn't actually
serving them. As the hello-world samples also state there is some REST-style
web service example available (meaning, just serialize the XML) but I'd like
to go all the way with the SOAP-compatibility.


Cheers,
   Ulf Sahlin


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message