客户端配置内容为
<system.serviceModel> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_DepartmentService"> <security mode="None" /> </binding> <binding name="WSHttpBinding_EvaluationService"> <security mode="None" /> </binding> <binding name="WSHttpBinding_MedicalStaffService"> <security mode="None" /> </binding> <binding name="WSHttpBinding_UserInfoService"> <security mode="None" /> </binding> </wsHttpBinding> </bindings> <client> <endpoint address="http://127.0.0.1:9999/DepartmentService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_DepartmentService" contract="DepartmentService.DepartmentService" name="WSHttpBinding_DepartmentService" /> <endpoint address="http://127.0.0.1:9999/EvaluationService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_EvaluationService" contract="EvaluationService.EvaluationService" name="WSHttpBinding_EvaluationService" /> <endpoint address="http://127.0.0.1:9999/MedicalStaffService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_MedicalStaffService" contract="MedicalStaffService.MedicalStaffService" name="WSHttpBinding_MedicalStaffService" /> <endpoint address="http://127.0.0.1:9999/UserInfoService" binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_UserInfoService" contract="UserInfoService.UserInfoService" name="WSHttpBinding_UserInfoService" /> </client> </system.serviceModel>
服务端配置的内容为
<system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="departmentDataBehavior"> <serviceMetadata httpGetEnabled="true" httpGetUrl="http://127.0.0.1:9999/DepartmentService/metadata" /> </behavior> <behavior name="evaluationDataBehavior"> <serviceMetadata httpGetEnabled="true" httpGetUrl="http://127.0.0.1:9999/EvaluationService/metadata" /> </behavior> <behavior name="medicalStaffDataBehavior"> <serviceMetadata httpGetEnabled="true" httpGetUrl="http://127.0.0.1:9999/MedicalStaffService/metadata" /> </behavior> <behavior name="userInfoDataBehavior"> <serviceMetadata httpGetEnabled="true" httpGetUrl="http://127.0.0.1:9999/UserInfoService/metadata" /> </behavior> </serviceBehaviors> </behaviors> <services> <service behaviorConfiguration="departmentDataBehavior" name="AppraiseTest.Services.DepartmentService"> <endpoint address="http://127.0.0.1:9999/DepartmentService" binding="wsHttpBinding" bindingConfiguration="NoneSecurity" contract="AppraiseTest.Contracts.IDepartment"/> </service> <service behaviorConfiguration="evaluationDataBehavior" name="AppraiseTest.Services.EvaluationService"> <endpoint address="http://127.0.0.1:9999/EvaluationService" binding="wsHttpBinding" bindingConfiguration="NoneSecurity" contract="AppraiseTest.Contracts.IEvaluationInfo"/> </service> <service behaviorConfiguration="medicalStaffDataBehavior" name="AppraiseTest.Services.MedicalStaffService"> <endpoint address="http://127.0.0.1:9999/MedicalStaffService" binding="wsHttpBinding" bindingConfiguration="NoneSecurity" contract="AppraiseTest.Contracts.IMedicalStaff"/> </service> <service behaviorConfiguration="userInfoDataBehavior" name="AppraiseTest.Services.UserInfoService"> <endpoint address="http://127.0.0.1:9999/UserInfoService" binding="wsHttpBinding" bindingConfiguration="NoneSecurity" contract="AppraiseTest.Contracts.IUserInfo"/> </service> </services> <bindings> <wsHttpBinding> <binding name="NoneSecurity" maxBufferPoolSize="12000000" maxReceivedMessageSize="12000000" useDefaultWebProxy="false"> <readerQuotas maxStringContentLength="12000000" maxArrayLength="12000000"/> <security mode="None"/> </binding> </wsHttpBinding> </bindings> </system.serviceModel>
<serviceDebug includeExceptionDetailInFaults="true"/>通过在服务配置文件里添加这句话调试出详细问题,为数据库连接异常
按照错误提示,把 debug 打开,看下具体的错误信息。
具体错误咋看?不好意思
@sysmenu: 具体错误不会看没关系,但是你必须要具有基础的阅读理解能力。你看你最先贴的那个图,FaultException 下面有一段文字描述,你照着那个做。
@Launcher: 谢谢你细心的教导,我在服务配置文件里添加了一个
<serviceDebug includeExceptionDetailInFaults="true"/>
再次调试错误的时候就说的比较准确了,其实是数据库连接出了问题。