Siebel COM Data Control File Transfer

1.4k views Asked by At

Get the attachment from Siebel using COM Data Control.

SiebelBusObjectInterfaces.SiebelDataControl sblDataControl = new SiebelBusObjectInterfaces.SiebelDataControl();
bool success = sblDataControl.Login("host=\"siebel.TCPIP.None.None://bla bla bla /EAIObjMgr_enu\"", "karephul", getPassword());
string errorCode = sblDataControl.GetLastErrCode() + " " + sblDataControl.GetLastErrText();
SiebelBusObjectInterfaces.SiebelBusObject oBO;
SiebelBusObjectInterfaces.SiebelBusComp serviceRequest;
SiebelBusObjectInterfaces.SiebelBusComp actionAttachment;

oBO = sblDataControl.GetBusObject("Action");

actionAttachment = oBO.GetBusComp("Action Attachment");
success = actionAttachment.ActivateField("Activity Id");
success = actionAttachment.ActivateField("ActivityFileName");

success = actionAttachment.ClearToQuery();
success = actionAttachment.SetSearchSpec("Activity Id", "3-QOUKDD"); // hard code for now.
success = actionAttachment.SetSearchSpec("ActivityFileExt", "txt");
success = actionAttachment.ExecuteQuery(1); // ForwardOnly = 1, I guess;

if (actionAttachment.FirstRecord())
{
  string fileName = actionAttachment.GetFieldValue("ActivityFileName");
  string fileLoc = actionAttachment.InvokeMethod("GetFile", "ActivityFileName");
}

This below piece of code gets the appropriate file and keep it in temp folder of the server and gives me fully qualified path.

string fileLoc = actionAttachment.InvokeMethod("GetFile", "ActivityFileName");

Is there a way I can get the file to my local machine ?

Context:

This code is written in C# and we run this code on client side which does not have access to temp directory of the server.

Thanks Karephul

2

There are 2 answers

0
karephul On

After talking to some guys working on Siebel, I found that with COM API's I cannot get the file to the local machine.

Options:
1. Make the temp folder public and get the file.
2. Ask your Siebel team to expose a webservice to get the file.
3. Ask your Siebel team to provide REST type link to download file.

0
Max On

Since your are connecting via datacontrol to http, this is equivalent to connecting to the thin client. If you connect via a dedicated client, you can save the file directly onto your system.

The above 3 solutions would work, but I suggest you can send the file over by email, if attachment size is not a problem.