Are Restful web services created in axis2/c truly RESTful? - rest

I'm a newbie to RESTful webservices and I'm trying to create a RESTful webservice in one of our previous SOAP based webservice hosted in axis2c which by it's documentation says that one can host both RESTful webservices and SOAP based ones at the same time?
If so will the RESTful webservice be truly RESTful?(My doubts are on this one). I'm finding it hard to find tutorials for building RESTful webservices in axis2c apart from their documentation. If there are some good tutorials out there that you know of please post them.

To determine whether or not a REST service is truly RESTful, one must measure the service against the six constraints of a RESTful Web Service:
http://en.wikipedia.org/wiki/Representational_State_Transfer#Constraints
If your web service meets the 5 criteria (one is optional) then the service is truly RESTful.

Related

Want to move from web services to Web API. How to go about this?

So right now our company has custom SOAP web services that hold functions to do things (e.g. sending emails, getting employee info, etc.) and are connected via Service References.
We want to make the switch to Web API 2, but I'm kind of lost on how we can (or if it's possible) to do that since all of our services interact with SOAP.
I wanted to create brand new Web APIs for each service we have which would hold the methods, but I'm not sure where to start. I've scoured the internet, but I haven't really found anything that answers my question.
Can someone shed some light on this for me? Thanks
well, you can create the Web API Service, and exposes the functions that you need, maybe, this service can be accessed from anywhere, but, the real functionality is on the soap (that can be in a DMZ for example), so, create a class library that consume those services and Web API now use this class library, so Web API will be only a facade.
But, first think, is really necessary have this facade in web api to consume those services?
Remember that if your soap services are built with WCF, WCF has support for HTTP protocol.

using aspnet web api for other than rest purposes?

In this question, I am told that web API is specifically purposed for making rest services. What are the options for not wanting to follow rest? What are Web API alternatives to REST?
WCF was earlier used to write RESTful services. But, WCF is strongly used towards SOAP based architecture and doesn't fully support (or it is quite difficult to write) the entirety of RESTful architecture.
Hence, WebApi was developed as a lightweight solution to support only RESTful services.

Generate REST from WSDL

I'm looking for best way to automate generation of REST ws.
We have collection of web services (SOAP) with WSDLs generated for them. I was required to provide different APIs to invoke these web services. (PHP, Pyton, REST, CLI ...)
One of requirement is to have REST API for these ws.
What is the best way to generate REST client/server, is there any automatic tools for that?
There is a chance that WSDLs will change each release.
Thanks
It's not possible to generate REST API from WSDL. You can't mix oranges and apples
SOAP is a protocol build on top of HTTP. A WebService is represented by a set of methods/actions. You can see a WebService as sophisticated RPC. Generally we can say that WebServices are about verbs, to call remote methods/actions. A WebService also doesn't have uniform interface and that's the reason why WSDL exists.
REST is architectural style (scope is broader than just API). REST API is represented by a set of resources and representations. A resource is source of an information and is managed via uniform interface. Generally we can say that REST API is about nouns. Because all resources must have uniform interface there is no need for WADL (an unsuccessful attempt to create something like WSDL for REST).
I doubt you can automatically transform verbs into nouns, etc.
Please check the below article that describes how to use WSDL2.0 to describe REST Services. It can only be used if the intended message format is XML.
https://www.ibm.com/developerworks/library/ws-restwsdl/
Instead of rewriting an existing SOAP-based web service, use API Express to present it as a mobile-ready REST service. No conversion necessary. Continue to run the SOAP service and, with a WSDL file and a few configuration parameters, it can easily be integrated into mobile apps as a REST service.
How to Expose a WSDL Service (SOAP) as REST API: https://dzone.com/articles/how-to-expose-a-wsdl-service-soap-as-rest-api
Appery.io API Express: https://appery.io/api-express/

How to provide a REST interface to a SOAP web service?

I know very little about web programming but I need to establish a license generation web service to provide licenses to users of my desktop software.
I have managed to create a working & debugged SOAP service on a Win2003 server but now I have discovered that the interface that I need to provide to my payment processor must be REST.
How would you recommend I deal with this, given that I simply don't have the time to learn PHP and rewrite my web service etc. I could bypass the SOAP altogether and easily create an executable which receives the license parameters and returns an encrypted license, but it's the web interface bit that I am stuck on. I will probably subcontract someone to write a utility for this on elance, but I don't know what to ask for.
Manu thanks,
Michael
You can expose the same service as SOAP based as well as RESTful. Axis2 with WSDL 2.0 has support for this.
Please see this article RESTful Web Services with Apache Axis2 - explains things in detail..
Thanks..
There's no easy conversion from SOAP to REST. SOAP WebServices RESTful APIs use different approaches. I think it is very easy to do with Ruby on Rails (which will take care of 90% of RESTful APi for you). All you need is to implement your logic.
Sinatra example:
get '/hi' do
"Hello World!"
end

REST vs Web Services

In relation to this question, I have a follow up question that I am still confused over. I have been asked to compair REST vs Web Services. From what I have learnt about REST, it is not a web service, therefore how can you compair the two? What does the question mean when it says REST in this respect?
REST is an architectural pattern for web services emphasizing the usage of URIs as resources with a small set of operations that may be performed on them (usually PUT, POST, GET, and DELETE). I'm guessing you are being asked to compare REST to the ws* standard web services which utilize a lot of other technologies (including SOAP, though SOAP itself is not a web service, it is just a protocol that happens to be used in ws* web services).
REST can be used to provide web services just like databases can be used to store names and addresses. REST is far more general purpose than simply a way of providing a web API.
REST is useful for building distributed systems. However, many people use Web Services (note the capitals, this usually denotes SOAP, WS-*) for building distributed systems.
Wow, I just saw the homework tag. That is one seriously mean question. There are industry veterans who could not come close to answering this question.
A more accurate question would be: Compare REST using HTTP versus RPC using SOAP for building distributed systems.
They probably mean REST verse SOAP. They're all web services in concept.
The abbreviation REST stands for "REpresentational State Transfer".
REST APIs are used to call resources and allow the software to communicate based on standardized principles, properties, and constraints. REST APIs operate on a simple request/response system. You can send a request using these HTTP methods.
Hence REST is just an API (an interface that allows you to build on the data and functionality of another application) architectural style.
On the other hand, web service is a network-based resource that fulfills a specific task. Yes, there's overlap between the two: all web services are APIs, but not all APIs are web services.