Book Image

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By : Mike Liu
Book Image

WCF Multi-layer Services Development with Entity Framework - Fourth Edition

By: Mike Liu

Overview of this book

Table of Contents (20 chapters)
WCF Multi-layer Services Development with Entity Framework Fourth Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
2
Hosting the HelloWorld WCF Service
Index

Testing the RESTful WCF service with a JavaScript client


In the previous sections, we created a C#/XAML client to call the RESTful WCF service from the code behind C# class. In the next sections, we will create a JavaScript client to call the RESTful WCF service. We will first call the service using jQuery and then using WinJS.

Creating the JavaScript client

You can follow these steps to create the JavaScript client:

  1. From the Solution Explorer, right-click on the solution item and add a new project. Choose JavaScript | Store Apps | Windows Apps | Blank App (Windows) as the template, change the name to RESTNorthwindClientJS, and leave the location to be the default one (C:\SOAwithWCFandEF\Projects\RESTNorthwind).

  2. Again, you might be prompted to get a developer's license to create a Windows app. Just follow the instructions to get a new one or renew an existing one and then continue.

  3. Now, first add some HTML controls to the default page. Just open the default.html file and replace the body node...