You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by keith chapman <ke...@gmail.com> on 2007/03/01 14:54:42 UTC

[AXIS2] Builders and formatters for REST

Hi all,

I have implemented messageformatters and messageBuilders for REST. The
following message formatters have been set in the default axis2.xml.

<messageFormatter contentType="application/x-www-form-urlencoded"
                         class="
org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
<messageFormatter contentType="multipart/form-data"
                         class="
org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
<messageFormatter contentType="application/xml"
                         class="
org.apache.axis2.transport.http.ApplicationXMLFormatter"/>

I have added builders for the respective content Types as well. I have not
added the MultipartFormDataBuilder to the default axis2.xml because all
modules using the default axis2.xml will have to add the dependancy of
servlet-api. But I have added it to the default axis2.xml of the war.

<messageBuilder contentType="application/xml"
                         class="
org.apache.axis2.builder.ApplicationXMLBuilder"/>
<messageBuilder contentType="application/x-www-form-urlencoded"
                         class="
org.apache.axis2.builder.XFormURLEncodedBuilder"/>
<messageBuilder contentType="multipart/form-data">
                         <class="
org.apache.axis2.builder.MultipartFormDataBuilder"/>

Thanks,
Keith
-- 
Keith Chapman
WSO2 Inc.
Oxygen for Web Services Developers.
http://wso2.org/

Re: [AXIS2] Builders and formatters for REST

Posted by David Illsley <da...@gmail.com>.
+1 I really dislike having some config hard-coded in. It's really
counter-intuitive.
David

On 05/03/07, Sanjiva Weerawarana <sa...@opensource.lk> wrote:
> Davanum Srinivas wrote:
> > Sanjiva,
> >
> > My guess is Thilina did this so old axis2.xml's will still work w/o
> > having to add these entries.
>
> The new code will require users to use a nightly or upgrade to the
> upcoming 1.2. So I'm not sure its worth it .. because all of these things
> surprise users: someone may remove the soap formatter and expect SOAP is
> nt supported and voila it still is.
>
> That's not good.
>
> Sanjiva.
> --
> Sanjiva Weerawarana, Ph.D.
> Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
> Director; Open Source Initiative; http://www.opensource.org/
> Member; Apache Software Foundation; http://www.apache.org/
> Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
David Illsley - IBM Web Services Development

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


Re: [AXIS2] Builders and formatters for REST

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi,
On 3/5/07, Sanjiva Weerawarana <sa...@opensource.lk> wrote:
> Davanum Srinivas wrote:
> > Sanjiva,
> >
> > My guess is Thilina did this so old axis2.xml's will still work w/o
> > having to add these entries.
Yes... That was the very reason..
>
> The new code will require users to use a nightly or upgrade to the
> upcoming 1.2. So I'm not sure its worth it .. because all of these things
> surprise users: someone may remove the soap formatter and expect SOAP is
> nt supported and voila it still is.
Yep... Good point.. But IMHO we need to follow the same deprecating
convention which we follow for the interfaces... At least for the 1.2
we might need to keep this... We can DOC this and also we can mention
that this will be gone in the next release (post 1.2)..

Users might want to override the default formatters.. But I found the
above use case of removing the soap formatters to be very rare :)..

Thanks,
Thilina
>
> That's not good.
>
> Sanjiva.
> --
> Sanjiva Weerawarana, Ph.D.
> Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
> Director; Open Source Initiative; http://www.opensource.org/
> Member; Apache Software Foundation; http://www.apache.org/
> Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/

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


Re: [AXIS2] Builders and formatters for REST

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Davanum Srinivas wrote:
> Sanjiva,
> 
> My guess is Thilina did this so old axis2.xml's will still work w/o
> having to add these entries.

The new code will require users to use a nightly or upgrade to the 
upcoming 1.2. So I'm not sure its worth it .. because all of these things 
surprise users: someone may remove the soap formatter and expect SOAP is 
nt supported and voila it still is.

