BrainDump
  Home arrow BrainDump arrow Page 4 - Generating Clients and Services with Indig...
Iron Speed
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Dedicated Servers 
Download TestComplete 
Windows Web Hosting
 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
IBM Rational Software Development Conference
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

Generating Clients and Services with Indigo
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-04-10

    Table of Contents:
  • Generating Clients and Services with Indigo
  • Configuring service endpoints using the Service Configuration Editor
  • Generating a proxy with Add Service Reference
  • Generating a proxy using the Service Model Metadata Utility

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    Iron Speed
     
    ADVERTISEMENT

    Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!

    Generating Clients and Services with Indigo - Generating a proxy using the Service Model Metadata Utility
    (Page 4 of 4 )

    In this section, you will generate a client proxy using the SvcUtil directly instead of using Add Service Reference. The purpose of this exercise is to show you how to exercise greater control over the generation of proxies and configuration settings.

    1. First, run theHostproject so that the endpoint is available to generate a proxy.

      From the Windows Start menu, find the Microsoft Visual Studio 2005 program group and launch the Visual Studio 2005 Command Prompt. Run the following command to generate a new proxy for the client application and replace the application configuration settings generated previously: 

        svcutil /d:<YourLearningWCFPath>\
      Labs\Chapter1\HelloIndigo\Client /o:
        serviceproxy.cs /config:app.config
      http://localhost:8000/HelloIndigo

      The output should look similar to Figure1-24.

      The/d:option for SvcUtil allows you to provide a path where output files will be generated. In the Preface, I explained that I would be using the term <YourLearningWCFPath> to refer to your base path--where you unzipped the file provided with the book. Thus, if your base path is c:\LearningWCF, then your SvcUtil command in this example would be: 

        svcutil /d:c:\LearningWCF\Labs\ Chapter1\HelloIndigo\Client   /o:serviceproxy.cs/config:app.config
        http://localhost:8000/HelloIndigo

      If your path includes spaces, such as c:\Learning WCF, then you will have to provide quotes to the path, as shown here:

        svcutil /d:"c\Learning WCF\Labs\ Chapter1\HelloIndigo\Client"   /o:serviceproxy.cs/config:app.config
      http://locahost:8000/
        HelloIndigo
    2. To use this proxy you'll have to modify the client application. Go to theClient project. If you select the "Show all files" icon in Solution Explorer, you'll see a new file beneath the project node. Right-click serviceproxy.cs and select "Include in Project." Right-click localhost.map beneath Service References and select "Exclude from Project."

      Now open Program.cs and modify the code that constructs the service proxy. The proxy that was generated does not belong to a namespace, so you must remove the fully qualified name forHelloIndigoServiceClient. The resulting code is:

        using (HelloIndigoServiceClient proxy = new HelloIndigoServiceClient())
    3. Compile and run the solution once again.

    Now let's examine some of the ideas introduced in this lab in greater detail.


    Figure 1-24.  Output generated when SvcUtil generates a service proxy and configuration settings for the client

    Please check back next week for the continuation of this article.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · This article is an excerpt from the book "Learning WCF A Hands-on Guide," published...
     

    Buy this book now. This article is excerpted from chapter 1 of the book Learning WCF A Hands-on Guide, written by Michele Leroux Bustamante (O'Reilly, 2007; ISBN: 0596101627). Check it out today at your favorite bookstore. Buy this book now.

    BRAINDUMP ARTICLES

    - Handling Multiple Contracts with Indigo
    - Cleaning Out Your Data in XP
    - Multiple Service Contracts and Indigo
    - Cleaning Out Your Programs in XP
    - Handling Metadata with Indigo
    - Building Blocks for a WCF Service Web Site
    - Help! I Need Some Remote Assistance
    - Using Service Templates with Indigo
    - Windows XP Tips for Task Manager
    - Generating Clients and Services with Indigo
    - Vista SP1, A Review
    - Services and the WCF
    - VBScript: Final Date Functions
    - Creating Services with the WCF
    - The Resource View of the MFC

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway