Hello,
I have seen a code snippet like this, can I return more than two objects in this task?
Then I can ask it like this.
bool responseState = false;
string responseData = "";
(responseState, responseData) = await ScadaClient.PostXmlToScadaAsync(CFG.SAP_Server, sXmlOrderData);
Log.Info("RequestRecipeFromScadaAsync() Scada-Call response state '" + (responseState ? "successful" : "failed") + "'.");
}
if (!responseState)
{
}
///////
class ScadaClient
{
private static readonly HttpClient client = new HttpClient();
public static async Task<(bool success, string responseData)> PostXmlToScadaAsync(string url, string xmlData)
{
try
{
if (string.IsNullOrEmpty(url))
{
return (false, "PostXmlToScadaAsync() Input-URL no data.");
}
var content = new StringContent(xmlData, Encoding.UTF8, "text/xml");
HttpResponseMessage response = await client.PostAsync(url, content);
if (response == null)
{
return (false, "No answer Scada module.");
}
The questions.
Don't I have to create a new Task instance here?
Return values can be 0 2 or n variables, right?
Do I see that correctly?
Could use a text file as a template,
then fill variables or assign values using the **replace **method.
How should I solve this with the authorization?
Like this
<q1:COM_1 xmlns:q1="urn:biztalk-org:biztalk:biztalk_1">
<q1:body>
<Z_COATING_ORDER xmlns="urn:sap-com:document:sap:rfc:functions">
<IM_BACK>$$$MyValue$$$</IM_BACK>
</Z_COATING_ORDER>
</q1:body>
</q1:COM_1>
<IM_BACK>$$$MyValue$$$</IM_BACK> Replace $$$MyValue$$$
No problems with namespace. Is it a good way?