I have URL of web service and I am trying to call that web service in my WebAPI project.
URL: http://domain/soap/wsdl11?services=XYZ_Service&sap-client=007&sap-user=demo&sap-password=demo@123
The code that I have tried:
Service.DemoService client = new Service.DemoService();
client.Credentials = new NetworkCredential("demo", "demo@123", "domain");
client.PreAuthenticate = true;
client.GetData("Test");
But its showing:
The request failed with HTTP status 401: Unauthorized.
The above URL is working in the browser.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…