[原创]我的WCF之旅(2):Endpoint Overview

WCF实际上是构建了一个框架,这个框架实现了在互联系统中各个Application之间如何通信。使得Developers和Architect在构建分布式系统中,无需在考虑如何去实现通信相关的问题,更加关注与系统的业务逻辑本身。而在WCF Infrastructure中,各个Application之间的通信是由Endpoint来实现的。

Endpoint的结构

Endpoint包含以下4个对象:

  • Address: Address通过一个URI唯一地标识一个Endpoint,并告诉潜在的WCF service的调用者如何找到这个Endpoint。所以Address解决了Where to locate the WCF Service?
  • Binding: Binding实现在Client和Service通信的所有底层细节。比如Client与Service之间传递的Message是如何编码的——text/XML, binary,MTOM;这种Message的传递是采用的哪种Transport——TCP, Http, Named Pipe, MSMQ; 以及采用怎样的机制解决Secure Messaging的问题——SSL,Message Level Security。所以Binding解决的是How to communicate with service?
  • Contract: Contract的主要的作用是暴露某个WCF Service所提供的所有有效的Functionality。从Message Exchange的层面上讲,Contract实际上是抱每个Operation转化成为相对应的Message Exchange Pattern——MEP(Request/Response; One-way; Duplex)。所以Contract解决的是What functionalities do the Service provide?
  • Behavior: Behavior的主要作用是定制Endpoint在运行时的一些必要的Behavior。比如Service 回调Client的Timeout;Client采用的Credential type;以及是否支持Transaction等。

当我们Host一个WCF Service的时候,我们必须给他定义一个或多个Endpoint,然后service通过这个定义的Endpoint进行监听来自Client端的请求。当我们的Application需要调用这个Service的时候,因为Client 和Service是通过Endpoint的进行通信的, 所以我们必须为我们的Application定义Client端的Endpoint。只有当Client的Endpoint和Service端某个Endpoint相互匹配(Service端可以为一个Service定义多个Endpoint),Client端的请求才能被Service端监听到。也就是说,我们只有在Client具有一个与Service端完全匹配的Endpoint,我们才能调用这个Service。而这种匹配是比较严格的,比如从匹配Address方面,Client端和Service端的Endpoint Address不仅仅在URI上要完全匹配Service, 他们的Headers也需要相互匹配。对于Binding, 一般地,Client需要有一个与Service端完全一样的Binding,他们之间才能通信。

Sample