That's not good.

Sanjiva.
-- 
Sanjiva Weerawarana, Ph.D.
Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
Director; Open Source Initiative; http://www.opensource.org/
Member; Apache Software Foundation; http://www.apache.org/
Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/

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


Re: [AXIS2] Builders and formatters for REST

Posted by Davanum Srinivas <da...@gmail.com>.
Sanjiva,

My guess is Thilina did this so old axis2.xml's will still work w/o
having to add these entries.

-- dims

On 3/4/07, Sanjiva Weerawarana <sa...@opensource.lk> wrote:
> Thilina Gunarathne wrote:
> >> I'm unclear why we wouldn't do these like xports .. you get what you list
> >> in axis2.xml or add dynamically via the AxisConfig object.
> > My preference would be to specify all the builders & formatters via
> > the axis2.xml.. But we had to make the SOAP, MIME, MTOM builders added
> > automatically via the AxisConfig in order to retain the backward
> > compatibility..
>
> So all we need to do is to have those be listed in the default axis2.xml
> with a comment saying these are needed unless you want to kill backward
> compatibility, no?
>
> Sanjiva.
> --
> Sanjiva Weerawarana, Ph.D.
> Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
> Director; Open Source Initiative; http://www.opensource.org/
> Member; Apache Software Foundation; http://www.apache.org/
> Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Davanum Srinivas :: http://wso2.org/ :: Oxygen for Web Services Developers

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


Re: [AXIS2] Builders and formatters for REST

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
Thilina Gunarathne wrote:
>> I'm unclear why we wouldn't do these like xports .. you get what you list
>> in axis2.xml or add dynamically via the AxisConfig object.
> My preference would be to specify all the builders & formatters via
> the axis2.xml.. But we had to make the SOAP, MIME, MTOM builders added
> automatically via the AxisConfig in order to retain the backward
> compatibility..

So all we need to do is to have those be listed in the default axis2.xml 
with a comment saying these are needed unless you want to kill backward 
compatibility, no?

Sanjiva.
-- 
Sanjiva Weerawarana, Ph.D.
Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
Director; Open Source Initiative; http://www.opensource.org/
Member; Apache Software Foundation; http://www.apache.org/
Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/

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


Re: [AXIS2] Builders and formatters for REST

Posted by Thilina Gunarathne <cs...@gmail.com>.
Hi,
> ?? Then why do we bother to list them .. is there any way to change the
> defaults? (Not a likely case I agree but still.)
Yes.. Defaults can be overridden by the axis2.xml.. No need to specify
them if you don't want to override that mapping...

> I'm unclear why we wouldn't do these like xports .. you get what you list
> in axis2.xml or add dynamically via the AxisConfig object.
My preference would be to specify all the builders & formatters via
the axis2.xml.. But we had to make the SOAP, MIME, MTOM builders added
automatically via the AxisConfig in order to retain the backward
compatibility..

Thanks,
Thilina

