我采用的wsDualHttpBinding绑定来实现回调的,但是在本机测试可以的程序,把服务端部署到服务器后,客户端就不能访问回调服务了.会出现超时现象.
不知各位有没有遇到这种情况.我试着从服务端ping客户端,ping不通,可能就是因为这个不能实现双通道吧?但是用tcp协议是可以,这容易理解,但这不是我要的结果.我希望可以用iis作为服务端,实现双通道,希望各位给点策略!
不知各位有没有遇到这种情况.我试着从服务端ping客户端,ping不通,可能就是因为这个不能实现双通道吧?但是用tcp协议是可以,这容易理解,但这不是我要的结果.我希望可以用iis作为服务端,实现双通道,希望各位给点策略!
解决方案 »
- DrawImage能否把图片绘制成黑白效果?
- 应该怎么去读MSDN?
- c# sql loader向中文oracle中导入英文表示的时间戳数据的问题
- 关闭窗口后编译器停止响应现象,改怎么解释
- 指定某个类编译成dll
- 前台GirdView按钮JS调用变量/资源 问题 在线等
- C#中如何得到调用的WINDOWS画笔程序返回路径?
- 怎么判断当前文件是否正在被改写!急!
- C#里不卡死界面最简单的办法是什么?
- 请指教,当我用 Encoding.ASCII.GetBytes("haha"); 得到的byte[] buffer, 却无法用buffer.ToString(); 来得到string ?
- 行转列,不用存储过程,请大家提供个思路。。。。
- 关于c# winform ToolStripPanel中多个ToolStrip排序问题。
如果不行的话,只能改用TCp协议了。
你贴你的配置吧,极有可能是权限问题,以前我碰到过的,还有就是客户端是vista的话可能也会有这个问题。
服务端配置文件:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="LoaderServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:9001/" />
</behavior>
<behavior name="NewBehavior">
<serviceMetadata httpGetEnabled="false"/>
<serviceTimeouts transactionTimeout="00:03:00" />
<dataContractSerializer maxItemsInObjectGraph="65536000" />
</behavior>
</serviceBehaviors> </behaviors>
<bindings>
<wsDualHttpBinding>
<binding name="LoaderDualHttpBindingConfig" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None"></security>
</binding>
</wsDualHttpBinding> <basicHttpBinding>
<binding name="LoaderHttpBindingConfig" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="" name="IisServer.MyServer">
<endpoint binding="wsDualHttpBinding"
bindingConfiguration="LoaderDualHttpBindingConfig" name="IisServer.MyServer"
contract="contract.IContract" />
<!--<endpoint binding="basicHttpBinding"
bindingConfiguration="LoaderHttpBindingConfig" name="IisServer.MyServer"
contract="contract.IContract" />-->
</service>
</services>
</system.serviceModel>客户端配置文件:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="LoaderServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:9001/" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="LargeQuotaBehavior">
<dataContractSerializer
maxItemsInObjectGraph="100000" />
</behavior>
</endpointBehaviors> </behaviors>
<bindings>
<wsDualHttpBinding>
<binding name="LoaderDualHttpBindingConfig" closeTimeout="00:10:00" openTimeout="00:10:00" receiveTimeout="00:10:00" clientBaseAddress="http://CHENHUIZHONG22:8099">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
<security mode="None"></security>
</binding>
</wsDualHttpBinding> <basicHttpBinding>
<binding name="LoaderHttpBindingConfig" maxBufferSize="2147483647" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647" maxStringContentLength="2147483647"/>
</binding>
</basicHttpBinding> </bindings> <client>
<!--<endpoint address="http://localhost:9045/iis/IisServer.svc"
behaviorConfiguration="LargeQuotaBehavior"
binding="basicHttpBinding"
bindingConfiguration="LoaderHttpBindingConfig" contract="contract.IContract"
name="LoaderClientHttp"/>-->
<endpoint address="http://localhost:9045/iis/IisServer.svc" binding="wsDualHttpBinding"
bindingConfiguration="LoaderDualHttpBindingConfig" contract="contract.IContract"
name="LoaderClientDualHttp" />
</client>
</system.serviceModel>
我现在比你好点,能够单向成功(wsDualHttpBinding),就是不能够回调。
开始也出现逆刚才的问题,我把用localhost的地方换成了具体的ip地址就可以实现单向功能了。