c# - Endpointnotfoundexception : active endpoint raising error sometimes -
we working on ecommerce project data fetched restfull webservices. using async-await
programming model.
some services being requested using channelfactory
class , since cannot have async approach using channelfactory nor webservice provides us, using different approach shown below.
var customerlocationtask = task.run(() => new orderservice().getcustomerlocation(customerid)); var customercountrytask = this.cmscustomercountrycode(customerid); await task.whenall(customerlocationtask, customercountrytask);
here, requesting 2 webservices in unnatural async approach , our webservice being called in synchronous fashion using channelfactory
. , code cmscustomercountrycode
is:
public async task<string> cmscustomercountrycode(string customerid) { orderservice orderservice = new orderservice(); customer customer = await task.run(() => orderservice.getcustomer(customerid, responseformat.json)); return customer.billtoaddress.country; }
the issues here endpointnotfoundexception
in cmscustomercountrycode
method. network issue or our async approach not correct ?
Comments
Post a Comment