0

I run this async function from web service project:

    [WebMethod]
    public static async Task<string> CreateEventsAsync(Event @event, string accessToken)
    {
        try
        {
            var graphClient = GetGraphServiceClient(accessToken);

            var NewEvent = await graphClient.Me.Calendar.Events
                 .Request()
                 .AddAsync(@event);

            return NewEvent.Id;

        }
        catch (Exception e)
        {

            throw;
        }
    }

and the project break and return this result:

<?xml version="1.0" encoding="UTF-8"?>
<TaskOfString xmlns="http://api.tipulog.mkhltd.co.il/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
Rebekka
  • 11
  • 2
  • You forgot to include the result – Matthew Oct 29 '20 at 14:25
  • 2
    Why are you using the ancient ASMX stack? That was replaced by WCF 12 years ago. It's *completely* unsuitable for new development and I'm not sure it was even upgraded to work with Tasks – Panagiotis Kanavos Oct 29 '20 at 14:26
  • `TaskOfString` that's your `Task` result. ASMX was built 10 years *before* Tasks and knows nothing about them. If you really wan to create a SOAP web service, use WCF. If you don't have a strict requirement for SOAP, create a REST API eg with Web API or use gRPC – Panagiotis Kanavos Oct 29 '20 at 14:28

0 Answers0