WCF probe -21:WCF endpoint (endpoint)

Source: Internet
Author: User
Tags wsdl

WCF End Point Overview

    • In the example of the previous article, we were all the services that were published by configuring the service's endpoint (endpoint) for the client to invoke because all the traffic to the WCF service was through the endpoint of the service. Each endpoint (endpoint) consists of four properties.
    1. An address that indicates the location where the endpoint can be found.
    2. A binding that specifies how the client communicates with the endpoint.
    3. A contract that identifies the available operations.
    4. A set of behaviors that specify the local implementation details of the endpoint.

  

structure of the end point

    • WCF Service end point (endpoint) Communication Structure

  

    • end point (endpoint) the constituent content

  

End point Address

    • Each endpoint has an address associated with it, which is used to locate and identify the endpoint. This address primarily includes a Uniform Resource Identifier (URI) that specifies the location of the endpoint. The endpoint address is represented by the EndpointAddress class in the WCF programming model, which contains an optional identity property that allows the endpoint to be authenticated by other endpoints that Exchange messages with one endpoint, and a set of optional Headers Property (defines any other SOAP headers that are required to reach the service). The optional header provides additional, more detailed addressing information to identify or interact with the service endpoint. The address of the endpoint is represented on the network as a Ws-addressing endpoint reference (EPR). In WCF, EndpointAddress establishes the model of the endpoint reference (EPR) as defined in the Ws-addressing standard. The address URI for most transports contains the following four sections. For example, the URI "Http://www.wangweimutou.com:8888/demoservice.svc/demoEndpoint" has the following four parts:
    1. Scenario: http:
    2. Computer: www. Wangweimutou.com
    3. Port (optional): 8888
    4. Path:/demoservice.svc/demoendpoint

  

    • As part of the EPR model, each endpoint reference can contain reference parameters that add additional identifying information. In WCF, these reference parameters are modeled as instances of the Addressheader class. You can specify the endpoint address of a service declaratively by using code or by configuration. Defining endpoints in code is typically not a line, because the bindings and addresses of deployed services are often different from the bindings and addresses used when developing the service. In general, it is more feasible to use configurations to define service endpoints than to use code. By placing binding and addressing information outside of your code, you can change this information without recompiling and redeploying your application.
    • In WCF, there are two ways to specify a service endpoint address. You can specify an absolute address for each endpoint associated with the service, or you can supply a base address for the service's ServiceHost, and then specify one for each endpoint associated with the service (which is defined relative to this base address). You can use both procedures in your configuration or code to specify an endpoint address for a service. If you do not specify a relative address, the service uses base addresses. You can also specify multiple base addresses for a service, but for each transport protocol, only one base address is allowed per service. If there are multiple endpoints, each endpoint is configured with a different binding, and their addresses must be unique. Endpoints that use the same bindings but use different contracts can use the same address.

End point Bindings

    • Bindings specify the communication mechanism that is used when talking to the endpoint and indicate how to connect to the endpoint. Bindings contain three types of elements:
    1. A protocol channel binding element that determines the security, reliability, context flow settings, or user-defined protocol to use for messages sent to an endpoint.
    2. A transport channel binding element that determines the underlying transport protocol to use when sending messages to an endpoint, such as TCP or HTTP.
    3. A message encoding binding element that determines the network encoding to use for messages sent to an endpoint, such as text/xml, binary, or message transfer optimization mechanisms (MTOM).

    • System-supplied binding type

  

    • Binding Feature List

  

    • Description of the binding feature explanation

  

    • Binding Mode Selection Suggestions

  

  

Endpoint Contract

    • A service contract specifies what the endpoint communicates with the outside world. More specifically, it is a statement about a specific set of messages that are organized into basic message exchange patterns (MEP), such as request/reply, unidirectional, and duplex. If a service contract is a logically related set of message exchanges, then the service operation is a single message exchange. A service contract is a statement that provides information about the following:
    1. How the operations in the service are grouped.
    2. The signature of the various operations performed on the exchanged message.
    3. The data type of these messages.
    4. The location of the operation.
    5. The specific protocol and serialization format used to support successful communication with the service.

    • WCF services are message-based, and in order to communicate this information to applications on other platforms, including non-Microsoft platforms, XML service contracts expose representations in a standard XML format, such as Web Service Description Language (WSDL) and XML schemas (XSD) and other formats. Developers of many platforms can use this common contract information to create applications that can communicate with the service because they understand the language of the specification, and these languages support interoperability by describing the public forms, formats, and protocols that the service supports.
    • The contract can be expressed in a number of ways, although the WSDL and XSD languages are well suited to describe the service in an understandable way, but these languages are difficult to use directly-in any case, they can only describe the service, not the service contract implementation. Therefore, WCF applications use managed properties, interfaces, and classes to define the structure of the service and implement the service.
    • When required by a client or other service implementers (especially on other platforms), it is possible to convert (also referred to as "export") the resulting contract as defined in the managed type in the form of metadata (WSDL and XSD). The result is a simple programming model that can be used to describe the model to any client application using common metadata.

WCF probe -21:WCF endpoint (endpoint)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.