Join Ours Forum

Asp.Net,C#,Ajax,Sql server,Silverlight,WCF,WPF,NHibernate,Javascript codes exambles articles,Programming exambles.



-->
  • .NET Matters: Asynchronous HttpWebRequests, Interface Implementation, and More
  • Editor’s Note: New Technologies and a New Magazine
  • .NET Interop: Getting Started With IronRuby And RSpec, Part 1
  • Smart Client: Building Distributed Apps with NHibernate and Rhino Service Bus
  • Editor’s Note: Best Practices
  • New Stuff: Resources for Your Developer Toolbox
  • Data Points: LINQ Projection Queries and Alternatives in WCF Services
  • Concurrent Affairs: Solving The Dining Philosophers Problem With Asynchronous Agents
  • DCOM Interop: Generate Custom Managed C++ Wrappers for Easier COM Interoperation Using DCOMSuds
  • Editor’s Note: I Am The Business
  • Top 10 Articles,


    Silverlight Datagrid Select Update Delete Insert Asp.Net C#

    Differences Similarities Benefits Between Typed Datasets and Untyped Datasets asp.net c#

    Linq to Sql Introduction Entities Ado.Net C# SqlClasses Attributes Linq Mapping

    Linq Programming/How Linq Works?/Linq Implementation In Asp.Net C# Ado.Net

    Performing Developing Using Investigating Asp.Net 2.0 Ajax Application Development Asp.Net C#

    Hosting/Install Wcf Services in a Windows Service Asp.Net C#

    Connecting Silverlight to Wcf Asp.Net C#

    Silverlight Data Grid Data Binding WCF Asp.Net C#

    Invoking/Accessing/Calling WCF Service Without Adding/Creating Proxy/Reference Asp.Net C#

    Performing Doing Creating Insert Update Delete sql data Using Linq Database Asp.Net C#

    Invoking/Accessing/Calling WCF Service Without Adding/Creating Proxy/Reference Asp.Net C#

    Introduction:
    In this article,i am going to explain about how to access a wcf service with adding the service reference.

    Main:
    We can easily perform this task using channel factory.A channelfactory is a class that helps us to
    creates channels of different types that are used by clients to send messages to variously configured
    service endpoints.

    Demonstration:

    1.make a wcf service is hosted and running,

    2.Declare the same interface in client side,

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.ServiceModel;
    using System.ServiceModel.Channels;
     
    using NetTcpLibarary;
     
    namespace NetTcpClient
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
     
            [ServiceContract]
            interface INetTcpService
            {
                [OperationContract()]
                DataSet ReturnEmpDetails(int EmpId);            
            }
     
     
            private void Form1_Load(object sender, EventArgs e)
            {
     
                NetTcpBinding basicHttpBinding = new NetTcpBinding();
                EndpointAddress endpointAddress = new EndpointAddress
                  ("net.tcp://localhost:8000/TcpBinding");
     
                IChannelFactory<INetTcpService> channelFactory =
    new ChannelFactory<INetTcpService>(basicHttpBinding);
     
     
               // IChannelFactory<INetTcpService> local_channelfactory =
                 //    new IChannelFactory<INetTcpService>(basicHttpBinding);
     
                INetTcpService proxy = channelFactory.CreateChannel(endpointAddress);
     
                DataSet local_ds = proxy.ReturnEmpDetails(5303);
     
                if (local_ds.Tables[0].Rows.Count > 0)
                {
                    MessageBox.Show(local_ds.Tables[0].Rows[0].ItemArray[0].ToString());
     
                }
     
                //dataGridView1.DataSource = local_ds;
               // dataGridView1.DataBindings();         
     
     
            }
        }
    }

    Thantsit!

    Learn Easily Using Video Tutorials


    How to choose the right Java IDE – explained Eclipse NetBeans BlueJ

    Developing/Creating/Performing/Configuring Java Applications Using Eclipse IDE

    Step By Step Guide for Download/Install Configure Eclipse IDE for Java

    Editing data with the GridView control Asp.Net C#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Registering/Configuring Web Controls globally in web.config file asp.net c#

    Best way to prepare asp.net Interview - Success Stories

    Download Important Questions and PPT's:

    Sql Server Important Questions Online free download

    Dotnet Important Questions Online free download

    Exploring Linq to Sql Process Flow

    Learn how to perform silverlight programming

    Learn OOPs concepts in better and well manner

    Learn Ajax in better and well manner

    Leave a comment

    1 Comments.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    *


    You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

    Trackbacks and Pingbacks:

    Social Buttons by Linksku