exp = {"通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。"}

FlyBee 2010-01-07 05:47:57
RT
来个高手解决下啊......

我的WCF服务是用 WEB --> WCF应用程序建的 (WCF服务和数据库在一台 服务器)

在本地调试没问题(放在IIS7下也没问题)

应用程序部署到客户端就报错
exp = {"通信对象 System.ServiceModel.Channels.ServiceChannel 无法用于通信,因为其处于“出错”状态。"}





...全文
1703 13 打赏 收藏 转发到动态 举报
写回复
用AI写文章
13 条回复
切换为时间正序
请发表友善的回复…
发表回复
liuxiuming 2010-09-08
  • 打赏
  • 举报
回复
我也遇到这个问题了,不过我的发现是,数据量过大的话就出现这个问题,如果小一些就不会

拿我的项目说,商品信息3000多条时传输就会报错,如果在100条左右就不会。

期待解决方法,同谢了。
蝈蝈俊 2010-08-25
  • 打赏
  • 举报
回复
客户端代理建立以后,长时间不使用,就会出现出错状态,进而无法使用。
如果通道出错,进行重新连接即可,。或者重新实例化一个客户端代理。以前的销毁掉
(可以通过代理的State 是否为Faulted)
FlyBee 2010-01-08
  • 打赏
  • 举报
回复
急啊.......来个高手帮帮忙
FlyBee 2010-01-08
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 vrhero 的回复:]
address="http://flybee-pc/

<dns value="localhost" />

这两个地方,按你的部署环境写正确...
[/Quote]

我换成IP地址也不行
FlyBee 2010-01-08
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 wiki14 的回复:]
<identity>
</identity>
修改为
<identity>
                    <servicePrincipalName value="host/GavinLuo-PC" />
</identity>
msdn上说,servicePrincipalName  (WCF) 客户端通过此标识连接到终结点,则它在使用此终结点进行 SSPI 身份验证时将使用 SPN。
userPrincipalName    (WCF) 客户端在使用终结点进行 SSPI 身份验证时将使用 UPN。

试试~

[/Quote]

谢谢,但是试了不行
hunter911x 2010-01-08
  • 打赏
  • 举报
回复
修改 Web.config
 <system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="httpconf">
<security mode="None">
<transport clientCredentialType="Windows"/>
<message clientCredentialType="Windows"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
</system.serviceModel>


<endpoint address="" binding="wsHttpBinding" contract="DatabaseService.IUserService" bindingConfiguration="httpconf">
vrhero 2010-01-07
  • 打赏
  • 举报
回复
address="http://flybee-pc/

<dns value="localhost" />

这两个地方,按你的部署环境写正确...
wiki14 2010-01-07
  • 打赏
  • 举报
回复
<identity>
</identity>
修改为
<identity>
<servicePrincipalName value="host/GavinLuo-PC" />
</identity>
msdn上说,servicePrincipalName (WCF) 客户端通过此标识连接到终结点,则它在使用此终结点进行 SSPI 身份验证时将使用 SPN。
userPrincipalName (WCF) 客户端在使用终结点进行 SSPI 身份验证时将使用 UPN。

试试~
FlyBee 2010-01-07
  • 打赏
  • 举报
回复
app.config

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
</configSections>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IAgencyService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="6553500" maxStringContentLength="2147483647" maxArrayLength="6553500"
maxBytesPerRead="6553500" maxNameTableCharCount="6553500" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="None" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
<binding name="WSHttpBinding_ILineService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">

<readerQuotas maxDepth="6553500" maxStringContentLength="2147483647" maxArrayLength="6553500"
maxBytesPerRead="6553500" maxNameTableCharCount="6553500" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="None" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
<binding name="WSHttpBinding_IPolicyService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="6553500" maxStringContentLength="2147483647" maxArrayLength="6553500"
maxBytesPerRead="6553500" maxNameTableCharCount="6553500" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="None" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
<binding name="WSHttpBinding_IUserService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="6553500" maxStringContentLength="2147483647" maxArrayLength="6553500"
maxBytesPerRead="6553500" maxNameTableCharCount="6553500" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="None" proxyCredentialType="None"
realm="">
<extendedProtectionPolicy policyEnforcement="Never" />
</transport>
<message clientCredentialType="None" negotiateServiceCredential="true"
algorithmSuite="Default" establishSecurityContext="true" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://flybee-pc/AgencyService.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IAgencyService" contract="WcfAgency.IAgencyService"
name="WSHttpBinding_IAgencyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="http://flybee-pc/LineService.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ILineService" contract="WcfLine.ILineService"
name="WSHttpBinding_ILineService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="http://flybee-pc/PolicyService.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IPolicyService" contract="WcfPolicy.IPolicyService"
name="WSHttpBinding_IPolicyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="http://flybee-pc/UserService.svc" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_IUserService" contract="WcfUser.IUserService"
name="WSHttpBinding_IUserService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>


网上找了很多资料都没解决请高手帮忙........谢谢....
wiki14 2010-01-07
  • 打赏
  • 举报
回复
是不是web应用程序的Web.config的WCF配置节点有问题。
FlyBee 2010-01-07
  • 打赏
  • 举报
回复
<!--
通过 <authentication> 节可以配置
ASP.NET 使用的安全身份验证
模式,以标识传入的用户。
-->
<authentication mode="None" />
<!--
通过 <customErrors> 节可以配置在执行请求过程中出现未处理错误时,
应执行的操作。
具体说来,开发人员通过该节
可以配置要显示的 html 错误页
以代替错误堆栈跟踪。

<customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
<error statusCode="403" redirect="NoAccess.htm" />
<error statusCode="404" redirect="FileNotFound.htm" />
</customErrors>
-->


