它让我发疯,我找不到原因请一些帮助
public FMS_FrameWork.Driver[] GetDrivers(int companyid)
{
return base.Channel.GetDrivers(companyid);
}
[WebException: The underlying connection was closed: The connection was closed unexpectedly.]
System.Net.HttpWebRequest.GetResponse() +6594148
System.ServiceModel.Channels.HttpChannelRequest.WaitForReply(TimeSpan timeout) +55
[CommunicationException: The underlying connection was closed: The connection was closed unexpectedly.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +10992363
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +336
FMS_FrameWork.ICommonServices.GetDrivers(Int32 companyid) +0
FMS_FrameWork.CommonServicesClient.GetDrivers(Int32 companyid) in f:\FMS-Portal\PORTAL\App_Code\CommonSerivcesProxy.cs:1550
Pages_Driver.checkSession() in f:\FMS-Portal\PORTAL\Pages\Driver.aspx.cs:21
Pages_Driver.Page_Load(Object sender, EventArgs e) in f:\FMS-Portal\PORTAL\Pages\Driver.aspx.cs:45
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +51
System.Web.UI.Control.OnLoad(EventArgs e) +92
System.Web.UI.Control.LoadRecursive() +54
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +772
这是我的web.config for servic
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
</system.serviceModel>
</configuration>
这是针对客户端的,它是一个网站项目
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="debuggingBehaviour">
<dataContractSerializer />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_ICommonServices"/>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:9090/Services/CommonServices.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_ICommonServices" contract="FMS_FrameWork.ICommonServices" name="BasicHttpBinding_ICommonServices" behaviorConfiguration="debuggingBehaviour"/>
</client>
</system.serviceModel>
</configuration>
如何解决此异常并且我的数据库为空