Windows Scripting
  Home arrow Windows Scripting arrow Page 3 - 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 - Administrative Client Configuration


    (Page 3 of 4 )

    The client needs to know where the service is located and use the same binding as the service, and, of course, import the service contract definition. In essence, this is exactly the same information captured in the service’s endpoint. To reflect that, the client config file contains information about the target endpoints and even uses the same endpoint configuration schema as the host.

    Example 1-16 shows the client configuration file required to interact with a service whose host is configured according to Example 1-6.

    Example 1-16. Client config file

    <system.serviceModel>
      
    <client>
         
    <endpoint name = "MyEndpoint"
              address  = http://localhost:8000/MyService/
              binding  = "wsHttpBinding"
              contract = "IMyContract"
         
    />
      
    </client>
    </system.serviceModel>

    The client config file may list as many endpoints as the services it deals with support, and the client may use any one of them. Example 1-17 shows the client config file matching the host config file of Example 1-7. Note that each endpoint in the client config file has a unique name.

    Example 1-17. Client config file with multiple target endpoints

    <system.serviceModel>
       <client>
         
    <endpoint name = "FirstEndpoint"
             address  = "http://localhost:8000/MyService/
             binding  = "wsHttpBinding"
             contract = "IMyContract"
          />
         
    <endpoint name = "SecondEndpoint"
             address  = "net.tcp://localhost:8001/MyService/"
             binding  = "netTcpBinding"
             contract = "IMyContract"
         
    />
         
    <endpoint name = "ThirdEndpoint"
             address  = "net.tcp://localhost:8002/MyService/"
             binding  = "netTcpBinding"
             contract = "IMyOtherContract"
         
    />
       </client>
    </system.serviceModel>

    Binding configuration

    You can customize the client-side standard bindings to match the service binding in a manner identical to the service configuration, as shown in Example 1-18.

    Example 1-18. Client-side binding configuration

    <system.serviceModel>
       <client>
          <endpoint name = "MyEndpoint"
             address = "net.tcp://localhost:8000/MyService/"
            
    bindingConfiguration = "TransactionalTCP"
            
    binding  = "netTcpBinding"
             contract = "IMyContract"
          />
       </client>
       <bindings>
          <netTcpBinding>
             <binding name = "TransactionalTCP"
                transactionFlow = "true"
             />
          </netTcpBinding>
       </bindings>
    </system.serviceModel>

    More Windows Scripting Articles
    More By O'Reilly Media


       · 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