Windows Scripting
  Home arrow Windows Scripting arrow Page 2 - 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

WCF Essentials
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 3
    2007-09-20

    Table of Contents:
  • WCF Essentials
  • Addresses
  • Contracts
  • Applying the ServiceContract attribute

  • 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


    WCF Essentials - Addresses


    (Page 2 of 4 )

    In WCF, every service is associated with a unique address. The address provides two important elements: the location of the service and the transport protocol or transport schemaused to communicate with the service. The location portion of the address indicates the name of the target machine, site, or network; a communication port, pipe, or queue; and an optional specific path or URI. A URIis a Universal Resource Identifier, and can be any unique string, such as the service name or a GUID.

    WCF 1.0 supports the following transport schemas:

    1. HTTP
    2. TCP
    3. Peer network
    4. IPC (Inter-Process Communication over named pipes) 
    5. MSMQ

    Addresses always have the following format:

      [base address]/[optional URI]

    The base address is always in this format:

      [transport]://[machine or domain][:optional port]

    Here are a few sample addresses:

      http://localhost:8001
      http://localhost:8001/MyService
      net.tcp://localhost:8002/MyService
      net.pipe://localhost/MyPipe
      net.msmq://localhost/private/MyService
      net.msmq://localhost/MyService

    The way to read an address such as

      http://localhost:8001

    is like this: “Using HTTP, go to the machine called localhost, where on port 8001 someone is waiting for my calls.”

    If there is also a URI such as:

      http://localhost:8001/MyService

    then the address would read as follows: “Using HTTP, go to the machine called localhost, where on port 8001 someone calledMyServiceis waiting for my calls.”

    TCP Addresses

    TCP addresses use net.tcpfor the transport, and typically include a port number such as:

      net.tcp://localhost:8002/MyService

    When a port number is not specified, the TCP address defaults to port 808:

      net.tcp://localhost/MyService

    It is possible for two TCP addresses (from the same host, which will be discussed more later on in this chapter) to share a port:

      net.tcp://localhost:8002/MyService
      net.tcp://localhost:8002/MyOtherService

    TCP-based addresses are used throughout this book.

    You can configure TCP-based addresses from different hosts to share a port.

    HTTP Addresses

    HTTP addresses use httpfor transport, and can also usehttpsfor secure transport. You typically use HTTP addresses with outward-facing Internet-based services, and can specify a port such as:

      http://localhost:8001

    When the port number is unspecified, it defaults to 80. Similar to TCP addresses, two HTTP addresses from the same host can share a port, even on the same machine.

    HTTP-based addresses are also used throughout this book.

    IPC Addresses

    IPC addresses use net.pipefor transport, to indicate the use of the Windows named pipe mechanism. In WCF, services that use named pipes can only accept calls from the same machine. Consequently, you must specify either the explicit local machine name orlocalhostfor the machine name, followed by a unique string for the pipe name:

      net.pipe://localhost/MyPipe

    You can only open a named pipe once per machine, and therefore it is not possible for two named pipe addresses to share a pipe name on the same machine.

    IPC-based addresses are used throughout this book.

    MSMQ Addresses

    MSMQ addresses use net.msmqfor transport, to indicate the use of the Microsoft Message Queue (MSMQ). You must specify the queue name. When you’re dealing with private queues, you must specify the queue type, but that can be omitted for public queues:

      net.msmq://localhost/private/MyService
      net.msmq://localhost/MyService

    Chapter 9 is dedicated to making queued calls.

    Peer Network Address

    Peer network addresses use net.p2pfor transport, to indicate the use of the Windows peer network transport. You must specify the peer network name as well as a unique path and port. Using and configuring peer networks is beyond the scope of this book, and you will see very little mention of peer networks in subsequent chapters.

    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 Programming WCF Services, written by Juval Lowry (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 5 hosted by Hostway
    Stay green...Green IT