axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Gainty <>
Subject RE: [AXIS2] Should JSON messages be considered as REST?
Date Sun, 21 Sep 2008 14:55:43 GMT

curious as to when/if a YAML2XML plugin will be available  ?
Disclaimer and confidentiality note 
Everything in this e-mail and any attachments relates to the official business of Sender.
This transmission is of a confidential nature and Sender does not endorse distribution to
any party other than intended recipient. Sender does not necessarily endorse content contained
within this transmission. 

Date: Sun, 21 Sep 2008 19:31:42 +0530
Subject: Re: [AXIS2] Should JSON messages be considered as REST?

Hi Chinthaka,

See comments inline,

On Sun, Sep 21, 2008 at 12:43 AM, Eran Chinthaka <> wrote:

Hi Keith and all,

This argument is based on the following assumption ( You know about assumptions, if you've
watched "Under Siege 2" ;) )

Axis2 REST implementation is based on WSDL 2.0 HTTP Binding. At least this was the case, when
I was implementing and sorry if the implementation is now changed. Nothing has changed with
this regard.  ;).

In the spec, it says, if we have our own custom content-type, then it should be compatible
with application/xml ( 

I don't think that thats the case. The WSDL 2.0 spec specifies three serializations, they
are application/x-www-form-urlencoded, application/xml and multipart/form-data. And the area
in the spec you have referred to is talking about these three. I the section you have referred
to the spec says,

"[Definition: The serialization
format is a media type token ("type/subtype"). It
identifies rules to serialize the payload in an HTTP message. Its
value is defined by the following rules. The HTTP request
serialization format MUST be in the media type range specified by
the {http input
serialization} property. "

So it basically supports any media-Type. Its just that the working group took the trouble
in describing the three serializations above in detail.
Do you think application/json is compatible with application/xml? 
As long as application/json is a standard I dont see any issues with it. 

I don't think so because in the spec once again it says the following here :

"The instance
data of the input, output or fault message is serialized as an
XML document in the message body of the HTTP message" Since JSON serialization is not XML,
rather name/value pair, application/xml is not compatible with application/json.
Answered that too above.


So considering JSON messages as REST messages seems to be fundamentally wrong. 

But since we think (at least I think) JSON is something we should support, we should think
about supporting content-types which are not compatible with SOAP or REST. 


On Wed, Sep 3, 2008 at 11:10 PM, keith chapman <> wrote:

Hi devs,

This idea came up because of the following scenario.

Currently the logic for creating a AxisFault  for a fault received lies in
(lines 507 - 530). This works perfectly when the received fault is SOAP or REST. But it does
not work as expected when the response is JSON ( rather a exception is thrown saying "The
MessageContext does not have an associated SOAPFault."). The reason is the logic we use to
build the AxisFault. If the fault message is not a SOAP message we check for the flag messageContext.isDoingREST()
and get the first element of the SOAPBody as the fault message.

When the fault message is JSON its neither SOAP and the messageContext.isDoingREST() returns
false. Should we consider  JSON messages as REST messages? I believe so.



Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.


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.


See how Windows connects the people, information, and fun that are part of your life.
View raw message