博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
wcf客户端捕获异常
阅读量:4638 次
发布时间:2019-06-09

本文共 2300 字,大约阅读时间需要 7 分钟。

直接使用Exception进行捕获,然后在监视器中查看具体是哪一个异常

System.Exception {System.ServiceModel.Security.MessageSecurityException}

 

查看StackTrace

Server stack trace:
在 System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.ProcessReply(Message reply, SecurityProtocolCorrelationState correlationState, TimeSpan timeout)
在 System.ServiceModel.Channels.SecurityChannelFactory`1.SecurityRequestChannel.Request(Message message, TimeSpan timeout)
在 System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.DoOperation(SecuritySessionOperation operation, EndpointAddress target, Uri via, SecurityToken currentToken, TimeSpan timeout)
在 System.ServiceModel.Security.SecuritySessionSecurityTokenProvider.GetTokenCore(TimeSpan timeout)
在 System.IdentityModel.Selectors.SecurityTokenProvider.GetToken(TimeSpan timeout)
在 System.ServiceModel.Security.SecuritySessionClientSettings`1.ClientSecuritySessionChannel.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
在 System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.CallOnceManager.CallOnce(TimeSpan timeout, CallOnceManager cascade)
在 System.ServiceModel.Channels.ServiceChannel.EnsureOpened(TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
在 System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
在 System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]:

在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
在 Client.localhost.IObtainData.SelectUserByName(String userName)
在 Client.localhost.ObtainDataClient.SelectUserByName(String userName) 位置 d:\Colleague\BaiYongsheng\Server\Client\Service References\localhost\Reference.cs:行号 71
在 Client.Program.Main(String[] args) 位置 d:\Colleague\BaiYongsheng\Server\Client\Program.cs:行号 23

转载于:https://www.cnblogs.com/chucklu/p/4689214.html

你可能感兴趣的文章
VS不显示最近打开的项目
查看>>
MyEclipse安装Freemarker插件
查看>>
计算多项式的值
查看>>
DP(动态规划)
查看>>
chkconfig
查看>>
TMS320F28335项目开发记录2_CCS与JTAG仿真器连接问题汇总
查看>>
最强的篮球队和马尔可夫模型
查看>>
hdu-4302-Holedox Eating-线段树-单点更新,有策略的单点查询
查看>>
cocos2d-x 音效中断问题
查看>>
子分类账知识学习(汇总网上比较有用的资料)
查看>>
pyQt 每日一练习 -- 登录框
查看>>
wp 删除独立存储空间文件(多级非空文件夹删除)
查看>>
Loadrunner安装使用入门
查看>>
smartupload 上传文件时 把页面编码改成gbk 解决乱码
查看>>
EPS是什么格式
查看>>
Python的数据库操作(Sqlalchemy)
查看>>
2.抽取代码(BaseActivity)
查看>>
My simplified pickit2 clone
查看>>
Redis 入门知识
查看>>
夏天过去了, 姥爷推荐几套来自smashingmagzine的超棒秋天主题壁纸
查看>>