Console Service Application works over WCF Service, but now Oracle connection breaks RRS feed

  • Question

  • I ha a console WCF Service where the database worked great, but I could not call it from ColdFushion. It was suggested I try a console application, so I did.

    ColdFushion can now talk to it, but now the application cannot connect to oracle...

                OracleConnection connection = new OracleConnection();
                string conn = ConfigurationManager.ConnectionStrings["dev"].ConnectionString;
                conn = conn + "User Id=myId; Password=myPassword;";
                connection.ConnectionString = conn;
                OracleCommand cmd = new OracleCommand();
                cmd.CommandText = "PK_SIDES_EMAIL_ADDRESSES_NET.get_emails_for";
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.Parameters.Add("p_employer_bin", OracleDbType.Varchar2, bin, ParameterDirection.Input).Size = 10;
                cmd.Parameters.Add("p_population", OracleDbType.Int32, population, ParameterDirection.Input).Size = 1;
                cmd.Parameters.Add("pCursor", OracleDbType.RefCursor, ParameterDirection.Output);
                cmd.Parameters.Add("pReturnCode", OracleDbType.Varchar2, ParameterDirection.Output).Size = 10;
                cmd.Parameters.Add("pReturnMsg", OracleDbType.Varchar2, ParameterDirection.Output).Size = 50;
                cmd.Connection = connection;

    Charlotte Williams

    Monday, April 13, 2015 8:56 PM


All replies

  • Hi Sharlie50,

    Where is the Oracle database code? Is it in the WCF Service implementation?

    >>ColdFushion can now talk to it, but now the application cannot connect to oracle

    Which application can not connect to the oracle? Please try to test the Oracle database code in a web application to see if it works.

    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, April 14, 2015 3:06 AM
  • The Oracle code is in the database. We are try to separation the database from the ColdFushion by having a WebService in the middle. I cannot connect at all now.

    The application that can connect and process is a WCF that runs in IIS but ColdFushion could not get to the methods so someone on this site told me to try a Self Hosting WCF and now ColdFushion can call, but no database connection.

    I can run both in debug, and have tested both.

    Is it possibly the binding?

                <service name="SidesSelfHost.SidesWebService">
                <!--<endpoint address="" -->
                    <endpoint address="GetEmailsFor" binding="basicHttpBinding" contract="SidesSelfHost.ISidesWebService" bindingConfiguration="Pramod">
                          <dns value="localhost" />
                          <!--<dns value="dev-wcf" />-->
                    <!--<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />-->
                    <endpoint address="mex" binding="mexHttpBinding" contract="SidesSelfHost.ISidesWebService" />
                        <!--What is Design_Time_Addresses?-->
                            <add baseAddress="http://localhost:8733/Design_Time_Addresses/SidesSelfHost/SidesSelfHost.SidesWebService.svc" />
                            <!--<add baseAddress="http://myserver/sideswebservice/SidesSelfHost.SidesWebService.svc" />-->

    Also, my tnsnames.ora is in the same folder and my project.

    Charlotte Williams

    • Edited by Sharlie50 Tuesday, April 14, 2015 3:48 PM
    Tuesday, April 14, 2015 3:33 PM
  • I have found that trying to access it on my virtual server gives me different results. If I use invoke in my ColdFushion ...

    <cfinvoke webservice = "http://dev-wcf/sideswebservice/SidesSelfHost.SidesWebService.svc?Wsdl"		
              method = "GetEmailsFor"
    	  returnVariable = "httpResponse"
    <cfdump var="#httpResponse#"> 

    I get this...

    Charlotte Williams

    • Edited by Sharlie50 Wednesday, April 15, 2015 4:20 PM
    Wednesday, April 15, 2015 4:12 PM
  • Whereas iF I use CFHTTP...

    <cfhttp	url="http://dev-wcf/sideswebservice/SidesSelfHost.SidesWebService.svc?Wsdl"
    <cfdump var="#cfhttp#">

    I get this

    Charlotte Williams

    Wednesday, April 15, 2015 4:21 PM
  • Tried httpResponse.getEmailRecord() for cfinvoke ...

    Charlotte Williams

    Wednesday, April 15, 2015 10:39 PM
  • Someone on stackoverflow solved it!!!

    Charlotte Williams

    Thursday, April 16, 2015 10:20 PM