Advertisement
Guest User

Untitled

a guest
Nov 1st, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. using MyProject.ServiceReferences.Authentication;
  2.  
  3. namespace MyProject
  4. {
  5. public class MyClass : IMyClass
  6. {
  7. public string userName;
  8. public string password;
  9.  
  10. Authentication auth;
  11.  
  12. public MyClass()
  13. {
  14. userName = "user";
  15. password = "pass";
  16.  
  17. auth = new Authentication(); //invalid operation error !! An unhandled exception of type 'System.InvalidOperationException' occurred in System.ServiceModel.dll
  18. }
  19.  
  20. public LoginResponse Login()
  21. {
  22. LoginRequest loginRequest = new LoginRequest(userName, password);
  23. LoginResponse loginResponse = auth.login(loginRequest);
  24.  
  25. return loginResponse;
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement