You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@synapse.apache.org by Paul Fremantle <pz...@gmail.com> on 2008/05/10 10:03:00 UTC

Fwd: POX proxy with custom Content-Type

Folks

What do you think about us adding this into the proxy definition (the
XML type) and automatically configuring Axis2 so that the user doesn't
need to modify the axis2.xml?

Paul


---------- Forwarded message ----------
From: Ruwan Linton <ru...@gmail.com>
Date: Sat, May 10, 2008 at 2:30 AM
Subject: Re: POX proxy with custom Content-Type
To: user@synapse.apache.org


Hi Sylvain,

I am afraid, the property name contentType has to be modified as
ContentType. [first letter capitalized] messageType remains as it is.

Thanks,
Ruwan

On Sat, May 10, 2008 at 6:51 AM, Ruwan Linton <ru...@gmail.com>
wrote:

> Hi Sylvain,
>
> Please see my comments in-line;
>
> On Fri, May 9, 2008 at 11:55 PM, Sylvain Legault <sy...@gmail.com>
> wrote:
>
>> Hi,
>>
>> I'm trying to do a simple XML proxy were the contenttype is not
>> application/xml but rather application/vnd.xyz.xml where is xyz may be few
>> different values but in this case let's assume it is xyz.
>>
>> First I found that I needed to modify my axis2.xml (is there another
>> way?),
>> otherwise I get that the incoming HTTP post is not SOAP and there is no
>> Envelope
>
>
> No there is no other way to tell Synapse that this message has to be built
> using this message builder. So you have to have that mapping.
>
>
>>    <messageFormatters>
>> :::
>>        <messageFormatter contentType="application/vnd.xyzxml"
>> class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
>>    </messageFormatters>
>>    <messageBuilders>
>> :::
>>        <messageBuilder contentType="application/vnd.xyz.xml"
>> class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
>>    </messageBuilders>
>>
>> I'm also using the following definition
>>
>> <definitions xmlns="http://ws.apache.org/ns/synapse">
>>    <!-- filtering of messages with XPath and regex matches -->
>>    <filter source="get-property('To')" regex=".*/xyz.*">
>
>            <property name="messageType" value="application/vnd.xyzxml"
> scope="axis2"/>
>            <property name="contentType" value="application/vnd.xyzxml"
> scope="axis2"/>
>
>>
>>        <send>
>>            <endpoint>
>>                <address uri="*http://10.4.3.110:1563/xyz*" format="pox"/>
>>            </endpoint>
>>        </send>
>>        <drop/>
>>    </filter>
>>    <send/>
>> </definitions>
>>
>> My problem is that the message goes thru but ended up on the other side
>> with
>> application/xml.
>>
>> I have also try to create my own java mediator with another definition but
>> still fails to change the content type and before I go too far I would
>> like
>> to know if anyone had tried it before and how?
>
>
> I have modified the above configuration, and you can try that
> configuration. I think it will work.
>
> Thanks,
> Ruwan
>
> --
> Ruwan Linton
> http://www.wso2.org - "Oxygenating the Web Services Platform"




--
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"



-- 
Paul Fremantle
Co-Founder and CTO, WSO2
Apache Synapse PMC Chair
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
For additional commands, e-mail: dev-help@synapse.apache.org


Re: POX proxy with custom Content-Type

Posted by Ruwan Linton <ru...@gmail.com>.
Paul,

Are you proposing to modify the axis configuration at the proxy build time
to add this entry to the builder and formatter maps? I couldn't think of any
other way. Even then we will have to ask user to specify the Builder and
Formatter impl to be used with the ContentType they configure. If not
provided we can take it as ApplicationXML?

Is that what you mean?

Thanks,
Ruwan.

On Sat, May 10, 2008 at 1:33 PM, Paul Fremantle <pz...@gmail.com> wrote:

> Folks
>
> What do you think about us adding this into the proxy definition (the
> XML type) and automatically configuring Axis2 so that the user doesn't
> need to modify the axis2.xml?
>
> Paul
>
>
> ---------- Forwarded message ----------
> From: Ruwan Linton <ru...@gmail.com>
> Date: Sat, May 10, 2008 at 2:30 AM
> Subject: Re: POX proxy with custom Content-Type
> To: user@synapse.apache.org
>
>
> Hi Sylvain,
>
> I am afraid, the property name contentType has to be modified as
> ContentType. [first letter capitalized] messageType remains as it is.
>
> Thanks,
> Ruwan
>
> On Sat, May 10, 2008 at 6:51 AM, Ruwan Linton <ru...@gmail.com>
> wrote:
>
> > Hi Sylvain,
> >
> > Please see my comments in-line;
> >
> > On Fri, May 9, 2008 at 11:55 PM, Sylvain Legault <sy...@gmail.com>
> > wrote:
> >
> >> Hi,
> >>
> >> I'm trying to do a simple XML proxy were the contenttype is not
> >> application/xml but rather application/vnd.xyz.xml where is xyz may be
> few
> >> different values but in this case let's assume it is xyz.
> >>
> >> First I found that I needed to modify my axis2.xml (is there another
> >> way?),
> >> otherwise I get that the incoming HTTP post is not SOAP and there is no
> >> Envelope
> >
> >
> > No there is no other way to tell Synapse that this message has to be
> built
> > using this message builder. So you have to have that mapping.
> >
> >
> >>    <messageFormatters>
> >> :::
> >>        <messageFormatter contentType="application/vnd.xyzxml"
> >> class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
> >>    </messageFormatters>
> >>    <messageBuilders>
> >> :::
> >>        <messageBuilder contentType="application/vnd.xyz.xml"
> >> class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
> >>    </messageBuilders>
> >>
> >> I'm also using the following definition
> >>
> >> <definitions xmlns="http://ws.apache.org/ns/synapse">
> >>    <!-- filtering of messages with XPath and regex matches -->
> >>    <filter source="get-property('To')" regex=".*/xyz.*">
> >
> >            <property name="messageType" value="application/vnd.xyzxml"
> > scope="axis2"/>
> >            <property name="contentType" value="application/vnd.xyzxml"
> > scope="axis2"/>
> >
> >>
> >>        <send>
> >>            <endpoint>
> >>                <address uri="*http://10.4.3.110:1563/xyz*"
> format="pox"/>
> >>            </endpoint>
> >>        </send>
> >>        <drop/>
> >>    </filter>
> >>    <send/>
> >> </definitions>
> >>
> >> My problem is that the message goes thru but ended up on the other side
> >> with
> >> application/xml.
> >>
> >> I have also try to create my own java mediator with another definition
> but
> >> still fails to change the content type and before I go too far I would
> >> like
> >> to know if anyone had tried it before and how?
> >
> >
> > I have modified the above configuration, and you can try that
> > configuration. I think it will work.
> >
> > Thanks,
> > Ruwan
> >
> > --
> > Ruwan Linton
> > http://www.wso2.org - "Oxygenating the Web Services Platform"
>
>
>
>
> --
> Ruwan Linton
> http://www.wso2.org - "Oxygenating the Web Services Platform"
>
>
>
> --
> Paul Fremantle
> Co-Founder and CTO, WSO2
> Apache Synapse PMC Chair
> OASIS WS-RX TC Co-chair
>
> blog: http://pzf.fremantle.org
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@synapse.apache.org
> For additional commands, e-mail: dev-help@synapse.apache.org
>
>


-- 
Ruwan Linton
http://www.wso2.org - "Oxygenating the Web Services Platform"