WCF问题 [英] WCF problem

查看:76
本文介绍了WCF问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我是WCF的新手,

我正在处理一个带有服务器和客户端的项目,并且与NetNamedPipBinding一起很好地工作,并且我希望它可以在多台机器上工作.

我知道我需要更改与TcpBinding的绑定,但是我不知道该怎么做...

这是代码示例...

(即具有地址的端点)

Hello, I''m a newbie to WCF,

I''m working on a project with server and clients and it works very well with NetNamedPipBinding it and I want it to work on across machines.

I know that I need to channge the binding to TcpBinding but I dont know how should I do it exactly...

Here is code example...

(thats the EndPoints with address)

<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"

          listenUriMode="Explicit">
          <identity>
            <dns value="localhost" />
            <certificateReference storeName="My" storeLocation="LocalMachine"

              x509FindType="FindBySubjectDistinguishedName" />
          </identity>
        </endpoint>
        <endpoint address="net.pipe://localhost" binding="netNamedPipeBinding"

          bindingConfiguration="" contract="Library.IStringReverser" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8731/Design_Time_Addresses/Library/StringReverser/" />
          </baseAddresses>




这是客户端中的代码.




and this the code in client..

ServerEvents myCallbacks = new ServerEvents();

            DuplexChannelFactory<IStringReverser> pipeFactory =
               new DuplexChannelFactory<IStringReverser>(
                  myCallbacks,
                  new NetNamedPipeBinding(),
                  new EndpointAddress(
                     "net.pipe://localhost/PipeReverse"))



谢谢大家..



Thank you all..

推荐答案

HI

在端点标记中,属性Binding使用Binding = netTCPBinding
HI

In your endpoint tag the attribute Binding use Binding=netTCPBinding


这篇关于WCF问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