Skip to main content

Posts

WCF REST pt 1 service

Create a RESTful WCF Service  1. Open Visual Studio, click File  >  New  >  Project   2. S elect  WCF Service Library  template under  Visual C# > WCF  templates 3. Change the name to StudentServiceLibrary  and click  OK 4. Visual studio will add reference to System.ServiceModel, System.Runtime.Serialization and will add some files with sample code.  5. Delete IService1.cs and Service1.cs 6. Add reference to System.ServiceModel.Web 7. Add a new class called StudentService Adding Data Contract  8. Open StudentService.cs file that you created and add the following code using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; 9. Add the following code in the StudentService.cs class namespace StudentServiceLibrary {     [ DataContract ] ...

WCF Service Client

Open WCF service host project that you created OR create one based on instructions here . Add a new project to the current solution: Right click Solution on Solution Explorer > Add > Add New Project Select Console Application template under Visual C# > Windows templates Change the project name to ConsoleClient and click OK In Solution Explorer, under ConsoleClient project, right click References and select Add Service Reference...  In the Add Service Reference dialog, click Discover button. This should bring you the Mex address of the service. If not, you may have to copy the endpoint address from the ConsoleHost's App.config file and click go.  Now you should see the ProductService in Services section. Change the default name in Namespace textbox to ProductReference and click OK.   Doing the above will update the references and also App.config file. In the Program.cs file, add using System.ServiceModel; and  using ConsoleClient.ProductReference;...

WCF Service Host

Open Visual Studio Open WCF service project that you created OR create one based on instructions here . Add a new project to the current solution: Right click Solution on Solution Explorer > Add > Add New Project Select Console Application template under Visual C# > Windows templates Change the project name to ConsoleHost and click OK In Solution Explorer, under  ConsoleHost project, right click References and select Add Reference...   In the Reference Manager window, add reference to  System.ServiceModel  and to ProductServiceLibrary solution Add using System.ServiceModel; Add   using  ProductServiceLibrary; Add the following code in Program.cs file class Program     {         static void Main(string[] args)         {             ServiceHost host = new ServiceHost(typeof(ProductService));             try ...

WCF service

Create a WCF Service library project 1. Open Visual Studio, and Select File > New > Project 2. Select WCF Service Library  template under Visual C# > WCF  templates 3. Change the name to StudentServiceLibrary  and click OK 4. Visual studio will add reference to System.ServiceModel and System.Runtime.Serialization and will add some files with sample code.  5. Delete IService1.cs and Service1.cs 6. Add a new class called StudentService Create the Data Contract  7. Open StudentService.cs file that you created. 8. Add using System.ServiceModel; 9. Add using System.Runtime.Serialization; 10. Add the following code in the StudentService.cs class using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.Text; using System.Threading.Tasks; namespace StudentServiceLibrary {   ...
C# for Java Developers Here is a useful C# resource for Java developers Syntactical difference between Java and C# - http://harding.edu/fmccown/java_csharp_comparison.html

Better grades with great looking reports

Introduction Making a good first impression on your reader takes some effort and can influence your grades to a certain extent. Although the content of your essay is of highest importance, the formatting and organization of your essay does influences your reader and makes a first impression.    So, putting some efforts on formatting is highly recommended. In this tutorial, we look at few quick tips that improve the readability of your documents and make it look professional. Adding a Table of Content Table of content (TOC) helps the reader to quickly understand how the author has organized her work and allows the reader to quickly access the information that the reader needs. Further, this helps the marker to the compare the grading criteria with work of the author. To use the Microsoft Word’s, Automatic TOC functionality, you have to first format the chapter headings and sub headings using Heading styles.    Heading Styles Highlight chapter heading a...