>
> Sanjiva.
>
> Thilina Gunarathne wrote:
> > Yes... The default builders & formatters will be available at the run
> > time even if not given in the axis2.xml
> >
> > ~Thilina
> >
> > On 3/2/07, Saminda Abeyruwan <sa...@gmail.com> wrote:
> >> Hi Keith,
> >>
> >> If the given default message formatters or message builders not given
> >> in the
> >> axis2.xml, would it still be available at runtime.
> >>
> >> Thank you
> >>
> >> Saminda
> >>
> >>
> >> On 3/1/07, keith chapman <ke...@gmail.com> wrote:
> >> > Hi all,
> >> >
> >> > I have implemented messageformatters and messageBuilders for REST. The
> >> following message formatters have been set in the default axis2.xml.
> >> >
> >> > <messageFormatter
> >> contentType="application/x-www-form-urlencoded"
> >> >
> >> class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
> >> > <messageFormatter contentType="multipart/form-data"
> >> >
> >> class="org.apache.axis2.transport.http.MultipartFormDataFormatter
> >> "/>
> >> > <messageFormatter contentType="application/xml"
> >> >
> >> class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
> >> >
> >> > I have added builders for the respective content Types as well. I
> >> have not
> >> added the MultipartFormDataBuilder to the default axis2.xml because all
> >> modules using the default axis2.xml will have to add the dependancy of
> >> servlet-api. But I have added it to the default axis2.xml of the war.
> >> >
> >> > <messageBuilder contentType="application/xml"
> >> >
> >> class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
> >> > <messageBuilder
> >> contentType="application/x-www-form-urlencoded"
> >> >
> >> class="org.apache.axis2.builder.XFormURLEncodedBuilder "/>
> >> > <messageBuilder contentType="multipart/form-data">
> >> >
> >> <class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
> >> >
> >> > Thanks,
> >> > Keith
> >> > --
> >> > Keith Chapman
> >> > WSO2 Inc.
> >> > Oxygen for Web Services Developers.
> >> > http://wso2.org/
> >>
> >>
> >>
> >> --
> >> Saminda Abeyruwan
> >>
> >> Software Engineer
> >> WSO2 Inc. - www.wso2.org
> >
> >
>
> --
> Sanjiva Weerawarana, Ph.D.
> Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
> Director; Open Source Initiative; http://www.opensource.org/
> Member; Apache Software Foundation; http://www.apache.org/
> Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-dev-help@ws.apache.org
>
>


-- 
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/

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


Re: [AXIS2] Builders and formatters for REST

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
?? Then why do we bother to list them .. is there any way to change the 
defaults? (Not a likely case I agree but still.)

I'm unclear why we wouldn't do these like xports .. you get what you list 
in axis2.xml or add dynamically via the AxisConfig object.

Sanjiva.

Thilina Gunarathne wrote:
> Yes... The default builders & formatters will be available at the run
> time even if not given in the axis2.xml
> 
> ~Thilina
> 
> On 3/2/07, Saminda Abeyruwan <sa...@gmail.com> wrote:
>> Hi Keith,
>>
>> If the given default message formatters or message builders not given 
>> in the
>> axis2.xml, would it still be available at runtime.
>>
>> Thank you
>>
>> Saminda
>>
>>
>> On 3/1/07, keith chapman <ke...@gmail.com> wrote:
>> > Hi all,
>> >
>> > I have implemented messageformatters and messageBuilders for REST. The
>> following message formatters have been set in the default axis2.xml.
>> >
>> > <messageFormatter
>> contentType="application/x-www-form-urlencoded"
>> >
>> class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
>> > <messageFormatter contentType="multipart/form-data"
>> >
>> class="org.apache.axis2.transport.http.MultipartFormDataFormatter
>> "/>
>> > <messageFormatter contentType="application/xml"
>> >
>> class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
>> >
>> > I have added builders for the respective content Types as well. I 
>> have not
>> added the MultipartFormDataBuilder to the default axis2.xml because all
>> modules using the default axis2.xml will have to add the dependancy of
>> servlet-api. But I have added it to the default axis2.xml of the war.
>> >
>> > <messageBuilder contentType="application/xml"
>> >
>> class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
>> > <messageBuilder
>> contentType="application/x-www-form-urlencoded"
>> >
>> class="org.apache.axis2.builder.XFormURLEncodedBuilder "/>
>> > <messageBuilder contentType="multipart/form-data">
>> >
>> <class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
>> >
>> > Thanks,
>> > Keith
>> > --
>> > Keith Chapman
>> > WSO2 Inc.
>> > Oxygen for Web Services Developers.
>> > http://wso2.org/
>>
>>
>>
>> -- 
>> Saminda Abeyruwan
>>
>> Software Engineer
>> WSO2 Inc. - www.wso2.org
> 
> 

-- 
Sanjiva Weerawarana, Ph.D.
Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
Director; Open Source Initiative; http://www.opensource.org/
Member; Apache Software Foundation; http://www.apache.org/
Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/

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


