Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Implementing a RESTful service using WCF 4.5

    • 0
    • 2
    • 0
    • 0
    • 1
    • 0
    • 1
    • 0
    • 341
    Comment on it

    Hello coders, In this article we are going to implement a RESTful service using WCF4.5.
    Note: WCF stand for Windows Communication Foundation
    Please follow the below steps to implement a RESTful service.
    Step 1: Open visual studio/New project/WCF/WCF Service Application. See screen shot WcfService2.jpg.
    Step 2: Add below line to your method as mine:-

    > [WebInvoke(Method = "POST", UriTemplate = "/GetDataUsingDataContract", ResponseFormat= WebMessageFormat.Json, RequestFormat=WebMessageFormat.Json)]
    > CompositeType GetDataUsingDataContract(CompositeType composite);
    

    Step 3: Open your web.config file and set your service end point and ServiceBeharior as below:

    <services>
    <service name="WcfDemo.Service1" behaviorConfiguration="Service1Behavior">
    <endpoint address="" binding="basicHttpBinding" contract="WcfDemo.IService1"></endpoint>
    </service>
     <behavior name="Service1Behavior">
    <!-- To avoid disclosing metadata information, set the values below to false before deployment --><serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
     <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
    

    These are the basic steps to implement RESTfull web service.

    Happy coding.

    Implementing a RESTful service using WCF 4.5

 1 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: