axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "keith chapman" <keithgchap...@gmail.com>
Subject Re: Content Negotiation (Was Re: [AXIS2] Should JSON messages be considered as REST?)
Date Tue, 23 Sep 2008 03:56:03 GMT
Hi Chinthaka,

Currently it picks the first matching content-type in the accept header. If
for e.g the Accept header was "Accept:
foo/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=
0.8,image/png,*/*;q=0.5" then the response would be application/xml
(Assuming that there was no matching builder for foo/xml, but if there was a
matching builder for foo/xml the response would be foo/xml).

Currently this happens on a per request basis, what do u mean by enabling it
on a per conversation basis?

Thanks,
Keith.

On Tue, Sep 23, 2008 at 1:28 AM, Eran Chinthaka <eran.chinthaka@gmail.com>wrote:

> 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
> conversations.
>
> 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.
>
> Thanks,
> Chinthaka
>
>
> On Mon, Sep 22, 2008 at 2:03 PM, Sanjiva Weerawarana <
> sanjiva@opensource.lk> wrote:
>
>>  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] http://markmail.org/message/mbnxc2ysq2bt7v6a
>>
>> On Mon, Sep 22, 2008 at 8:53 PM, Eran Chinthaka <eran.chinthaka@gmail.com
>> > 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.
>> http://wso2.org/
>>
>> blog: http://www.keith-chapman.org
>>
>>
>> --
>> Sanjiva Weerawarana, Ph.D.
>> Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
>> Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
>> Member; Apache Software Foundation; http://www.apache.org/
>> Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/
>>
>> Blog: http://sanjiva.weerawarana.org/
>>
>>  --------------------------------------------------------------------- To
>> unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org For additional
>> commands, e-mail: axis-dev-help@ws.apache.org
>
>
>
>
> --
> 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.
http://wso2.org/

blog: http://www.keith-chapman.org

Mime
View raw message