Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3491346
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:37:33+00:00 2026-05-18T11:37:33+00:00

I have been going through the book Learning WCF trying to get my head

  • 0

I have been going through the book “Learning WCF” trying to get my head around creating and using WCF web services. The first part of the book walks the reader through creating and then consuming a simple “Hello World” web service.

The problem I am having is that the client application seems to have no know the structure of the WCF Interface when calling it. How can this be necessary if a web service could be called from any number of programming languages?

I have listed the relevant example code below …

Here is the code for the Interface

 [ServiceContract(Namespace="http: //www.thatindigogirl.com/samples/2006/06")]
 public interface IHelloIndigoService
 {
  [OperationContract]
  string HelloIndigo();
 }

Here is the code for the Service that hosts the web service

static void Main(string[] args)
{
  using (ServiceHost host = new ServiceHost(typeof(HelloIndigo.HelloIndigoService) ,
    new Uri("http: //localhost: 8000/HelloIndigo")))
  {
    host. AddServiceEndpoint(typeof(HelloIndigo. IHelloIndigoService) ,
      new BasicHttpBinding(), "HelloIndigoService");
    host. Open( );
    Console. WriteLine("Press <ENTER> to terminate the service host") ;
    Console. ReadLine();
  }
}

Here is the code for the client app that consumes the WCF service
This is where I get confused. Since this client application could be any language capable of calling a web service why is there a necessity of knowing the definition of the interface?

using System. ServiceModel;
[ServiceContract(Namespace = "http: //www.thatindigogirl.com/samples/2006/06")]
public interface IHelloIndigoService
{
  [OperationContract]
  string HelloIndigo( );
}

static void Main(string[ ] args)
{
 EndpointAddress ep = new
   EndpointAddress("http: //localhost: 8000/HelloIndigo/HelloIndigoService") ;
 IHelloIndigoService proxy = ChannelFactory<IHelloIndigoService>.
   CreateChannel(new BasicHttpBinding(), ep);

 string s = proxy. HelloIndigo();
 Console. WriteLine(s) ;
 Console. WriteLine("Press <ENTER> to terminate Client.") ;
 Console. ReadLine();
}

Am I missing an important point here? Perhaps my understanding of what is needed to consume a web is lacking. My goal is to be able to use WCF to create a .NET service that could be called from any programming language or environment.

Might anyone suggest a good tutorial on creating “cross platform consumable” web services from within .NET? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:37:34+00:00Added an answer on May 18, 2026 at 11:37 am

    This approach is based on shared interface (the book acutally does not share the interface but instead it uses local copy) and is successfully applied in environment where both client and server are written in .NET. This approach is not usable for interoperability or SOA solutions.

    Other approach uses metadata exposed by the service. Metadata are defined as WSDL document plus several XSD documents. These metadata files are way to provide information about your service to both .NET and non .NET developers. The book contains definition of Metadata (mex) endpoint so you will definitely read about that.

    Using metadata in .NET means creating service proxy. You can do it automatically using Visual studio’s Add service reference or command line utility svcutil.exe. Anyway generated proxy code will probably still contain the interface created from metadata. It is used to create transparent abstraction of the service for the client.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been going through this tutorial on auto-populating boxes using jQuery and Ajax:
I have been tasked with going through a number of ColdFusion sites that have
I have been using C# for a while now, and going back to C++
I have been working on a web services related project for about the last
I've been going through the book The Definitive Guide to Grails (Rocher/Brown) and in
I'm trying to learn ruby on rails. I've been going through a tutorial, but
I have been going through the docs and source code looking for something without
Ive been trying to sort out output using AWK, and have been pretty successful
I have been going up and down through all kinds of reference docs and
I have been struggling with this all day and have tried going through the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.