2014-01-08 50 views
0

得到的OracleConnection我是從我的WCF服務試圖打開的OracleConnection:無法從我的WCF服務

string strCon = ConfigurationManager.ConnectionStrings["dwhConnectionString"].ConnectionString; 

using (var con = new OracleConnection(strCon)) 
{ 
    con.Open(); 
} 

卻得到一個錯誤:

{"The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs."}

和堆棧跟蹤:

Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at RNPDD.DwhServiceWeb.IService1.GetDataUsingDataContract(CompositeType composite) at RNPDD.DwhServiceWeb.Service1Client.GetDataUsingDataContract(CompositeType composite) in c:\Users\kryazhnikov-ki\OTD\NEW_RNPDD\RNPDD\RNPDD\Service References\DwhServiceWeb\Reference.cs:line 104 at RNPDD.MainForm.button3_Click(Object sender, EventArgs e) in c:\Users\kryazhnikov-ki\OTD\NEW_RNPDD\RNPDD\RNPDD\MainForm.cs:line 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> 

Whera我錯了嗎?

非常感謝!

回答

0

如果我得到這個正確的爲您服務長達功能爲你的數據庫服務器上運行它是正確的?

在機器出現故障,你有Oracle客戶端組件安裝在配置&?此外,您是否嘗試過遵循例外的建議,在服務器上啓用詳細日誌記錄?

+0

本地和遠程服務器它是同一臺機器。 –