In this exercise you must program your own RESTful service provider, test it and publish it in Azure.
The service must provide information about students (and maybe other school related resources later ...)
In Visual Studio make a new project type WCF -> WCF Service Application (same type as you used for SOAP).
Add a Unit test project to the solution and make sure the Unit test project refers to the "main" project.
Create serviceBehavior
and endpointBehavior
for REST (not SOAP)
http://stackoverflow.com/questions/17644392/configuring-wcf-rest-services-in-web-config
serviceMetadata httpGetEnabled="false"
Now you should get into a set of small and quick (hopefully) iteration. In each iteration you must:
UriTemplate
) look like? Any parameters to the URI, like {id}
?RequestFormat
)? JSON or XML, or not necessary at all.ResponseFormat
)? JSON or XML, or not necessary at all.
private static readonly IList<Book> Books = new List<Book>();
Publish your service in Azure.
Don't forget to lower the .NET version to 4.0 to please Azure!?
Try the service using Postman.
Use WireShark to observe the requests and responses.
You already unit tested the methods of the implementing class.
Now you should do integration test: Make another test project and test the service running in Azure.
Refactoring: Skip the static collection and keep the data in a database hosted in Azure.
In Microsoft Team Services setup a build for your REST service.
Note on Setup a build server