Windows Scripting
  Home arrow Windows Scripting arrow Page 4 - Metadata and WCF Essentials
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 
Mobile Linux 
App Generation ROI 
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? 
WINDOWS SCRIPTING

Metadata and WCF Essentials
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2007-10-11

    Table of Contents:
  • Metadata and WCF Essentials
  • The Metadata Explorer
  • Administrative Client Configuration
  • Client-Side Programming

  • 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


    Metadata and WCF Essentials - Client-Side Programming


    (Page 4 of 4 )

    Generating the client config file

    By default, SvcUtil also auto-generates a client-side config file called output.config. You can specify a config filename using the /config switch:

      SvcUtil http://localhost:8002/MyService/ /out:Proxy.cs
    /config:App.Config

    And you can suppress generating the config file using the/noconfigswitch:

      SvcUtil http://localhost:8002/MyService/ /out:Proxy.cs
    /noconfig

    I recommend never letting SvcUtil generate the config file. The reason is that it generates fully articulated binding sections that often just state the default values, which tends to clutter the config file.

    In-proc configuration

    With in-proc hosting, the client config file is also the service host config file, and the same file contains both service and client entries, as shown in Example 1-19.

    Example 1-19. In-proc hosting config file

    <system.serviceModel>
      
    <services>
         
    <service name = "MyService">
            
    <endpoint
               
    address  = "net.pipe://localhost/MyPipe"
               
    binding  = "netNamedPipeBinding"
               
    contract = "IMyContract"
             />
        
     </service>
       </services>
       <client>
         
    <endpoint name = "MyEndpoint"
            
    address  = "net.pipe://localhost/MyPipe"
            
    binding  = "netNamedPipeBinding"
            
    contract = "IMyContract"
          />
       </client>
    </system.serviceModel>

    Note the use of the named pipe binding for in-proc hosting.

    The SvcConfigEditor

    WCF provides a config file editor called SvcConfigEditor.exethat can edit both host and client configuration files (see Figure 1-10). You can also launch the editor from within Visual Studio by right-clicking on the configuration file (both the client and the host files) and selecting Edit WCF Configuration.

    I have mixed feelings about SvcConfigEditor. On the one hand, it edits the config files nicely and it saves developers the need to know the configuration schema. On


    Figure 1-10.  SvcConfigEditor is used to edit both host and client config files

    the other hand, it does not save the need to thoroughly understand WCF configuration, and for the most part, the light editing done in a config file is faster by hand than editing using Visual Studio 2005.

    Please check back next week for the conclusion to 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 "Programming WCF Services," published by...
     

    Buy this book now. This article is excerpted from chapter one of the book Programming WCF Services, written by Juval Lowy (O'Reilly, 2007; ISBN: 0596526997). Check it out today at your favorite bookstore. Buy this book now.

    WINDOWS SCRIPTING ARTICLES

    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH
    - Advanced Word Object Scripting
    - Reading and Printing Word Documents in WSH
    - Scripting Microsoft Word
    - Using WSH to Catalog MP3 Files
    - Reading MP3 ID3 Tags in WSH
    - A Brief Look at Menus in WPF
    - More Examples of Simplified Image Processing...
    - Completing a WPF To-Do List Application
    - Simplified Image Processing in GDI+





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT