views:

136

answers:

2

I am aware of Web Services and WCF but I have generic question with services.

I have a ASP.NET MVC Application which does some basic functionality. I just have a controller in which I am passing it the records and serializing the information to XML using XML Serializer. Then I return this information to the browser and it displays me the XML i got from the Controller Action. So I get the XML representation of my Class(Database Object) in XML and I am to give the URL of this application to the client and access and pull the information.

Is this a Service then?

I mean in the end all the Clients need is the Xml representation through services also right? I am not that experienced and probably being very silly but please help me out...if I provide xml this way to the client is that a Service? Or is there something I need to understand here?

+2  A: 

Yes, it is a service, returning an XML resource. Also it seems that it is accessible throught standard HTTP verbs such as GET, so one might assume it is RESTful. The difference with a standard SOAP XML service is that you don't have a WSDL that describes it, so you might need to provide a good documentation to clients wishing to consume your service.

Darin Dimitrov
+3  A: 

Don't let all the buzz about "web services" fool you; the basic idea behind a web service is very, very simple. It is simply a matter of providing data in response to a request over standard web transport protocols (i.e., HTTP/HTTPS). Everything else (XML, SOAP, WSDL, etc.) is just layered technology to augment the basic functionality of a service. REST-based services are very basically the simplest services that you can build--they are built on the core HTTP/S transport protocol and not much else.

The main differentiator between a service and traditional web site is that a service is data-focussed rather than presentation-focussed; that is, services typically are not concerned with how data is formatted and displayed (that is up to the client), but rather what data is returned. So...you are delivering XML data over HTTP? Check. You have a service. Congratulations!

Ken Taylor
Actually REST based architectures require a bit more than just XML data over Http. There are requirements for the message to be self-descriptive and for the application state to be driven by hypertext. This site http://nordsc.com/ext/classification_of_http_based_apis.html has a good table which shows the distinctions.
Darrel Miller
@Darrel Agreed; this is over-simplification as a reaction to the widespread over-complication running rampant out there. (But isn't that what REST is all about?) :-) I'd still feel comfortable calling Robert's app a "service", though you are correct in pointing out that the semantics of a RESTful architecture are a little more invovled (even though the implementation is not).
Ken Taylor
@Ken Yeah, I have no problems with the use of the term service in this case. However, I'm actually starting to shy away from using the the term service when talking about REST systems as it tends to put all the emphasis on the server and not on the client. It doesn't matter how RESTful the service is, if the client does not play by the rules you will not derive the benefits of a RESTful system.
Darrel Miller