Roman (and anyone working on ReST with Axis2),

Sorry for the delay in responding.  Other things kept getting in the way.

It turns out that Axis2 supports ReST web service requests with parameters in 
the query string just fine.  This is with WSDL 1.1.  WSDL 2.0 is not needed to 
make this work.

The issue I had was the way the input request was defined.  In my example I had 
the request defined as a string, which will not work.  You won't get any errors 
but the response will always be blank.  I went down several dead ends before 
finally getting a reply with accurate information from Kishanthan.

In my WSDL I had a simple echo operation.  This operation takes a string and 
puts it in the response.  I had the input defined as a simple type.  See below.

<xsd:simpleType name="EchoRequestType">
    <xsd:restriction base="xsd:string">
        <xsd:maxLength value="100"/>
    </xsd:restriction>
</xsd:simpleType>

I needed to redefine the input to be a complex type.  See below.

<xsd:complexType name="EchoRequestType">
    <xsd:sequence>
        <xsd:element name="input" type="tns:EchoRequestInputType"/>
    </xsd:sequence>
</xsd:complexType>

<xsd:simpleType name="EchoRequestInputType">
    <xsd:restriction base="xsd:string">
        <xsd:maxLength value="100"/>
    </xsd:restriction>
</xsd:simpleType>

After making this change the ReST request worked fine.  See sample GET request 
below.

http://localhost/test/services/TestService/echo?input=ping20130522

Regards,
J


________________________________
From: Roman Manz <rm...@amadeus.com>
To: java-user@axis.apache.org 
Sent: Friday, May 3, 2013 9:41 AM
Subject: Re: ReST with Axis2


Hello Jack, 

you are completely right, looking forward,
many thanks! 

Have a good weekend 
Roman 



From:      
 Jack Sprat <rexclaim...@yahoo.com> 
To:      
 "java-user@axis.apache.org"
<java-user@axis.apache.org> 
Date:      
 03-05-13 15:30 
Subject:    
   Re: ReST with
Axis2 
________________________________



I think Roman asked the question to use Axis2 with
ReST.

Roman - I was finally able to get a ReST web service request working with
Axis2 thanks to the help of Kishanthan.  I need to test a bit more
and will reply with more information.

Thanks,
J

________________________________
From: Martin Gainty <mgai...@hotmail.com>
To: "java-user@axis.apache.org" <java-user@axis.apache.org> 
Sent: Thursday, May 2, 2013 6:30 PM
Subject: RE: ReST with Axis2



you're probably better off implementing a technology which supports
REST e.g. JAX-RS

http://www.ibm.com/developerworks/web/library/wa-jaxrs/

Martin 
______________________________________________ 
Verzicht und Vertraulichkeitanmerkung/Note de déni et de confidentialité

________________________________
To: java-user@axis.apache.org
Subject: Re: ReST with Axis2
From: rm...@amadeus.com
Date: Thu, 2 May 2013 14:37:18 +0000

Hello Kishanthan, 

I also play with this and I wonder if there is a document that describes
restful service implementations, preferably both wsdl1.1 and wsdl2.0. I
am happy for everything you have! 

Many thanks 
Roman 



From:        Kishanthan Thangarajah <kshanth2...@gmail.com> 
To:        "java-...@axis.apache.org" <java-...@axis.apache.org>,
Jack Sprat <rexclaim...@yahoo.com> 
Cc:        "axis-u...@ws.apache.org" <axis-u...@ws.apache.org> 
Date:        26-04-13 23:05 
Subject:        Re: ReST with Axis2 
________________________________



On Fri, Apr 26, 2013 at 9:09 PM, Jack Sprat <rexclaim...@yahoo.com>
wrote: 
The ReST request looks like this:
https://www.example.com/test2/services/TestService/echo?echoRequest=ping

If this is the URL format that you are going to use with REST
requests, then you don't need wsdl 2.0. These kind of REST URL are supported
by default in axis2, with wsdl 1.1. 

For example, if one of the method (say : add) takes two parameter as input
then the URL would be like, 
https://www.example.com/services/CalculaterService/add?val1=23&val2=54

With wsdl 2.0 you can use URL format like, 
https://www.example.com/test2/services/TestService/echo/ping, which
is equivalent to what you have mentioned, which is the true RESTful
way IMO. 

So can you first try with normal approach and see? 



The response returned is blank:
<test:echoResponse xmlns:test="http://ws.example.com/test";;;
/> 

Can anyone tell me what may be wrong?  

Not sure on why this is not working, but I can have look at this. Can you
create a jira and attach your service archive, which causes this behavior?


Thanks, 
Kishanthan. 

Is ReST with Axis2 and WSDL 2.0 possible?  I am trying to justify
using Axis2 here but will lose the fight if it will not work for ReST requests.

Please feel free to contact me off-list.

Thank you. 



----- Original Message -----
From: Jack Sprat <rexclaim...@yahoo.com>
To: "axis-u...@ws.apache.org" <axis-u...@ws.apache.org>
Cc:
Sent: Wednesday, April 24, 2013 5:11 PM
Subject: ReST with Axis2

I've been struggling with Axis2 and ReST for a few days and hope someone
can help.

I have created a version 2.0 WSDL for a very simple service and can generate
the code stubs using the wsdl2java command.  In the WSDL I have 2
bindings - 1 for HTTP and 1 for SOAP.  SOAP requests work fine. 
All ReST requests come back with a blank response.  The AxisServlet
class gets the ReST request correctly as I see the query string captured
in debug mode.  When the service class is called the request is blank. 
I can see this while debugging.

Do I need to do anything different in my service class for ReST requests? 
What am I missing?  Any help is GREATLY appreciated.

I've included the WSDL below.

Thanks.

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscr...@axis.apache.org
For additional commands, e-mail: java-user-h...@axis.apache.org

Reply via email to