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. In the spec, it says, if we have our own custom content-type, then it should be compatible with application/xml ( http://www.w3.org/TR/wsdl20-adjuncts/#_http_ser_xml). Do you think application/json is compatible with application/xml? I don't think so because in the spec once again it says the following here : http://www.w3.org/TR/wsdl20-adjuncts/#_http_operation_xml_encoding "The instance data <http://www.w3.org/TR/wsdl20-adjuncts/#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. 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. Thanks, Chinthaka On Wed, Sep 3, 2008 at 11:10 PM, keith chapman <[EMAIL PROTECTED]>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 > org.apache.axis2.util.Utils.java (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. > > WDYT? > > Thanks, > Keith. > > -- > Keith Chapman > Senior Software Engineer > WSO2 Inc. > Oxygenating the Web Service Platform. > http://wso2.org/ > > blog: http://www.keith-chapman.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
