09-09-2017 6:19 AM - edited 02-04-2024 12:56 AM
Dear Experts,
I am creating a web application.In my web application "How can I access a DI server and run the application with the help of DI server?"
1.How to Link a DI server with Web Application ?
Hi,
Your Web Application should have the reference to DI Server. Later, you can send the common XML structure to DI Server to operate the Add, Update Methods for different business objects.
Here is one similar discussion that you can refer.
Also refer to SDK Help Center for the same.
Hope it helps! All the best!
Kind regards,
ANKIT CHAUHAN
SAP SME Support
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I would ask you to refer to SDK Help Center once. Here is a sample to use the DI Server to make the company connection:
1. To connect to the company database using DI Server:
initScriptPath = System.Windows.Forms.Application.StartupPath + "\\";
string users = null;
string Response = null;
string SessionID = null;
string sCmd = null;
SBODI_Server.Node DISnode = default(SBODI_Server.Node);
DISnode = new SBODI_Server.Node();
dynamic cmd = "<?xml version=\"1.0\" encoding=\"UTF-16\"?>";
cmd += "<env:Envelope xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\">";
cmd += "<env:Body><dis:Login xmlns:dis=\"http://www.sap.com/SBO/DIS\">";
cmd += "<DatabaseServer>DEWDFWTEC4209</DatabaseServer>";
cmd += "<DatabaseName>SBODEMOIN</DatabaseName>";
cmd += "<DatabaseType>dst_MSSQL2012</DatabaseType>";
cmd += "<DatabaseUsername>sa</DatabaseUsername>";
cmd += "<DatabasePassword>Welcome1</DatabasePassword>";
cmd += "<CompanyUsername>manager</CompanyUsername>";
cmd += "<CompanyPassword>ankit</CompanyPassword>";
cmd += "<Language>ln_English</Language>";
cmd += "<LicenseServer>DEWDFWTEC4209:30000</LicenseServer>";
cmd += "</dis:Login></env:Body></env:Envelope>";
Response = DISnode.Interact(cmd);
2. Write the Response to XML:
WriteXML(Response, "Login_Response.xml");
Where WriteXML() is defined as below:
private void WriteXML(string FileContent, string Filename)
{
System.IO.StreamWriter oWrite = null;
oWrite = System.IO.File.CreateText(initScriptPath + Filename);
oWrite.Write(FileContent);
oWrite.Close();
}
3. To Extract/Get the Session ID after the connection.
SessionID = ExtractSessionID("Login_Response.xml");
Where ExtractSessionID() is defined as below:
public string ExtractSessionID(string Filename)
{
string ResponseXML = null;
int i = 0;
int j = 0;
ResponseXML = ReadXML(Filename);
if (ResponseXML.Contains("SessionID"))
{
//i = ResponseXML.IndexOf("<SessionID>") + Strings.Len("<SessionID>");
i = (ResponseXML.IndexOf("<SessionID>") + "<SessionID>".Length);
j = ResponseXML.IndexOf("</SessionID>");
return ResponseXML.Substring(i, j - i);
}
else
{
return "";
}
}
Hope it helps!
Kind regards,
ANKIT CHAUHAN
SAP SME Support
User | Count |
---|---|
97 | |
8 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.