Discussion:
RESTful support
Sam Carleton
2014-03-24 15:19:50 UTC
Permalink
I have been using Axis2/C for years with SOAP interface. I need to start
looking at adding a RESTful interface to my application. From what I read
on the web site, I can simply change the service.xml. But I have also seen
some emails about when will 1.7 be release that fixes RESTful support.

Is there RESTful support? If so, can I use my existing SOAP code and
change the service.xml? If I can, how do I do it? Here is one example of
my soap interfaces:

service.xml:

<operation name="getSlideImage" mep="
http://www.w3.org/2004/08/wsdl/in-out">
<parameter
name="wsamapping">urn:mmpp:cartManager/getSlideImage</parameter>
</operation>

I am thinking I want to use something like this:

<operation name="getNextSlideImage">
<parameter name="RESTMethod">GET</parameter>
<parameter name="RESTLocation">getNextSlideImage/{time}</parameter>
</operation>

Here is the WSDL request/responce for the operation:

<xsd:element name="getSlideImage">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="time" type="xsd:string"
nillable="true"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="getSlideImageResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="tns:imageDTO"
nillable="true"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:complexType name="imageDTO">
<xsd:sequence>
<xsd:element name="folderId" type="xsd:string" />
<xsd:element name="imageId" type="xsd:string" />
<xsd:element name="time" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
Thomas Gentsch
2014-03-24 20:37:18 UTC
Permalink
I tried pretty much the same thing (with 1.6), pleasantly with
success :-)
Nothing complicated:
- no WSDL but rather manual req/resp marshalling
- a service.xml similar to yours with 4 functions

It needed a bit of experimenting how the params end up in the server
code (and I believe that the examples were wrong) and fixing a few
memory leaks (which I submitted as Jira defect/patch).

I have no idea what is missing and is supposed to be fixed in 1.7. Also
it seems that it became a bit quiet around axis2c - might be interesting
to learn what the plans are?

Regards,
tge
Post by Sam Carleton
I have been using Axis2/C for years with SOAP interface. I need to
start looking at adding a RESTful interface to my application. From
what I read on the web site, I can simply change the service.xml. But
I have also seen some emails about when will 1.7 be release that fixes
RESTful support.
Is there RESTful support? If so, can I use my existing SOAP code and
change the service.xml? If I can, how do I do it? Here is one
<operation name="getSlideImage"
mep="http://www.w3.org/2004/08/wsdl/in-out">
<parameter
name="wsamapping">urn:mmpp:cartManager/getSlideImage</parameter>
</operation>
<operation name="getNextSlideImage">
<parameter name="RESTMethod">GET</parameter>
<parameter
name="RESTLocation">getNextSlideImage/{time}</parameter>
</operation>
<xsd:element name="getSlideImage">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="time" type="xsd:string"
nillable="true"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getSlideImageResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="tns:imageDTO"
nillable="true"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="imageDTO">
<xsd:sequence>
<xsd:element name="folderId" type="xsd:string" />
<xsd:element name="imageId" type="xsd:string" />
<xsd:element name="time" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
Nandika Jayawardana
2014-03-26 06:12:35 UTC
Permalink
Hi Sam,

As you have described, currently available way to make a service RESTful
is to map the operation to a rest url using the services.xml. You can have
a look into the rest_disp.c for implementation details.

Axis2c 1.7 is basically focused on bug fixes as there are quite few bug
fixes received from the community which needs to be applied.

