Build/Test Issues

Error when calling WebService

Started by c_cousens on 2,381 views

Hello,

I'm getting the following error when declaring variables which are from my WebService. This occurs on the first line of my declarations:

// Declare Variables
----> svc_Authentication.AuthenticationClient client = new svc_Authentication.AuthenticationClient();
svc_Authentication.AuthenticateRequest ar = new svc_Authentication.AuthenticateRequest();
svc_Authentication.AuthenticateResponse res = new svc_Authentication.AuthenticateResponse();

"System.InvalidOperationException: Could not find default endpoint element that references contract 'svc_Authentication.IAuthentication' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."

This function returns a GUID of an ID and a blank one if the function fails.

My test is as follows

public void tst_Authenticate()
{

clsMobileAPis aa = new clsMobileAPis();
Guid guidToken = aa.strAuthenticate_SOAP();
Assert.AreNotEqual(guidToken, Guid.Empty);

}

Please help or is there any more info I can give to help get this resolved?

Please Note: The application runs 100% perfectly if I run it, it's just the NCrunch and the test that fails.

Thanks,

Chris

Edited

Resolved by copying and pasting the endpoints in to the Unit Test project's app.config.

Edited

Post a reply

Log in to reply.