axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eran Chinthaka" <>
Subject Re: Content Negotiation (Was Re: [AXIS2] Should JSON messages be considered as REST?)
Date Mon, 22 Sep 2008 19:58:42 GMT
Keith, great piece of work. Is there a way to give preference to
content-types too, during the negotiation?

Ok let me tell one use case why I like content negotiations enabled for

As we might know already, when we do performance analysis of Axis2, we send
large number of messages to a server. This includes sending increasingly
large (in size) messages as well. Also these metrics involve measuring the
usage of network bandwidth, etc.,

If we can enable cont-neg at conversation level, you can see how we will
win, especially when Axis2 client talks to Axis2 servers.

One might think this as a hack, but obviously there should be some
advantage, when Axis2 client talk to another Axis2 server/client. This will
be ok, with request level cont-negotiation, but will be optimal/useful with
conversation level.


On Mon, Sep 22, 2008 at 2:03 PM, Sanjiva Weerawarana

>  Ah excellent! So does the message formatter get selected based on the
> accept headers sent (which refer to media types IIRC)? That's perfect.
> Chinthaka, the idea of bringing content negotiation into SOAP is
> interesting but IMO not that useful. While content neg is a favorite
> RESTafarian feature, the reality is that it hasn't really proved its mettle.
> I wanted us to do it because its a simple thing for us to do with our
> architecture and because for pure HTTP there are some usecases, esp. with
> pure HTTP scenarios where the browser is involved.
> I can't find the comment right now but Larry Messinter, who proposed
> content neg into the http spec, later regretted it. IIRC the quote and ref
> is in my ws-* vs. rest presentation somewhere!
> Sanjiva.
> keith chapman wrote:
> Hi Chinthaka,
> I did implement content-negotiation in Axis2 some time ago [1]. It was
> implemented using the Accept header. It can be enabled by adding the
> following parameter to the axis2.xml
> <parameter name="httpContentNegotiation">true</parameter>
> Thanks,
> Keith.
> [1]
> On Mon, Sep 22, 2008 at 8:53 PM, Eran Chinthaka <>wrote:
>> Since our discussion is over on Faults and JSON messages, let's discuss
>> one of the good points raised by Dr. Sanjiva.
>> I think content negotiation is a cool feature to have, especially when we
>> are using HTTP. This is one of the features I personally definitely like to
>> have.
>> Are you guys thinking of using cont-neg on transport level, or will it be
>> sth like we did for service group context using a SOAP header?
>> If we check how browsers and Web servers do content negotiation, it is
>> mainly using Accept, Accept-Encoding, Accept-Charset, etc., header. I think
>> this can be easily done within Axis2 too.
>> But the problem with this approach is that, this cont-neg should happen
>> for every message. If we find out a way to do this for a conversation, it'd
>> great. Basically a client must ask from a server, the content types it can
>> support and client can then use those types to send messages later. This
>> also can be tricky as sometimes Web services server itself might restrict
>> some content types only for some operations.
>> Even if one of us won't be doing this, this is sth a new comer can easily
>> tackle if we list this on tasks to be done list (if we have one ;) )
>> What do you all think?
>> --
>> With Mettha,
>> Eran Chinthaka
>> --------------------------------------------------------------------
>> Health is the greatest gift; contentment is the greatest wealth; trusting
>> is the best relationship; nirvana is the highest joy. - Dhammapada
> --
> Keith Chapman
> Senior Software Engineer
> WSO2 Inc.
> Oxygenating the Web Service Platform.
> blog:
> --
> Sanjiva Weerawarana, Ph.D.
> Founder & Director; Lanka Software Foundation;
> Founder, Chairman & CEO; WSO2, Inc.;
> Member; Apache Software Foundation;
> Visiting Lecturer; University of Moratuwa;
> Blog:
>  --------------------------------------------------------------------- To
> unsubscribe, e-mail: For additional
> commands, e-mail:

With Mettha,
Eran Chinthaka

Health is the greatest gift; contentment is the greatest wealth; trusting is
the best relationship; nirvana is the highest joy. - Dhammapada

View raw message