Regards
Nandika
Post by Thomas Gentsch
I tried pretty much the same thing (with 1.6), pleasantly with
success :-)
- no WSDL but rather manual req/resp marshalling
- a service.xml similar to yours with 4 functions
It needed a bit of experimenting how the params end up in the server
code (and I believe that the examples were wrong) and fixing a few
memory leaks (which I submitted as Jira defect/patch).
I have no idea what is missing and is supposed to be fixed in 1.7. Also
it seems that it became a bit quiet around axis2c - might be interesting
to learn what the plans are?
Regards,
tge
Post by Sam Carleton
I have been using Axis2/C for years with SOAP interface. I need to
start looking at adding a RESTful interface to my application. From
what I read on the web site, I can simply change the service.xml. But
I have also seen some emails about when will 1.7 be release that fixes
RESTful support.
Is there RESTful support? If so, can I use my existing SOAP code and
change the service.xml? If I can, how do I do it? Here is one
<operation name="getSlideImage"
mep="http://www.w3.org/2004/08/wsdl/in-out">
<parameter
name="wsamapping">urn:mmpp:cartManager/getSlideImage</parameter>
</operation>
<operation name="getNextSlideImage">
<parameter name="RESTMethod">GET</parameter>
<parameter
name="RESTLocation">getNextSlideImage/{time}</parameter>
</operation>
<xsd:element name="getSlideImage">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="time" type="xsd:string"
nillable="true"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getSlideImageResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="tns:imageDTO"
nillable="true"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="imageDTO">
<xsd:sequence>
<xsd:element name="folderId" type="xsd:string" />
<xsd:element name="imageId" type="xsd:string" />
<xsd:element name="time" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
Sam Carleton
2014-03-26 11:19:52 UTC
Permalink
So, I think what I am asking and what you all are answering are two
different questions. This is fine by me... So what I am reading is that
there IS a v1.7 and it is mostly bug fixes, does not add any new RESTful
features. Ok, cool, so this makes me think that 1.7 has been officially
released, is that correct? If so, I would love to have it. Heck, even if
it isn't officially release but an improvement over what I have been using
for 5 years, I will take it. Where do I go and get it?

P.S. I was asking: how do I implement modify the service.xml to get a
RESTful binding that uses all my SOAP code. I infer that it cannot be
done, which is good to know.

Sam
Post by Nandika Jayawardana
Hi Sam,
As you have described, currently available way to make a service RESTful
is to map the operation to a rest url using the services.xml. You can have
a look into the rest_disp.c for implementation details.
Axis2c 1.7 is basically focused on bug fixes as there are quite few bug
fixes received from the community which needs to be applied.
Regards
Nandika
Post by Thomas Gentsch
I tried pretty much the same thing (with 1.6), pleasantly with
success :-)
- no WSDL but rather manual req/resp marshalling
- a service.xml similar to yours with 4 functions
It needed a bit of experimenting how the params end up in the server
code (and I believe that the examples were wrong) and fixing a few
memory leaks (which I submitted as Jira defect/patch).
I have no idea what is missing and is supposed to be fixed in 1.7. Also
it seems that it became a bit quiet around axis2c - might be interesting
to learn what the plans are?
Regards,
tge
Post by Sam Carleton
I have been using Axis2/C for years with SOAP interface. I need to
start looking at adding a RESTful interface to my application. From
what I read on the web site, I can simply change the service.xml. But
I have also seen some emails about when will 1.7 be release that fixes
RESTful support.
Is there RESTful support? If so, can I use my existing SOAP code and
change the service.xml? If I can, how do I do it? Here is one
<operation name="getSlideImage"
mep="http://www.w3.org/2004/08/wsdl/in-out">
<parameter
name="wsamapping">urn:mmpp:cartManager/getSlideImage</parameter>
</operation>
<operation name="getNextSlideImage">
<parameter name="RESTMethod">GET</parameter>
<parameter
name="RESTLocation">getNextSlideImage/{time}</parameter>
</operation>
<xsd:element name="getSlideImage">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="time" type="xsd:string"
nillable="true"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="getSlideImageResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="tns:imageDTO"
nillable="true"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="imageDTO">
<xsd:sequence>
<xsd:element name="folderId" type="xsd:string" />
<xsd:element name="imageId" type="xsd:string" />
<xsd:element name="time" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
Loading...