11.07.2015 Views

y - Net Developer

y - Net Developer

y - Net Developer

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 3 ■ EXPLORING THE WCF PROGRAMMING MODEL 55ramrameshreddy.blog.comTable 3-1. Addressing SpecificationsAddress SectionTransport schemeMachinenamePortPathDescriptionThis defines the transport protocol (or scheme).This specifies the fully qualified domain name of the machine.The port is an optional field and is specified as :port. Port 80 is thedefault for HTTP addresses.The path is the specific path to the service. You can define paths asnames of directories separated by a forward slash. For example,/Stock/GetQuote is the path in the following address: http://localhost:8080/Stock/GetQuote.So, the format of a service address is as follows:scheme://[:port]/path1/path2As you can see, it is similar to a URL of a website. scheme can be any type of supportedtransport, machinename is the server name, port is the port where the service is listening, andpath is essentially to differentiate services running on the same machine.WCF supports several protocols, and each has its own particular addressing format. WS-Addressing is essential when WCF services use protocols other than HTTP. The foundation of aservice is the SOAP protocol, which defines a basic message structure for simple (remote)object access containing an extensible envelope structure with a header and a body. In a SOAPmessage, endpoints are expressed as WS-Addressing endpoint reference constructs. With WS-Addressing you can also add specific headers inside the SOAP message that defines wheremessage replies should go (if applicable in the used messaging exchange pattern).Addressing HTTPServices can be hosted in different ways, as you’ll learn more about in Chapter 5. HTTP servicescan be either self-hosted or hosted on Internet Information Services (IIS). Whenaddressing an HTTP service in a self-hosted scenario, you use the following format:http://localhost:8080/QuickReturns/ExchangeWhen SSL is required, you can replace http with https. In a WCF configuration, you canset the HTTP address as follows:ramrameshreddyramrameshreddyWe’ll cover the bindingsSectionName and contract attributes of the endpoint node in thefollowing sections.■Note It is common to add versioning directives to the path of a service address. You can version theaddress like this: http://localhost:8080/QuickReturns/Stock/v1/GetQuote.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!