Reputation: 625
I have been asked to explore various ways in which Siebel COM interface can be accessed in order evaluate the best possible solution.
So far we have been able to access the COM interface through Excel (VBA) and PHP now I need to explore if the same is possible in Python. From my initial research I know python does provide access to DLL's using win32 api but there is no comprehensive tutorial available to get me started.
Below the code snippets that we use for excel and php.
Excel snippet::
Private Function CreateConn(strConnect As String, strEnterprise As String, strPort As String, strPass As String) As Boolean
Dim errCode As Integer
Dim errText As String
Dim SiebelApp As SiebelDataControl
Set SiebelApp = CreateObject("SiebelDataControl.SiebelDataControl.1")
CreateConn = True
SiebelApp.Login "host=""siebel://" & strConnect & ":" & strPort & "/" & strEnterprise & "/EAIObjMgr_enu""", _
"sadmin", strPass
errCode = SiebelApp.GetLastErrCode()
If errCode <> 0 Then
errText = SiebelApp.GetLastErrText
CreateConn = False
Exit Function
PHP Snippet::
<?php
function CreateConn($strConnect, $strEnterprise, $strPort, $strPass) {
global $errText;
$SiebelApplication = new COM('SiebelDataControl.SiebelDataControl.1') or die("Unable to instantiate SiebelDataControl");
$ConnStr = "host=\"siebel://".$strConnect.":".$strPort."/".$strEnterprise."/EAIObjMgr_enu\"";
$SiebelApplication->Login($ConnStr, "sadmin", $strPass);
$errCode = $SiebelApplication->GetLastErrCode();
if ($errCode != 0) {
$errText = $SiebelApplication->GetLastErrText();
return false;
} else {
return true;
}
}
?>
Can someone help me with example snippet for python to accomplish the same thing i.e creating connection?? Thanks
Upvotes: 0
Views: 1655
Reputation: 116
To know more you can have reference to Python Programming on Win32
To begin with you can try the code snippet
import win32com.client
oSiebelApp = win32com.client.Dispatch("SiebelDataControl.SiebelDataControl.1")
oSiebelApp.Login("Connection String")
Upvotes: 1