Skip to Content
0
Former Member
Apr 23, 2014 at 11:18 AM

Trying to get a employee with DI SERVER

86 Views

Hi experts,

I'm using the DI Server and I need update a employee, for that, I need to get a specific employee and then modify him, but when I use the GetByKey method, it always returns "no record found". My code is the next one:

SBODI_Server.Node DISnode = new SBODI_Server.Node();
string sSOAPans = null;
XmlDocument xmlDoc = new XmlDocument();
string sCmd = <?xml version=""1.0"" encoding=""UTF-16""?><env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/""> 
+ "<env:Header><SessionID>" + SessionID + "</SessionID></env:Header>"
+ @"<env:Body><dis:GetByKey xmlns:dis=""http://www.sap.com/SBO/DIS"">"
+ "<Object>oEmployeesInfo</Object><EmployeeID>" + empID + "</EmployeeID></dis:GetByKey></env:Body></env:Envelope>";

sSOAPans = DISnode.Interact(sCmd);
xmlDoc.LoadXml(sSOAPans);

I just have one employee in the data base, with empID = 1. I tried to view all employees with the next code:

string sCmd = <?xml version=""1.0"" encoding=""UTF-16""?><env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/""> 
+ "<env:Header><SessionID>" + SessionID + "</SessionID></env:Header>"
+ @"<env:Body><dis:GetObjectKeyBySingleValue xmlns:dis=""http://www.sap.com/SBO/DIS"">"
+ "<ObjNum>oEmployeesInfo</ObjNum><PropName>Religion</PropName><Value>--</Value><Condition>bqc_NotEqual</Condition>"
+ "</dis:GetObjectKeyBySingleValue></env:Body></env:Envelope>";

And the EmployeeID 1 appears.

What am I doing wrong?

Regards,

Pedro