At Xpoda Platform, web service communications are made by triggering methods from DLL libraries.
The steps required for installation are listed below :
- First, you should copy your DLL files to
C:\inetpub\wwwroot\XpodaService\Addition\Web Service Communication
- If Addition and Web Service Communication folders do not exist under XpodaService folder, you should create these folders manually.
- If you get an error while creating these folders or copying files into these folders, try stopping XpodaService site from IIS (Internet Information Services) management interface. Don't forget to restart IIS site again.
- .NET Framework version 4.8 should be used. .Net Standart or .net Core is not supported at the moment.
- If you use reference libraries (eg. Nuget) in your project do not forget to copy these assemblies to Addition folder as well.
- Parameter types and return types of all methods must be :
Dictionary <string, object> ()
──────────────────────────────
Setting Value of a Textbox
In this example when clicked to a button we will calculate the sum of two integers and set this to text value of a textbox control.
The screenshot of Xpoda Studio showing the transfer of the sum of two values typed in the numeric box to the textbox is as follows.
With the action "When Clicked – Update Value" added to the button element, to take the sum of the x and y parameters taken from the screen and transfer them to the list element, write SELECT ListValue1 AS x, ListValue2 As y in the query field and select Library, Class and Method and save the action.
The method is as follows. The parameter retrieval and return value must be Dictionary <string, object> ().
public static Dictionary<string, object> SumOfValues(List<Dictionary<string, object>> parameters)
{
var result = new Dictionary<string, object>();
var List = new List<Dictionary<string, object>>();
result[“Error”] = “”;
try
{
var value = Convert.ToInt32(parameters[0][“x”]) +
Convert.ToInt32(parameters[0][“y”]);
List.Add(new Dictionary<string, object> { { “Result”, value } });
result[“List”] = List;
}
catch (Exception ex)
{
result[“Error”] = ex.Message;
}
return result;
}
After the actions and necessary processes are done on the manager screen, they are saved now and the relevant button is clicked on the Xpoda client screen, the sum of the two values is transferred to the value field (list element) via dll method call. Client screenshot is as follows.
──────────────────────────────
Transferring Value Sums to the List
The screenshot of Xpoda Studio showing the transfer of the sum of two values typed in the numeric box to the list element is as follows.
With the action "When Clicked – Update Value" added to the button element, to take the sum of the x and y parameters taken from the screen and transfer them to the list element, write SELECT ListValue1 AS x, ListValue2 As y in the query field and select Library, Class and Method and save the action.
The method is as follows. The parameter retrieval and return value must be Dictionary <string, object> ().
public static Dictionary<string, object> TransferTwoValuesSumstoList (List<Dictionary<string, object>> parameters)
{
var result = new Dictionary<string, object>();
var List = new List<Dictionary<string, object>>();
result[“Error”] = “”;
try
{
var value = Convert.ToInt32(parameters[0][“x”]) +
Convert.ToInt32(parameters[0][“y”]);
List.Add(new Dictionary<string, object> { { “Result”, value } });
result[“List”] = List;
}
catch (Exception ex)
{
result[“Error”] = ex.Message;
}
return result;
}
After the actions and necessary processes are done on the manager screen, they are saved and when the relevant button is clicked on the Xpoda client screen, the sum of the two values is transferred to the value field (list element) via dll method call. Client screenshot is as follows.
──────────────────────────────
Transferring Data to the List with a String Value Field Parameter
The screenshot of Xpoda Studio for transferring the string value typed in the text box to the list element by creating a datatable is as follows.
With the action "When Clicked - Update Value" added to the button element, a datatable is created in the method with the name parameter taken from the screen, and choosing Library, Class, Method to transfer the data to the list element, the action is saved by writing SELECT ‘$PTextValue' AS name in the query field.
The method is as follows. The parameter retrieval and return value must be Dictionary<string, object>().
public static Dictionary<string, object> GetList(List<Dictionary<string, object>> parameters)
{
var result = new Dictionary<string, object>();
var List = new List<Dictionary<string, object>>();
result[“Error”] = “”;
try
{
var dt = new DataTable();
dt.Clear();
dt.Columns.Add(“Name”);
dt.Columns.Add(“FullName”);
var row = dt.NewRow();
row[“Name”] = parameters[0][“name”];
row[“FullName”] = “Xpoda 1”;
dt.Rows.Add(row);
var row1 = dt.NewRow();
row1[“Name”] = parameters[0][“name”];
row1[“FullName”] = “Xpoda 2”;
dt.Rows.Add(row1);
var row2 = dt.NewRow();
row2[“Name”] = parameters[0][“name”];
row2[“FullName”] = “Xpoda 3”;
dt.Rows.Add(row2);
foreach (DataRow dr in dt.Rows)
{
var rows = new Dictionary<string, object>();
foreach (DataColumn col in dt.Columns)
rows.Add(col.ColumnName, dr[col.ColumnName]);
List.Add(rows);
}
result[“List”] = List;
}
catch (Exception ex)
{
result[“Error”] = ex.Message;
}
return result;
}
After the actions and necessary processes are applied on the Studio screen, they are saved and when the relevant button is clicked on the Xpoda client screen, a datatable is created with the string value taken from the screen, and the data is transferred to the value field (list element) with dll. Client screenshot is as follows.