首先给一个Sample,以便我们对在WCF Service Aplication中如何定义Endpoint有一个感性的认识。整个Solution的结构参照下图,我的上一篇Blog([原创]我的WCF之旅(1):创建一个简单的WCF程序 )中有详细的介绍。你也可以通过后面的Link下载相应的Source Code(http://www.cnblogs.com/files/artech/Artech.WCFService.zip

[原创]我的WCF之旅(2):Endpoint Overview
1.Service Contract:Artech..WCfService.Contract/ServiceContract/IGeneralCalculator.cs

[原创]我的WCF之旅(2):Endpoint OverviewusingSystem;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Collections.Generic;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Text;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.ServiceModel;
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
namespaceArtech.WCFService.Contract
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview[ServiceContract]
[原创]我的WCF之旅(2):Endpoint Overview
publicinterfaceIGeneralCalculator
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview[OperationContract]
[原创]我的WCF之旅(2):Endpoint Overview
doubleAdd(doublex,doubley);
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview

2. Service: Artech.WCFSerice.Service/GeneralCalculatorService.cs

[原创]我的WCF之旅(2):Endpoint OverviewusingSystem;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Collections.Generic;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Text;
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
usingArtech.WCFService.Contract;
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
namespaceArtech.WCFService.Service
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
publicclassGeneralCalculatorService:IGeneralCalculator
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
IGeneralCalculatorMembers#regionIGeneralCalculatorMembers
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
publicdoubleAdd(doublex,doubley)
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
returnx+y;
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
#endregion

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview


3. Hosting: Artech.WCFService.Hosting/Program.cs

[原创]我的WCF之旅(2):Endpoint OverviewusingSystem;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Collections.Generic;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Text;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.ServiceModel;
[原创]我的WCF之旅(2):Endpoint Overview
usingArtech.WCFService.Contract;
[原创]我的WCF之旅(2):Endpoint Overview
usingArtech.WCFService.Service;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.ServiceModel.Description;
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
namespaceArtech.WCFService.Hosting
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
classProgram
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
staticvoidMain(string[]args)
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
//HostCalculatorServiceViaCode();
[原创]我的WCF之旅(2):Endpoint Overview
HostCalculatorSerivceViaConfiguration();
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
/**////<summary>
[原创]我的WCF之旅(2):Endpoint Overview
///Hostingaserviceusingmanagedcodewithoutanyconfiguraitoninformation.
[原创]我的WCF之旅(2):Endpoint Overview
///Pleasenotethattherelatedconfigurationdatashouldberemovedbeforecallingthemethod.
[原创]我的WCF之旅(2):Endpoint Overview
///</summary>

[原创]我的WCF之旅(2):Endpoint OverviewstaticvoidHostCalculatorServiceViaCode()
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewUrihttpBaseAddress
=newUri("http://localhost:8888/generalCalculator");
[原创]我的WCF之旅(2):Endpoint OverviewUritcpBaseAddress
=newUri("net.tcp://localhost:9999/generalCalculator");
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
using(ServiceHostcalculatorSerivceHost=newServiceHost(typeof(GeneralCalculatorService),httpBaseAddress,tcpBaseAddress))
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewBasicHttpBindinghttpBinding
=newBasicHttpBinding();
[原创]我的WCF之旅(2):Endpoint OverviewNetTcpBindingtcpBinding
=newNetTcpBinding();
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewcalculatorSerivceHost.AddServiceEndpoint(
typeof(IGeneralCalculator),httpBinding,string.Empty);
[原创]我的WCF之旅(2):Endpoint OverviewcalculatorSerivceHost.AddServiceEndpoint(
typeof(IGeneralCalculator),tcpBinding,string.Empty);
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewServiceMetadataBehaviorbehavior
=calculatorSerivceHost.Description.Behaviors.Find<ServiceMetadataBehavior>();
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
if(behavior==null)
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overviewbehavior
=newServiceMetadataBehavior();
[原创]我的WCF之旅(2):Endpoint Overviewbehavior.HttpGetEnabled
=true;
[原创]我的WCF之旅(2):Endpoint OverviewcalculatorSerivceHost.Description.Behaviors.Add(behavior);
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
else
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overviewbehavior.HttpGetEnabled
=true;
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewcalculatorSerivceHost.Opened
+=delegate
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(
"CalculatorServicehasbeguntolisten[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview");
[原创]我的WCF之旅(2):Endpoint Overview}
;
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewcalculatorSerivceHost.Open();
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewConsole.Read();
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
staticvoidHostCalculatorSerivceViaConfiguration()
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
using(ServiceHostcalculatorSerivceHost=newServiceHost(typeof(GeneralCalculatorService)))
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewcalculatorSerivceHost.Opened
+=delegate
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(
"CalculatorServicehasbeguntolisten[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview");
[原创]我的WCF之旅(2):Endpoint Overview}
;
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewcalculatorSerivceHost.Open();
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewConsole.Read();
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview

4. Service.svc: http://localhost/WCFService/ GeneralCalculatorService.svc

[原创]我的WCF之旅(2):Endpoint Overview<%@ServiceHostLanguage="C#"Debug="true"Service="Artech.WCFService.Service.GeneralCalculatorService"%>

5. Client: Artech.WCFService.Client/ GeneralCalculatorClient.cs & Program.cs

