您的位置:首页 > 其它

WCF学习之旅(一)---Hello World.

2008-11-21 22:46 417 查看
WCF学习之旅(一)---Hello World.

看了一些关于WCF的资料,从实例入手。记录自己学习WCF的过程。

从最简单的Hello World入门。

下图是我的solution及项目。

<?xml version="1.0" encoding="utf-8" ?>

<configuration>

<system.serviceModel>

<bindings>

<basicHttpBinding>

<binding name="BasicHttpBinding_IHello" closeTimeout="00:01:00"

openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"

messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"

useDefaultWebProxy="true">

<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

maxBytesPerRead="4096" maxNameTableCharCount="16384" />

<security mode="None">

<transport clientCredentialType="None" proxyCredentialType="None"

realm="" />

<message clientCredentialType="UserName" algorithmSuite="Default" />

</security>

</binding>

</basicHttpBinding>

</bindings>

<client>

<endpoint address="http://localhost:8089/Hello/Hello"

binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IHello"

contract="IHello" name="BasicHttpBinding_IHello" />

</client>

</system.serviceModel>

</configuration>
编译通过及配置好IIS后先运行host再运行Client.这时可以看到host程序中会出现hello,I’m XXX.

代码下载
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: