[axis2] rest question
The axis2/1_2/rest.ws.html documentation indicates that if the content type is text/xml and the SOAPAction Header is missing that the message is treated as a restful message. If that is the case should the AxisServlet code be changed to check if the request.getHeader(HTTPConstants.HEADER_SOAP_ACTION) value is not empty in addition to checking if !isRESTRequest(contentTYpe) near the top of the doPost(...) method? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [axis2] rest question
This is not the case now. text/xml contentType is used for SOAP 1.1 request, the way we figure out whether a request is REST is based on the contentType. Obviously If the HTTPMethod is PUT, GET or DELETE then this is treated as REST automatically. From 1.2 onwards we hace the notion of messageBuilders and Message Formatters who are called upon to build request messages and to format response messages (This mapping is in the axis2 xml). So if the contentType is text/xml then the SOAP builder will take control. If the content Type is application/xml then the ApplicationXMLBuilder (RESP POST style) will take over. The GET is processed by XFormURLEncodedBuilder and so on. These mappings can be changed in your axis2.xml. Thanks, Keith. On 8/11/07, Mark Thompson [EMAIL PROTECTED] wrote: The axis2/1_2/rest.ws.html documentation indicates that if the content type is text/xml and the SOAPAction Header is missing that the message is treated as a restful message. If that is the case should the AxisServlet code be changed to check if the request.getHeader(HTTPConstants.HEADER_SOAP_ACTION) value is not empty in addition to checking if !isRESTRequest(contentTYpe) near the top of the doPost(...) method? - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] -- Keith Chapman WSO2 Inc. Oxygen for Web Services Developers. http://wso2.org/
Re: [Axis2] rest question
And another really good illustration about REST. REST is an architectural style in which the central theme is resources (not methods). http://www.innoq.com/blog/st/2006/06/30/rest_vs_soap_oh_no_not_again.htmlAnneOn 6/29/06, Anne Thomas Manes [EMAIL PROTECTED] wrote:Here's a useful guide to understanding REST:http://prescod.net/rest/Steps_to_extreme.html AnneOn 6/27/06, Anne Thomas Manes [EMAIL PROTECTED] wrote: If you have two methods, then you must have two endpoints. Otherwise, it isn't RESTful.Anne On 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Anne I am sorry - I probably didnt get the answer.I have a service class that has 2 methods -public OMElement dothis(OMElement om1)public OMElement dothat(OMElement om2)Now for this service there will be one REST endpoint address - right? then my question is given my payload xml - how does axis decide whichmethod to invoke in my service?I didnt quite get what u meant byYou have only one function associated with POST to a specific URL Are u saying that my service can have only one method for it to be restenabled?thanksAnamitra Anne Thomas Manes [EMAIL PROTECTED]To m axis-user@ws.apache.orgcc 06/27/2006 01:17 PMSubject Re: [Axis2] rest question Please respond to [EMAIL PROTECTED] he.orgWhen using a RESTful service, *POST* is your method. You have only one function associated with POST to a specific URL. If you have a service thatexposes methods other than GET, POST, PUT, or DELETE, then it isn'tRESTful.AnneOn 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:Hi As per the axis2 doc it seems that if I want to do a POST rest service - the only way axis runtime would detect which method to delegate the calltois from the name of the top level element in the http message body XML -right?I have a service whose method definition is like public OMElement dothis(OMElelemt payload)When I do the SOAP clientinvoke I send the soap action as urn:dothisandmy payload top element does not match the method name - This works fine with axis2.But now if I have to do REST call and not have the root element as methodname - how can I acheive that using rest? [I presume soap action is notgoing to work here or is it?]thanks Anamitra-To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]- To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2] rest question
Here's a useful guide to understanding REST:http://prescod.net/rest/Steps_to_extreme.html AnneOn 6/27/06, Anne Thomas Manes [EMAIL PROTECTED] wrote: If you have two methods, then you must have two endpoints. Otherwise, it isn't RESTful.Anne On 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Anne I am sorry - I probably didnt get the answer.I have a service class that has 2 methods -public OMElement dothis(OMElement om1)public OMElement dothat(OMElement om2)Now for this service there will be one REST endpoint address - right? then my question is given my payload xml - how does axis decide whichmethod to invoke in my service?I didnt quite get what u meant byYou have only one function associated with POST to a specific URL Are u saying that my service can have only one method for it to be restenabled?thanksAnamitra Anne Thomas Manes [EMAIL PROTECTED]To m axis-user@ws.apache.orgcc 06/27/2006 01:17 PMSubject Re: [Axis2] rest question Please respond to [EMAIL PROTECTED] he.orgWhen using a RESTful service, *POST* is your method. You have only one function associated with POST to a specific URL. If you have a service thatexposes methods other than GET, POST, PUT, or DELETE, then it isn'tRESTful.AnneOn 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:Hi As per the axis2 doc it seems that if I want to do a POST rest service - the only way axis runtime would detect which method to delegate the calltois from the name of the top level element in the http message body XML -right?I have a service whose method definition is like public OMElement dothis(OMElelemt payload)When I do the SOAP clientinvoke I send the soap action as urn:dothisandmy payload top element does not match the method name - This works fine with axis2.But now if I have to do REST call and not have the root element as methodname - how can I acheive that using rest? [I presume soap action is notgoing to work here or is it?]thanks Anamitra-To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]- To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]
[Axis2] rest question
Hi As per the axis2 doc it seems that if I want to do a POST rest service - the only way axis runtime would detect which method to delegate the call to is from the name of the top level element in the http message body XML - right? I have a service whose method definition is like public OMElement dothis(OMElelemt payload) When I do the SOAP client invoke I send the soap action as urn:dothis and my payload top element does not match the method name - This works fine with axis2. But now if I have to do REST call and not have the root element as method name - how can I acheive that using rest? [I presume soap action is not going to work here or is it?] thanks Anamitra - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2] rest question
When using a RESTful service, *POST* is your method. You have only one function associated with POST to a specific URL. If you have a service that exposes methods other than GET, POST, PUT, or DELETE, then it isn't RESTful. AnneOn 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:HiAs per the axis2 doc it seems that if I want to do a POST rest service - the only way axis runtime would detect which method to delegate the call tois from the name of the top level element in the http message body XML -right?I have a service whose method definition is like public OMElement dothis(OMElelemt payload)When I do the SOAP clientinvoke I send the soap action as urn:dothis andmy payload top element does not match the method name - This works finewith axis2. But now if I have to do REST call and not have the root element as methodname - how can I acheive that using rest? [I presume soap action is notgoing to work here or is it?]thanksAnamitra -To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2] rest question
Hi Anne I am sorry - I probably didnt get the answer. I have a service class that has 2 methods - public OMElement dothis(OMElement om1) public OMElement dothat(OMElement om2) Now for this service there will be one REST endpoint address - right? then my question is given my payload xml - how does axis decide which method to invoke in my service? I didnt quite get what u meant by You have only one function associated with POST to a specific URL Are u saying that my service can have only one method for it to be rest enabled? thanks Anamitra Anne Thomas Manes [EMAIL PROTECTED] To maxis-user@ws.apache.org cc 06/27/2006 01:17 PMSubject Re: [Axis2] rest question Please respond to [EMAIL PROTECTED] he.org When using a RESTful service, *POST* is your method. You have only one function associated with POST to a specific URL. If you have a service that exposes methods other than GET, POST, PUT, or DELETE, then it isn't RESTful. Anne On 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi As per the axis2 doc it seems that if I want to do a POST rest service - the only way axis runtime would detect which method to delegate the call to is from the name of the top level element in the http message body XML - right? I have a service whose method definition is like public OMElement dothis(OMElelemt payload) When I do the SOAP client invoke I send the soap action as urn:dothis and my payload top element does not match the method name - This works fine with axis2. But now if I have to do REST call and not have the root element as method name - how can I acheive that using rest? [I presume soap action is not going to work here or is it?] thanks Anamitra - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2] rest question
You have only one function public OMElement dothis(OMElement om1) public OMElement dothat(OMElement om2) are both considered the same signature therefore they are one function.. associated with POST (IN order to be RESTful you invoke using method=POST) to a specific URL certainly true assuming one endpoint address The statement is correct.. Do you perhaps have more specific questions? Martin -- * This email message and any files transmitted with it contain confidential information intended only for the person(s) to whom this email message is addressed. If you have received this email message in error, please notify the sender immediately by telephone or email and destroy the original message without making a copy. Thank you. - Original Message - From: [EMAIL PROTECTED] To: axis-user@ws.apache.org Sent: Tuesday, June 27, 2006 1:43 PM Subject: Re: [Axis2] rest question Hi Anne I am sorry - I probably didnt get the answer. I have a service class that has 2 methods - public OMElement dothis(OMElement om1) public OMElement dothat(OMElement om2) Now for this service there will be one REST endpoint address - right? then my question is given my payload xml - how does axis decide which method to invoke in my service? I didnt quite get what u meant by You have only one function associated with POST to a specific URL Are u saying that my service can have only one method for it to be rest enabled? thanks Anamitra Anne Thomas Manes [EMAIL PROTECTED] To maxis-user@ws.apache.org cc 06/27/2006 01:17 PMSubject Re: [Axis2] rest question Please respond to [EMAIL PROTECTED] he.org When using a RESTful service, *POST* is your method. You have only one function associated with POST to a specific URL. If you have a service that exposes methods other than GET, POST, PUT, or DELETE, then it isn't RESTful. Anne On 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi As per the axis2 doc it seems that if I want to do a POST rest service - the only way axis runtime would detect which method to delegate the call to is from the name of the top level element in the http message body XML - right? I have a service whose method definition is like public OMElement dothis(OMElelemt payload) When I do the SOAP client invoke I send the soap action as urn:dothis and my payload top element does not match the method name - This works fine with axis2. But now if I have to do REST call and not have the root element as method name - how can I acheive that using rest? [I presume soap action is not going to work here or is it?] thanks Anamitra - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [Axis2] rest question
If you have two methods, then you must have two endpoints. Otherwise, it isn't RESTful.AnneOn 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi Anne I am sorry - I probably didnt get the answer.I have a service class that has 2 methods -public OMElement dothis(OMElement om1)public OMElement dothat(OMElement om2)Now for this service there will be one REST endpoint address - right? then my question is given my payload xml - how does axis decide whichmethod to invoke in my service?I didnt quite get what u meant byYou have only one function associated with POST to a specific URL Are u saying that my service can have only one method for it to be restenabled?thanksAnamitra Anne Thomas Manes [EMAIL PROTECTED]To maxis-user@ws.apache.orgcc 06/27/2006 01:17 PMSubject Re: [Axis2] rest question Please respond to [EMAIL PROTECTED]he.orgWhen using a RESTful service, *POST* is your method. You have only one function associated with POST to a specific URL. If you have a service thatexposes methods other than GET, POST, PUT, or DELETE, then it isn'tRESTful.AnneOn 6/27/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:HiAs per the axis2 doc it seems that if I want to do a POST rest service - the only way axis runtime would detect which method to delegate the calltois from the name of the top level element in the http message body XML -right?I have a service whose method definition is like public OMElement dothis(OMElelemt payload)When I do the SOAP clientinvoke I send the soap action as urn:dothisandmy payload top element does not match the method name - This works fine with axis2.But now if I have to do REST call and not have the root element as methodname - how can I acheive that using rest? [I presume soap action is notgoing to work here or is it?]thanks Anamitra-To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]-To unsubscribe, e-mail: [EMAIL PROTECTED]For additional commands, e-mail: [EMAIL PROTECTED]