The communication object, System.ServiceModel.ChannelFactory`1[SBBasis.IBasisWCF

tiantian1980 2014-12-24 12:17:45
The communication object, System.ServiceModel.ChannelFactory`1[SBBasis.IBasisWCF], cannot be used for communication because it is in the Faulted stat
客户端口是动态调用的

EndpointAddress address = new EndpointAddress(pUrl);
Binding bindinginstance = null;
BasicHttpBinding ws = new BasicHttpBinding();
ws.MaxReceivedMessageSize = 20971520;
//ws.MaxBufferPoolSize = 99999999999;
//ws.MaxBufferSize = 999999999;
ws.Security.Mode = BasicHttpSecurityMode.None;
bindinginstance = ws;
using (ChannelFactory<T> channel = new ChannelFactory<T>(bindinginstance, address))
{
T instance = channel.CreateChannel();
using (instance as IDisposable)
{
try
{
Type type = typeof(T);
MethodInfo mi = type.GetMethod(pMethodName);//反射
return mi.Invoke(instance, pParams);
}
catch (TimeoutException)
{
(instance as ICommunicationObject).Abort();
throw;
}
catch (CommunicationException)
{
(instance as ICommunicationObject).Abort();
throw;
}
catch (Exception )
{
(instance as ICommunicationObject).Abort();
throw;
}
}
}

在window server 08没有题,在window server 2003上就报这个错了,本机调试也没有问题,对wcf安全机制不熟,苦恼了好些天。请高人帮助,谢谢!
...全文
872 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
xm265 2015-10-12
  • 打赏
  • 举报
回复
LZ解决问题了吧? 请问啥原因? 我也遇到这样的问题,求解决。
tiantian1980 2015-01-09
  • 打赏
  • 举报
回复
CSDN人气大不如前了,是真的吗?
tiantian1980 2014-12-29
  • 打赏
  • 举报
回复
反序列化操作“BasisExistsByModel”的响应消息的正文时出现错误。读取 XML 数据时,超出最大字符串内容长度配额 (8192)。通过更改在创建 XML 读取器时所使用的 XmlDictionaryReaderQuotas 对象的 MaxStringContentLength 属性,可增加此配额。 行 146,位置 9。 ------------------------------------------------------------------------------------------- 看到是这个错了
ajaxfeifei 2014-12-24
  • 打赏
  • 举报
回复
表示发生了未知的异常,把你抛出错误的地方不要直接throw出来,而要使用 throw new FaultException<T>() 来抛出错误,你再看错误消息是什么就行了,window server 08是忽略了这个错误,让服务继续运行,window server 2003如果这个错误未知也未处理的话,会导致服务不可用。
tiantian1980 2014-12-24
  • 打赏
  • 举报
回复
引用 2 楼 dongxinxi 的回复:
.net 3.5装了没?
.net 装的是4.0
  • 打赏
  • 举报
回复
.net 3.5装了没?

12,162

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