Here is the concerned extract of my sitemap :
            <map:generate type="stream">
                <map:parameter name="defaultContentType" value="text/xml"/>
            <map:match pattern="tentative">
                <map:transform type="testTransformer" />
                <map:serialize type="xml"/>

Here, a part of the applicationContext.xml (Spring declaration of my transformer) :
        <bean name="testService"
        class=" org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
        <property name="transactionManager">
            <ref bean="maTransactionManager" />
        <property name="target">
            <bean class="xxxx.TestService">
                <property name="maxml2ObjectsService">
                    <ref bean="maxml2ObjectsService" />
                <property name="serviceProgramsService">
                    <ref bean="serviceProgramsService" />
        <property name="transactionAttributes">
                <prop key="test">PROPAGATION_REQUIRED</prop>
    <bean id="testTransformer"
        <property name="testService">
            <ref bean="testService"/>

What I had in my transformer to log the XML stream (wich is effectively received and logged by the transformer) :
        public Document transform(Document document) {
            try {
                DOMSource domSource = new DOMSource(document);
                StringWriter writer = new StringWriter();
                StreamResult result = new StreamResult(writer);
                TransformerFactory tf = TransformerFactory.newInstance();
                Transformer transformer = tf.newTransformer();
                transformer.transform(domSource, result);
                log.debug("TRANSFORMATION:" + writer.toString ());
            catch (TransformerConfigurationException e) {
            catch (TransformerException e) {
                e.printStackTrace ();
            return document;

I use HttpClient to send the post request containing the XML stream and to get the XML stream received (unhappily NULL) :
        HttpClient client = new HttpClient();

        StringBuffer newUrl = new StringBuffer();

        PostMethod method = new PostMethod(newUrl.toString());
        method.setRequestBody(new FileInputStream(xmlFile));
        String xml = post.getResponseBodyAsString();
        System.out.println("Exported virtual XML : " + maxml); // Here the response is NULL

Thank for your help

2007/11/16, warrell harries <>:
Hi Jean-Claude,

What generator are you using in your pipeline match? Can you show us the sitemap? You would need to use the Request generator or another one that 'loads' the pipeline with the contents of the HTTP Request.


On 16/11/2007, Jean-Claude Vogel <> wrote:
Hello guys,

I would like to write my own dom transformer. So I simply wrote the following in order to get firstly an identity transformer :

public class TestTransformer extends AbstractDOMTransformer {      
        private Request request;

        public void setup(SourceResolver resolver, Map objectModel,
                          String src, Parameters par)
                          throws ProcessingException, SAXException, IOException {
            super.setup(resolver, objectModel, src, par);           

        public Document transform(Document document) {
            //  When I log here I see that "document" contains what I want it to contain
            return document;

To test I send an HTTP post request with an XML in its body, but I my HTTP request response body is desesperatly NULL.

I tried to log what happens in the transform method and I can see in my XML body sent by HTTP. The post response is ever empty.

What's wrong in my code please ?