BrainDump
  Home arrow BrainDump arrow Page 2 - Handling Metadata with Indigo
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 
Actuate Whitepapers 
Moblin 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 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

Handling Metadata with Indigo
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-05-01

    Table of Contents:
  • Handling Metadata with Indigo
  • Exporting metadata for proxy generation
  • Web Site Templates
  • Browsing and Exporting Metadata

  • 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
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Handling Metadata with Indigo - Exporting metadata for proxy generation


    (Page 2 of 4 )

    In this part of the lab, you will export the service metadata to a set of files that can later be distributed and used to generate a proxy, offline. The files exported will be WSDL documents.

    1. Launch the Visual Studio 2005 Command Prompt. Run the following command to instruct SvcUtil to export the service metadata and its associated schemas for theHelloIndigoService:

        svcutil
      /d:<YourLearningWCFPath>\Labs\Chapter1\IISHostedService /t:metadata http:
        //localhost/IISHostedService/service.svc


      This will generate two .wsdl files and two .xsd files in the solution directory.


      Figure 1-27.  Browsing to the service help page with metadata browsing enabled
    2. Use these files to generate the application configuration and proxy required for clients to consume the service. In the same command window, execute the following command:

        svcutil
      /d:<YourLearningWCFPath>\Labs\Chapter1\IISHostedService\Client /o:
        serviceproxy.cs /config:app.config <YourLearningWCFPath>\Labs\Chapter1\
        IISHostedService\*.wsdl <YourLearningWCFPath>\Labs\Chapter1\IISHostedService\*.
        xsd


      The result of this command will be serviceproxy.cs and app.config files generated for the client application.
    3. Add the two files just generated to the client project. The proxy and configuration will be used to invoke the service hosted in IIS. Go to theClientproject and refresh the file list in Solution Explorer. You should see the two new files appear; include them in the project.
    4. Invoke the service using the generated proxy. Open Program.cs in the code window and modify theMain()entry point adding code to create a proxy and invoke theHelloIndigo()operation. The resulting additions are shown in bold in Example1-15.
    5. Compile and run theClientproject. The output should be similar to that in earlier labs.


    Figure 1-28.  Browsing to the dynamically generated WSDL document

    Example 1-15. Invoking a service hosted in IIS through its proxy

    static void Main(string[] args)
    {
     
    HelloIndigoServiceClient proxy = new HelloIndigoServiceClient()
      string s = proxy.HelloIndigo();
      Console.WriteLine(s);
      Console.WriteLine("Press <ENTER> to terminate Client.");
      Console.ReadLine();
    }

    More BrainDump Articles
    More By O'Reilly Media


       · 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 one 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

    - Making Your First Active X Control in Visual...
    - Codes and Packages in Microsoft Project 2007
    - Windows 7: Rumors and Demos
    - XP SP3 Why Me?
    - Breaking Up Your Work in Microsoft Project
    - Breaking Work into Task-Sized Chunks
    - Putting Microsoft`s Worldwide Telescope Unde...
    - 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





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