1. First we will add to the existing .NET solution a new project from the type “ASP.NET Web Service Application” and call it “AMUSEAuthenticationWebService”.

2. Change the name from “Service1.asmx” to “AuthenticationService.asmx”.

3. Now we add another project from type “Class Library” and call it “AMUSEAuthenticationLogic”.

4. Change the name of the class file from “Class1.cs” to “Authentication.cs”.

5. Copy now the “ValidateUser”-method from “AMUSEAuthenticationService”-project to the “AMUSEAuthenticationLogic”-project.

6. Now we build the solution and add the “AMUSEAuthenticationLogic.dll”, as reference, to the “AMUSEEAuthenticationWebService” project.

7. Now we can change the class name and method name from the “AuthenticationService.asmx.cs”:
Class name: AuthenticationService
Method name: ValidateUser(string username, password) and call the “ValidateUser” method from the “AMUSEAuthenticationLogic”
8. We will now change the existing “ValidateUser” method in the “AMUSEAuthenticationService”-project but we before that we should create the web service proxy class, so that we don’t have to use any configuration files further on.

9. To do that we have to start the “AMUSEAuthenticationWebService”.
a) Set the “AMUSEAuthenticationWebService” as StartUp project
b) Set the “AuthenticationService.asmx” as Start Page.
c) F5

11. Add the generated file now to the “AMUSEAuthenticationService” project.

12. Also add the “System.Web.dll” and the “System.Web.Services.dll” to the project, otherwise you will get exceptions!

13. Now we can implement the “ValidateUser” by calling the “ValidateUser” method from the “AuthenticationService”. You should have now the code as in following screenshot:

14. Now before we go over to the interesting Enterprise Architect and AMUSE part, we will also create the wsdl-file from our “AMUSEAuthenticationWebService”.

15. Start the “AMUSEAuthenticationWebService” again and click the “Service Description” on the opening web site or by just typing the http://YOURURL/AuthenticationService.asmx?WSDL”

16. You can now save that content as AuthenticationService.wsdl.
We will need that file now to load it into the Enterprise Architect.

17. Copy now the new “AMUSEAuthenticationService.dll” into the “ExternalReferences” and close Visual Studio.NET.

18. So let’s move now to the interesting part – the Enterprise Architect and AMUSE-PlugIn.

19. Open the Enterprise Architect solution from the last example and import the WSDL:
a) Menu – “Project” – “Web Services” – “Import WSDL”
b) Choose our AuthenticationService.wsdl file and import.
Your “Project Browser” should now look like in the following screenshot:

20. Now let’s try our workflow.

21. The workflow stops with an error?

22. If you look closer at the “Stack Trace” you can find the error:
And if you look at the detail description – double click on the “Error”. You can see that there is no connection to the remote server. To resolve that problem we could start now Visual Studio.NET again or better we start the service from Enterprise Architect!

23. For that reason we create a StartWebDev.bat file and place it into the “External References” folder. We add now following code:
call “C:\Program Files\Microsoft Visual Studio 9.0\vc\vcvarsall.bat”