0
votes

I'm trying open OracleConnection from my WCF service:

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

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

but get an error:

{"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."}

And Stack Trace:

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

However, when I launch my WCF sevice on local server connection is opened correctly. That is my Web.config code:

 <?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 am I wrong?

Thanks a lot!

1

1 Answers

0
votes

If I get this correctly your service is functional as long as you run it on the database server is that correct?

On the machine failing, do you have the Oracle Client components installed & configured? Further, have you tried following the Suggestion from the exception, enabling verbose logging on the Server?