BrainDump
  Home arrow BrainDump arrow 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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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


    Handling Metadata with Indigo


    (Page 1 of 4 )

    In this eighth part of a ten-part series on the Windows Communication Foundation (WCF), aka Indigo, you'll learn how to browse and export metadata. 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). Copyright © 2007 O'Reilly Media, Inc. All rights reserved. Used with permission from the publisher. Available from booksellers or direct from O'Reilly Media.

    Browsing service metadata

    In this part of the lab, you'll make changes to the configuration file so that metadata can be viewed in a browser.

     

     


    Figure 1-25.  Creating a new web site with the WCF Service template


    Figure 1-26.  Solution Explorer view of a new web site based on the WCF Service template

    1. Before making any changes, test the web endpoint in a browser. Go to Solution Explorer and right-click on the web site project node; select "Set as Startup Project." Run the web site from within Visual Studio (F5). This launches the service endpoint located at http://localhost/IISHostedService/Service.svc in a browser. What you should see is a web page indicating that metadata publishing has been disabled for the service.
    2. Add metadata support to the service model configuration for the web site. Open the web.config file and modify the previously generated service behavior to add the<serviceMetadata>behavior. You will also add a metadata exchange endpoint for the service. The changes are shown in bold in Example1-14.

      Example 1-14. Adding metadata browsing support to the web host

      <system.serviceModel>
        <services>
          <service name="HelloIndigo.HelloIndigoService" behaviorConfiguration="returnFaults"> 
            <endpoint contract="HelloIndigo.IHelloIndigoService" binding="basicHttpBinding"/>
            <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"
      />
          </service>
       </services>
       <behaviors>
         <serviceBehaviors>
           <behavior name="returnFaults">
             <serviceDebug includeExceptionDetailInFaults="true"/>
            <serviceMetadata/>
         
      </behavior>
         </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    3. Run the web site again (F5). This time you should see the service help page in the browser, providing some instructions for SvcUtil. Leave the browser running and return to Visual Studio.
    4. Without restarting the host, you're going to make a change that enables HTTP GET access to the service metadata. Open the web.config file and sethttpGetEnabledtotrue for the<serviceMetadata>behavior:

        <behavior name="serviceBehavior">  
          <serviceMetadata httpGetEnabled="true"/>
        </behavior>


      Save this change and return to the browser instance showing the service help page.
    5. Refresh the browser (F5) to see what has changed. This time, you should observe the SvcUtil instruction has an active link with a
      ?wsdl suffix after the service endpoint (see Figure 1-27). Click the link, and you'll be taken to the WSDL document for the service (see Figure 1-28).

    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

    - Introduction to Office Live Workspace
    - Using MS Excel for One-way Analysis of Varia...
    - Comparing Data Sets Using Statistical Analys...
    - Import Blogger Posts into WordPress Using Wi...
    - Download WordPress from an FTP Server and Ru...
    - Install and Run WordPress in XAMPP Local Host
    - What Windows 7 Brings to the Table
    - Virtualization and Sandbox Detection
    - Advanced Firebug Techniques in Windows XP Ho...
    - Editing CSS with Firebug in Windows XP Home
    - Using Firebug in Windows XP Home
    - Migrating to Exchange Server 2007
    - Using System Restore on a Non-Bootable PC
    - Finding Logged on Users and More Scripting S...
    - Developing Macro Commands in MS Excel





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 6 Hosted by Hostway
    Stay green...Green IT