Click here to Skip to main content
15,891,473 members
Articles / Programming Languages / C#

How to Use a WCF Service without Adding a Service Reference or Proxy

Rate me:
Please Sign up or sign in to vote.
4.78/5 (16 votes)
28 Jun 2012CPOL5 min read 218.5K   3.2K   35  
Shows how you can loosely couple your WCF service.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Account_Register : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        RegisterUser.ContinueDestinationPageUrl = Request.QueryString["ReturnUrl"];
    }

    protected void RegisterUser_CreatedUser(object sender, EventArgs e)
    {
        FormsAuthentication.SetAuthCookie(RegisterUser.UserName, false /* createPersistentCookie */);

        string continueUrl = RegisterUser.ContinueDestinationPageUrl;
        if (String.IsNullOrEmpty(continueUrl))
        {
            continueUrl = "~/";
        }
        Response.Redirect(continueUrl);
    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
I am into Software Development since 1998. I have 12 +years of experience designing, developing and
Maintaining, applications and databases in corporate environments within Information Technology.
Strong experience with N-tier architecture, design, development, methodology, and Successfully
designed, developed and implemented Client/Server Systems, Intranet/Internet Applications and
databases utilizing C#, VB .Net , Visual Studio 2010 .NET, ASP.NET, MS SQL Server 2008, XML, IIS 7.5,
Windows 2003 and Windows XP. Expert in ASP.NET, WCF Service, WPF, Java Script, XML, HTML.

My skill Set: C#, VB.net ,ASP.NET, WCF, WPF, XML, JavaScript, SQL Server

Comments and Discussions