I'm on Version 10 of the platform

I'm attempting to use the DbConnection_Edit method to automate changing database passwords when we have to change them. I'm using Oracle, and no matter what I try for the DBConfigParams, the API call returns "invalid Connection String" (see below).

It is NOT an issue with the database credentials - I can use TOAD to log in with them.

Has anyone had success with this method using Oracle in platform version 10?

For the DBConfigParams, I've tried the following formats, which all return the same error:


Host=fully.qualified.hostname.com;Port=9999;ServiceName=NotTheRealDatabaseName;NLSLanguage=;Username=NotTheRealUserName;Password=NotTheRealPassword;

Host=fully.qualified.hostname.com;Port=9999;ServiceName=NotTheRealDatabaseName;NLSLanguage=;Username=;Password=;

Host=fully.qualified.hostname.com;Port=9999;ServiceName=NotTheRealDatabaseName;NLSLanguage=;Username=NotTheRealUserName;Password=<hidden>;

The same as above, with the brackets escaped


Here's a sample request (scrubbed, of course) and response.


<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:out="http://www.outsystems.com">
   <soapenv:Header/>
   <soapenv:Body>
      <out:DbConnection_Edit>
         <!--Optional:-->
         <out:Authentication>
            <!--Optional:-->
            <out:Username>NotTheRealServiceAccount</out:Username>
            <!--Optional:-->
            <out:Password>NotTheRealServiceAccountPassword</out:Password>
         </out:Authentication>
         <!--Optional:-->
         <out:EnvironmentKey>882841c5-958c-43d3-b9c2-575991f2b227</out:EnvironmentKey>
         <!--Optional:-->
         <out:DbConnectionName>NotTheRealDatabaseConnectoinName</out:DbConnectionName>
         <!--Optional:-->
         <out:ProviderKey>Oracle</out:ProviderKey>
         <!--Optional:-->
         <out:Description>My database description</out:Description>
         <!--Optional:-->
         <out:DBUsername>NotTheRealUsername</out:DBUsername>
         <!--Optional:-->
         <out:DBPassword>NotTheRealpassword</out:DBPassword>
         <!--Optional:-->
       <out:DBConfigParams>Host=fully.qualified.hostname.com;Port=9999;ServiceName=NotTheRealDatabaseName;NLSLanguage=;Username=NotTheRealUserName;Password=NotTheRealPassword;</out:DBConfigParams>
         <out:TestConnection>true</out:TestConnection>
      </out:DbConnection_Edit>
   </soapenv:Body>
</soapenv:Envelope>




<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <soap:Body>
      <DbConnection_EditResponse xmlns="http://www.outsystems.com">
         <Success>false</Success>
         <Status>
            <Id>0</Id>
            <ResponseId>7</ResponseId>
            <ResponseMessage>Invalid connection string.</ResponseMessage>
            <ResponseAdditionalInfo>Connection string test failed with '{detail}'.</ResponseAdditionalInfo>
         </Status>
      </DbConnection_EditResponse>
   </soap:Body>
</soap:Envelope>

Solution

I figured it out.  I'll leave this up in case anyone else has a similar issue.

For Oracle, it looks like the API needs the non-tnsnames format of the connection string:

<out:DBConfigParams>Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=databaseserver.fully.qualified.name.com)(PORT=9999))(CONNECT_DATA=(SERVICE_NAME=databasename)))</out:DBConfigParams>

The fun part is that if you set up the connections in ServiceCenter using the Basic Configration option, when you pull the database record from the API, you're going to get the format I was trying to use above.  so I'll have to build the DbConfigParams instead of just echoing what was already there.  Also, when you send this over using the API, it flips the Advanced Configuration flag.


Solution