I am trying to consume a soap web service from an Azure web functions project. I am having difficultly coding the call to the soap service. I have successfully added a WCF web service reference. The reference.cs file has been generated and the SOAP service is asynchronous.
The code is written in C# DOT.NET core 2.0, connecting to a database hosted in an Azure environment.
I believe I should be using threading and making call to an Asynchronous function. When I try to reference code in a separate class file, I get errors relating to using the static keyword.
public class ExpireData
{
private readonly string _Endpoint;
public ExpireData(IConfiguration config)
{
_Endpoint = config["ServiceURL"];
}
[FunctionName("ExpireData")]
public void Run([TimerTrigger("0 * * * * *")]TimerInfo myTimer, ILogger log)
{
BasicHttpBinding binding = new BasicHttpBinding();
EndpointAddress address = new EndpointAddress(_Endpoint);
ServiceSoapClient client = new ServiceSoapClient(binding, address);
var result = client.ExpireDataAsync();
}
The value stored in result is: Id = 1018, Status = WaitingForActivation, Method = "{null}", Result = "{Not yet computed}"
Aucun commentaire:
Enregistrer un commentaire