我正在尝试从我的WCF服务中打开OracleConnection:
string strCon = ConfigurationManager.ConnectionStrings["dwhConnectionString"].ConnectionString;
using (var con = new OracleConnection(strCon))
{
con.Open();
}
但是收到错误:
{“由于内部错误,服务器无法处理请求。有关错误的更多信息,请在服务器上启用IncludeExceptionDetailInFaults(来自ServiceBehaviorAttribute或配置行为)以发送异常信息返回到客户端,或根据Microsoft .NET Framework SDK文档打开跟踪并检查服务器跟踪日志。“}
和Stack Trace:
服务器堆栈跟踪:at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(消息 回复,MessageFault错误,字符串操作,MessageVersion版本, FaultConverter faultConverter)at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime 操作,ProxyRpc& rpc)at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway,ProxyOperationRuntime操作,Object [] ins, 对象[]出局,TimeSpan超时)at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall,ProxyOperationRuntime operation)at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(即时聊天 消息)
在[0]处重新抛出异常:at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(即时聊天 reqMsg,IMessage retMsg)at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData&安培; msgData,Int32类型)at RNPDD.DwhServiceWeb.IService1.GetDataUsingDataContract(的CompositeType 复合) RNPDD.DwhServiceWeb.Service1Client.GetDataUsingDataContract(的CompositeType 复合材料) C:\用户\ kryazhnikov琪\ OTD \ NEW_RNPDD \ RNPDD \ RNPDD \服务 参考文献\ DwhServiceWeb \ Reference.cs:第104行 RNPDD.MainForm.button3_Click(Object sender,EventArgs e)in c:\ Users \ kryazhnikov-ki \ OTD \ NEW_RNPDD \ RNPDD \ RNPDD \ MainForm.cs:第183行
但是,当我在本地服务器上启动WCF服务时,正确打开了连接。 那是我的Web.config代码:
<?xml version="1.0"?>
<configuration>
<connectionStrings>
<add name="dwhConnectionString"
connectionString="Data Source=dwh;Persist Security Info=True;User ID=kryazh;Password=******;Unicode=True"
providerName="System.Data.OracleClient" />
<add name="RNPDD_DATABASE"
connectionString="Data Source=vm-srvdoccli2.rs.ru;Initial Catalog=RNPDD;User ID=kryazh; Password=******;"
providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5"/>
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
是的,我错了吗?
非常感谢!
答案 0 :(得分:0)
如果我正确地知道你的服务是正常的,只要你在数据库服务器上运行它是正确的吗?
在计算机出现故障时,您是否安装了Oracle客户端组件?配置?此外,您是否尝试过遵循异常建议,在服务器上启用详细日志记录?