cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Griffiths <>
Subject Generate From XML Webservice with HTTP Headers
Date Tue, 26 Jul 2011 07:19:36 GMT

I'm using cocoon 2.2 and would like to use the XML webservices provided by
an OpenRDF Sesame server  as a source for the the generate stage in my
pipeline. I am using the file generator but it is currently not working for
me because I cannot control the HTTP Headers in the GET request that is sent
from Cocoon to Sesame. In order for Sesame to return valid XML the "Accept"
header needs to be set. Also in some use cases in ned to send a POST request
from Cocoon for Sesame to return the XML I'm after.

Is there any way to achieve this using Cocoon? I'm basically looking for a
generator that can call a web service as it's source, with a little more
fine control over the http headers.

I have added some examples of the problem and what I'm trying to achieve

Many thanks


My pipeline

         <map:match pattern="repositories">

        <map:generate src="http://localhost:8080/openrdf-sesame/repositories
" type="file"/>

        <map:serialize type="xml"/>


The GET request _required_ for this generator:

GET /openrdf-sesame/repositories HTTP/1.1
Host: localhost
Accept: application/sparql-results+xml, */*;q=0.5

The GET request actually sent for this generator:

GET /openrdf-sesame/repositories HTTP/1.1
Host: localhost

Also would like to send POST requests like:

POST /openrdf-sesame/repositories/mem-rdf HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Accept: application/rdf+xml, */*;q=0.5



View raw message