You can absolutely tell the middle tier service to run SQL queries, that is the only job of the OpenDentBusiness.Reports.GetTable() method. You just have to ask the middle tier service to run that query in a way that the middle tier understands. Also, I forgot to mention that you have to scrub the return value for any escaped charaters due to SOAP
E.g. payload:
Code: Select all
<?xml version="1.0" encoding="utf-16"?>
<DtoGetTableLow xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Credentials>
<Username>Jason</Username>
<Password>Password1</Password>
</Credentials>
<MethodName />
<Params>
<DtoObject>
<TypeName>System.String</TypeName>
<Obj>
<string>SHOW CREATE TABLE account</string>
</Obj>
<IsNull>False</IsNull>
</DtoObject>
</Params>
</DtoGetTableLow>
Which the Middle Tier will return me:
Code: Select all
<DataTable>
<Name/>
<Cols>
<Col>Table</Col>
<Col>Create Table</Col>
</Cols>
<Cells>
<y>account|CREATE TABLE `account` ( `AccountNum` bigint(20) NOT NULL AUTO_INCREMENT, `Description` varchar(255) DEFAULT '', `AcctType` tinyint(3) unsigned NOT NULL DEFAULT '0', `BankNumber` varchar(255) DEFAULT '', `Inactive` tinyint(3) unsigned NOT NULL DEFAULT '0', `AccountColor` int(11) NOT NULL DEFAULT '0', PRIMARY KEY (`AccountNum`) ) ENGINE=MyISAM AUTO_INCREMENT=14 DEFAULT CHARSET=utf8</y>
</Cells>
</DataTable>
Our de-scrubbing logic is kind of tricky so you'll have to reverse engineer our OpenDentBusiness.XmlConverter.XmlToTable() method which usesOpenDentBusiness.XmlConverter.XmlStringUnescape() heavily.
Good luck, what you're doing is not going to be easy. It's easy if you have access to OpenDentBusiness in a plugin sort of way because then you'd just invoke Reports.GetTable() directly and it would do all of the above for you.