I successfully added a service reference to my ASP.NET project, but I get a EndpointNotFoundException
, when I try to call a method from a service client:
BenchmarkManagementServiceClient client = new BenchmarkManagementServiceClient();
try {
int id = Convert.ToInt32(userId);
if (client.VerifyUser(id)) { //Here is the exception thrown
FormsAuthentication.SetAuthCookie(userId, false);
}
} catch (FormatException) { }
client.Close();
Thats curious, because I can access the address of the service via a browser and nearly the same code works in another project (Windows Forms).
Thanks for your help.
Edit:
The message of the inner exception is The remote name could not be resolved
The service I try to request is running in the Azure-Cloud.
The ASP.NET project is running locally on my computer.
My other project (where everything works fine) also runs locally on my computer.
Maybe it's good to know, that I had to create the Service Reference without the package Newtonsoft.Json
. Otherwhise occured warnings during the code generation for the service reference.