<pages>
<controls>
<add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</controls>
</pages>
<httpHandlers>
<remove verb="*" path="*.asmx"/>
<add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
</httpHandlers>
<httpModules>
<add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</httpModules>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs" warningLevel="4"
type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<providerOption name="CompilerVersion" value="v3.5"/>
<providerOption name="WarnAsError" value="false"/>
</compiler>
</compilers>
</system.codedom>

<!--
在 Internet 信息服务 7.0 下,运行 ASP.NET AJAX 要求
system.webServer 节。这在以前版本的 IIS 中并非必需。
-->
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules>
<add name="ScriptModule" preCondition="integratedMode" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</modules>
<handlers>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode"
type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</handlers>
</system.webServer>

<system.serviceModel>
<services>
<service name="DatabaseService.UserService" behaviorConfiguration="DatabaseService.UserServiceBehavior" >
<endpoint address="" binding="wsHttpBinding" contract="DatabaseService.IUserService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service name="DatabaseService.LineService" behaviorConfiguration="DatabaseService.LineServiceBehavior" >
<endpoint address="" binding="wsHttpBinding" contract="DatabaseService.ILineService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service name="DatabaseService.AgencyService" behaviorConfiguration="DatabaseService.AgencyServiceBehavior" >
<endpoint address="" binding="wsHttpBinding" contract="DatabaseService.IAgencyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
<service name="DatabaseService.PolicyService" behaviorConfiguration="DatabaseService.PolicyServiceBehavior" >
<endpoint address="" binding="wsHttpBinding" contract="DatabaseService.IPolicyService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="DatabaseService.UserServiceBehavior">
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="100" maxConcurrentInstances="100" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="DatabaseService.LineServiceBehavior">
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="100" maxConcurrentInstances="100" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="DatabaseService.AgencyServiceBehavior">
<serviceThrottling maxConcurrentCalls="200" maxConcurrentSessions="100" maxConcurrentInstances="100" />
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
<behavior name="DatabaseService.PolicyServiceBehavior">
<serviceThrottling maxConcurrentCalls="200" maxConcurrentInstances ="100" maxConcurrentSessions ="100"/>
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>[/code]


FlyBee 2010-01-07
  • 打赏
  • 举报
回复
Web.config

[code=XML]<?xml version="1.0" encoding="utf-8"?>
<!--
注意: 除了手动编辑此文件以外,
还可以使用 Web 管理工具来配置应用程序的设置。
可以使用 Visual Studio 中的“网站”->“Asp.Net 配置”选项。
设置和注释的完整列表在
machine.config.comments 中,该文件通常位于
\Windows\Microsoft.Net\Framework\v2.x\Config
-->
<configuration>


<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
<sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
<section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere" />
<section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
<section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication" />
</sectionGroup>
</sectionGroup>
</sectionGroup>
</configSections>
<appSettings/>

<connectionStrings>
<add name="EtermShareServerConnectionString" connectionString="Data Source=(LOCAL);Initial Catalog=EtermShareServer;Integrated Security=False; user id=sa; password=sa" providerName="System.Data.SqlClient" />
<add name="EssLogConnectionString" connectionString="Data Source=(LOCAL);Initial Catalog=EssLog;Integrated Security=True" providerName="System.Data.SqlClient" />
<add name="DatabaseService.Database.Properties.Settings.EtermShareServerConnectionString"
connectionString="Data Source=(LOCAL);Initial Catalog=EtermShareServer;Integrated Security=True"
providerName="System.Data.SqlClient" />
<add name="DatabaseService.Database.Properties.Settings.EssLogConnectionString"
connectionString="Data Source=(LOCAL);Initial Catalog=EssLog;Integrated Security=True"
providerName="System.Data.SqlClient" />
</connectionStrings>

<system.web>
<!--
设置 compilation debug="true" ,将调试符号
插入已编译的页面中。但由于这会影响性能,
因此请只在开发过程中
将此值设置为 true。
-->
<compilation debug="true">

<assemblies>
<add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
</assemblies>

</compilation>
源码dll: ComSvcConfig mscorlib PresentationBuildTasks PresentationCore PresentationFramework PresentationFramework.Aero PresentationFramework.Classic PresentationFramework.Luna PresentationFramework.Royale SMDiagnostics SMSvcHost svcutil System System.Activities System.Activities.Core.Presentation System.Activities.DurableInstancing System.Activities.Presentation System.AddIn System.AddIn.Contract System.ComponentModel.DataAnnotations System.Configuration System.Core System.Data System.Data.DataSetExtensions System.Data.Entity System.Data.Entity.Design System.Data.Linq System.Data.Services System.Data.Services.Client System.Data.Services.Design System.Data.SqlXml System.Drawing System.IdentityModel System.IdentityModel.Selectors System.IO.Log System.Management System.Messaging System.Net System.Numerics System.Runtime.Caching System.Runtime.DurableInstancing System.Runtime.Remoting System.Runtime.Serialization System.Security System.ServiceModel System.ServiceModel.Activation System.ServiceModel.Activities System.ServiceModel.Channels System.ServiceModel.Discovery System.ServiceModel.Internals System.ServiceModel.Routing System.ServiceModel.WasHosting System.ServiceModel.Web System.Transactions System.Web System.Web.ApplicationServices System.Web.DynamicData System.Web.Entity System.Web.Entity.Design System.Web.Extensions System.Web.Mobile System.Web.Routing System.Web.Services System.Windows.Forms System.Workflow.Activities System.Workflow.ComponentModel System.Workflow.Runtime System.WorkflowServices System.Xaml.Hosting System.Xml System.Xml.Linq UIAutomationClient UIAutomationClientsideProviders WindowsBase WsatConfig WsatUI XamlBuildTask

111,120

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

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