Re: [AXIS2] Builders and formatters for REST

Posted by Thilina Gunarathne <cs...@gmail.com>.
Yes... The default builders & formatters will be available at the run
time even if not given in the axis2.xml

~Thilina

On 3/2/07, Saminda Abeyruwan <sa...@gmail.com> wrote:
> Hi Keith,
>
> If the given default message formatters or message builders not given in the
> axis2.xml, would it still be available at runtime.
>
> Thank you
>
> Saminda
>
>
> On 3/1/07, keith chapman <ke...@gmail.com> wrote:
> > Hi all,
> >
> > I have implemented messageformatters and messageBuilders for REST. The
> following message formatters have been set in the default axis2.xml.
> >
> > <messageFormatter
> contentType="application/x-www-form-urlencoded"
> >
> class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
> > <messageFormatter contentType="multipart/form-data"
> >
> class="org.apache.axis2.transport.http.MultipartFormDataFormatter
> "/>
> > <messageFormatter contentType="application/xml"
> >
> class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
> >
> > I have added builders for the respective content Types as well. I have not
> added the MultipartFormDataBuilder to the default axis2.xml because all
> modules using the default axis2.xml will have to add the dependancy of
> servlet-api. But I have added it to the default axis2.xml of the war.
> >
> > <messageBuilder contentType="application/xml"
> >
> class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
> > <messageBuilder
> contentType="application/x-www-form-urlencoded"
> >
> class="org.apache.axis2.builder.XFormURLEncodedBuilder "/>
> > <messageBuilder contentType="multipart/form-data">
> >
> <class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
> >
> > Thanks,
> > Keith
> > --
> > Keith Chapman
> > WSO2 Inc.
> > Oxygen for Web Services Developers.
> > http://wso2.org/
>
>
>
> --
> Saminda Abeyruwan
>
> Software Engineer
> WSO2 Inc. - www.wso2.org


-- 
Thilina Gunarathne
WSO2, Inc.; http://www.wso2.com/
Home page: http://webservices.apache.org/~thilina/
Blog: http://thilinag.blogspot.com/

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


Re: [AXIS2] Builders and formatters for REST

Posted by Saminda Abeyruwan <sa...@gmail.com>.
Hi Keith,

If the given default message formatters or message builders not given in the
axis2.xml, would it still be available at runtime.

Thank you

Saminda

On 3/1/07, keith chapman <ke...@gmail.com> wrote:
>
> Hi all,
>
> I have implemented messageformatters and messageBuilders for REST. The
> following message formatters have been set in the default axis2.xml.
>
> <messageFormatter contentType="application/x-www-form-urlencoded"
>                          class="
> org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
> <messageFormatter contentType="multipart/form-data"
>                          class="
> org.apache.axis2.transport.http.MultipartFormDataFormatter "/>
> <messageFormatter contentType="application/xml"
>                          class="
> org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
>
> I have added builders for the respective content Types as well. I have not
> added the MultipartFormDataBuilder to the default axis2.xml because all
> modules using the default axis2.xml will have to add the dependancy of
> servlet-api. But I have added it to the default axis2.xml of the war.
>
> <messageBuilder contentType="application/xml"
>                          class="
> org.apache.axis2.builder.ApplicationXMLBuilder"/>
> <messageBuilder contentType="application/x-www-form-urlencoded"
>                          class="
> org.apache.axis2.builder.XFormURLEncodedBuilder "/>
> <messageBuilder contentType="multipart/form-data">
>                          <class="
> org.apache.axis2.builder.MultipartFormDataBuilder"/>
>
> Thanks,
> Keith
> --
> Keith Chapman
> WSO2 Inc.
> Oxygen for Web Services Developers.
> http://wso2.org/




-- 
Saminda Abeyruwan

Software Engineer
WSO2 Inc. - www.wso2.org