[原创]我的WCF之旅(2):Endpoint OverviewusingSystem;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Collections.Generic;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Text;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.ServiceModel;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.ServiceModel.Channels;
[原创]我的WCF之旅(2):Endpoint Overview
usingArtech.WCFService.Contract;
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
namespaceArtech.WCFService.Client
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
classGeneralCalculatorClient:ClientBase<IGeneralCalculator>,IGeneralCalculator
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
publicGeneralCalculatorClient()
[原创]我的WCF之旅(2):Endpoint Overview:
base()
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{}
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
publicGeneralCalculatorClient(stringendpointConfigurationName)
[原创]我的WCF之旅(2):Endpoint Overview:
base(endpointConfigurationName)
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{}
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
publicGeneralCalculatorClient(Bindingbinding,EndpointAddressaddress)
[原创]我的WCF之旅(2):Endpoint Overview:
base(binding,address)
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{}
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
IGeneralCalculatorMembers#regionIGeneralCalculatorMembers
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
publicdoubleAdd(doublex,doubley)
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
returnthis.Channel.Add(x,y);
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
#endregion

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview

[原创]我的WCF之旅(2):Endpoint OverviewusingSystem;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Collections.Generic;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.Text;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.ServiceModel;
[原创]我的WCF之旅(2):Endpoint Overview
usingSystem.ServiceModel.Channels;
[原创]我的WCF之旅(2):Endpoint Overview
usingArtech.WCFService.Contract;
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
namespaceArtech.WCFService.Client
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
classProgram
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
staticvoidMain()
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
try
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
//InvocateCalclatorServiceViaCode();
[原创]我的WCF之旅(2):Endpoint Overview

[原创]我的WCF之旅(2):Endpoint OverviewInvocateCalclatorServiceViaConfiguration();
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
catch(Exceptionex)
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(ex.Message);
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewConsole.Read();
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview
staticvoidInvocateCalclatorServiceViaCode()
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewBindinghttpBinding
=newBasicHttpBinding();
[原创]我的WCF之旅(2):Endpoint OverviewBindingtcpBinding
=newNetTcpBinding();
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewEndpointAddresshttpAddress
=newEndpointAddress("http://localhost:8888/generalCalculator");
[原创]我的WCF之旅(2):Endpoint OverviewEndpointAddresstcpAddress
=newEndpointAddress("net.tcp://localhost:9999/generalCalculator");
[原创]我的WCF之旅(2):Endpoint OverviewEndpointAddresshttpAddress_iisHost
=newEndpointAddress("http://localhost/wcfservice/GeneralCalculatorService.svc");
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(
"Invocateself-hostcalculatorservice");
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
InvocateSelf-hostservice#regionInvocateSelf-hostservice
[原创]我的WCF之旅(2):Endpoint Overview
using(GeneralCalculatorClientcalculator_http=newGeneralCalculatorClient(httpBinding,httpAddress))
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
using(GeneralCalculatorClientcalculator_tcp=newGeneralCalculatorClient(tcpBinding,tcpAddress))
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint Overview
try
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(
"Begintoinvocatecalculatorserviceviahttptransport");
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(
"x+y={2}wherex={0}andy={1}",1,2,calculator_http.Add(1,2));
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(
"Begintoinvocatecalculatorserviceviatcptransport");
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(
"x+y={2}wherex={0}andy={1}",1,2,calculator_tcp.Add(1,2));
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
catch(Exceptionex)
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview{
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(ex.Message);
[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview}

[原创]我的WCF之旅(2):Endpoint Overview
#endregion

[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint OverviewConsole.WriteLine(
"\n\nInvocateIIS-hostcalculatorservice");
[原创]我的WCF之旅(2):Endpoint Overview
[原创]我的WCF之旅(2):Endpoint Overview[原创]我的WCF之旅(2):Endpoint Overview
InvocateIIS-hostservice#regionInvocateIIS-hostservice
[原创]我的WCF之旅(2):Endpoint Overview
using(GeneralCalculatorClientcalculator=newGeneralCalculatorClient(httpBinding,httpAddress_iisHost))
[原创]我的WCF之旅(2):Endpoint Overview