积极答复者
外网 wsDualHttpBinding 绑定来实现回调 急死了 !!!都快半个月了还没解决

问题
-
wsDualHttpBinding 双工 是用微软提供的 CalculatorService 示例
服务端配置为:服务端为:(WCF 服务应用程序 vs2008)
<system.serviceModel>
<services>
<service name="DWCF_S.Service1" behaviorConfiguration="DWCF_S.Service1Behavior">
<endpoint address=""
bindingConfiguration ="DuplexBinding"
binding="wsDualHttpBinding" contract="DWCF_S.IService1">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DWCF_S.Service1Behavior">
<serviceMetadata httpGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsDualHttpBinding>
<binding name="DuplexBinding" >
<security mode="None"/>
</binding>
</wsDualHttpBinding>
</bindings>
</system.serviceModel>
客户端配置 (控制台应用程序)
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="WSDualHttpBinding_IService1" closeTimeout="00:01:00"
openTimeout="00:02:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
clientBaseAddress="http://192.168.0.26:8000/"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00" />
<security mode="None">
<message clientCredentialType="Windows" negotiateServiceCredential="true" />
</security>
</binding>
</wsDualHttpBinding>
</bindings>
<client>
<!--<endpoint address="http://localhost/WCFServer/Service1.svc" -->
<!-- 上面这个接入没问题 -->
<endpoint address="http://qq277401588.sxcl2.zgsj.net/Service1.svc"
binding="wsDualHttpBinding" bindingConfiguration="WSDualHttpBinding_IService1"
contract="IService1" name="WSDualHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>
本地 8000 端口也打开了
http://msdn.microsoft.com/zh-cn/library/ms751530(v=VS.90).aspx
本地测试 一点问题没有 将 wcf 服务 发布到远程 连不上
跪求高人 指点 急死了 这不解决 没法往下写了
address="http://qq277401588.sxcl2.zgsj.net/Service1.svc"
这是临时试用的空间 不是双工的没问题 测试过
明就到期了 高人啊 指点下 是服务器 权限问题么?? 还是权限问题 !!该怎么设置!!
- 已编辑 呵呵先生 2011年10月7日 11:36
答案
-
这个过程是这样的
客户端 --------------->服务端:80端口
客户端:8000端口 <------回调---------服务端
关键你的客户端8000这个是局域网IP地址,clientBaseAddress=http://192.168.0.26:8000/
如何让服务端访问到你的机器?
Frank Xu Lei--谦卑若愚,好学若饥
专注于.NET平台下分布式应用系统开发和企业应用系统集成
Focus on Distributed Applications Development and EAI based on .NET
【老徐的网站】:http://www.frankxulei.com/
- 已标记为答案 Peter pi - MSFTModerator 2011年10月14日 2:28
全部回复
-
wsdualhttpbinding 是用http 80端口 往外发么?这理解对么?
客户端 在指定端口接收么 ??好比开的 8000
这里有点迷惑
///////////企业内部网
WSDualHttpBinding 将使用您的.net 应用程序使用一个内联网方案和"是"服务将能够解决客户端的基本地址和端口的回调的预配置自定义端口: 到底如何见下面的解释。它解释如下的原因是 WSDualHttpBinding 主要为了在互联网上使用。
双工回调在时您可以使用 WCF 客户端和服务器上的网络方案中最好被通过使用 NetTcpBinding 或 NetNamedPipeBinding。这些绑定使用 TCP 和 ICP 分别作为传输 (而不是 HTTP) 和一个自定义的二进制文件,这就为什么 WCF 双方所需的编码。为客户端用来连接到该服务通过结合的同一通道回调用是重复使用而无需打开一个新的端口。
互联网
在一个网络方案有效 HTTP 请求和响应的唯一旅行在一个方向,HTTP 被设计为单向的协议。当使用 WSDualHttpBinding WCF 因此创建回调的单独 HTTP 信道。在第二个问题的答案: 默认情况下此调用后到客户端的目标地址组成的客户端计算机的主机名和端口 80。如果客户端是开发计算机,例如,并且已安装了 IIS 在某些情况下,这会导致冲突与原型应用程序将只保留端口 80。这是什么 此博客张贴内容 提供了一种解决方案,ClientBaseAddress 属性旨在帮助。无论你去与-默认或自定义的端口,您必须确保所有的防火墙和路由器上双方正确配置为允许传出通道和设立单独回调通道。
来人呀 !!!!!!!!!!!!块 块 快 呀!!!!
- 已编辑 呵呵先生 2011年10月7日 6:32
-
这个过程是这样的
客户端 --------------->服务端:80端口
客户端:8000端口 <------回调---------服务端
关键你的客户端8000这个是局域网IP地址,clientBaseAddress=http://192.168.0.26:8000/
如何让服务端访问到你的机器?
Frank Xu Lei--谦卑若愚,好学若饥
专注于.NET平台下分布式应用系统开发和企业应用系统集成
Focus on Distributed Applications Development and EAI based on .NET
【老徐的网站】:http://www.frankxulei.com/
- 已标记为答案 Peter pi - MSFTModerator 2011年10月14日 2:28