阅读内容 

【WCF】wsHttpBinding和SSO Server使用的问题,大家进来讨论一下

[日期:2008-08-26] 来源:  作者: [字体: ]
     现在的项目是一个C/S的程序,其访问流程是这样的:
  
  Client Û WCF Server Û DB Server
  
  系统中的WCF访问数据使用了wsHttpBinding和basicHttpBinding两种协议。其中wsHttpBinding的服务中用到了Session。
  
  Config文件中是这样配置的:
  
  
  
  配置文件
  <endpoint address="http://ap106vm06/AegisService/AegisService.svc"
   binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAegisService"
   contract="AegisService.IAegisService" name="WSHttpBinding_IAegisService">
   <identity>
   <dns value="Aegis" />
   </identity>
  </endpoint>
  <endpoint address="http://ap106vm06/AegisService/AegisServiceBasic.svc"
   binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAegisServiceBasic"
   contract="AegisServiceBasic.IAegisServiceBasic" name="BasicHttpBinding_IAegisServiceBasic">
   <identity>
   <dns value="Aegis" />
   </identity>
  </endpoint>
  
  
  一切正常。
  
  但是现在客户要求所有的访问要经过一台SSO服务器(Hp公司的IceWall服务器),即数据访问流程变成了如下:
  
  Client Û SSO Server(Ice Wall) Û WCF Server Û DB Server
  
  于是我把配置文件改成如下形式:
  
  
  
  
  
  修改后的配置文件
  <endpoint address="http://172.22.1.13/fw/dfw/GU019/AegisService/AegisService.svc"
   binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAegisService"
   contract="AegisService.IAegisService" name="WSHttpBinding_IAegisService">
   <identity>
   <dns value="Aegis" />
   </identity>
  </endpoint>
  <endpoint address="http://172.22.1.13/fw/dfw/GU019/AegisService/AegisServiceBasic.svc"
   binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAegisServiceBasic"
   contract="AegisServiceBasic.IAegisServiceBasic" name="BasicHttpBinding_IAegisServiceBasic">
   <identity>
   <dns value="Aegis" />
   </identity>
  </endpoint>
  
  
  理论上,访问http://172.22.1.13/fw/dfw/GU019/XXX和访问http://ap106vm06/XXX是等价的,而且在浏览器中
  
  http://172.22.1.13/fw/dfw/GU019/AegisService/AegisService.svc能够正常访问。
  
  程序运行的时候,basicHttpBinding的服务能正常执行,但是wsHttpBinding的服务却会抛出异常。
  
  异常信息是:
  
  程序找不到EndPoint http://172.22.1.13/fw/dfw/GU019/AegisService/AegisService.svc,这可能是因为Address
  
  或Soap Action没有设置正确。
  
  Call Stack如下:
  
  
  
  异常堆栈
  Server stack trace:
   at System.ServiceModel.Channels.ClientReliableSession.ProcessCreateSequenceResponse(Message response, DateTime start)
   at System.ServiceModel.Channels.ClientReliableSession.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ReliableRequestSessionChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOpenOnce.System.ServiceModel.Channels.ServiceChannel.ICallOnce.Call(ServiceChannel channel, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
   at System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
   at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
   at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
   at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
  
  Exception rethrown at [0]:
   at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
   at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
   at Nichicom.Wel.Mother.WelOperator.AegisService.IAegisService.ExecuteScalar(Boolean IsInTransaction, String strConnToken, WelSqlCommandStruct welSqlCommands)
   at Nichicom.Wel.Mother.WelOperator.AegisService.AegisServiceClient.ExecuteScalar(Boolean IsInTransaction, String strConnToken, WelSqlCommandStruct welSqlCommands) in C:\WelMotherAegis\01_AegisSource\Common\WelOperator\Service References\AegisService\Reference.cs:line 456
   at Nichicom.Wel.Mother.WelOperator.ServiceAccess.ExecuteScalar(Boolean IsInTransaction, WelSqlCommand welSqlCommands) in C:\WelMotherAegis\01_AegisSource\Common\WelOperator\WelDBOperator\ServiceAccess.cs:line 197
  
  
  
  
  不太理解为什么basicHttpBinding可以但是wsHttpBinding不行,看错误好像是在ReliableRequestSessionChannel打开的过程中出错,
  
  难道WCF的Session需要建立持久通道,在我印象中,WCF应该是通过Soap消息头上的Session ID支持Session的。
  
  也许我的理解有偏差,大家有什么建议吗?希望不吝赐教,也可以一起讨论一下,多谢。
  
    
阅读:
录入:blue1000

推荐 】 【 打印
相关新闻      
本文评论       全部评论
发表评论
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款


点评: 字数
姓名:
Advertisement
内容查询


Advertisement