Flynet Viewer 2012 Developer's Learning Guide

Generating and Testing the Web Service

Generating and Testing the Web Service

Previous topic Next topic  

Generating and Testing the Web Service

Previous topic Next topic  

Generating the Web Service is achieved with a Wizard that manages options and generates a complete, ready-to-compile Visual Studion ASP.NET Web Service Solution.

 

Provided Help:

 

 Web Service Wizard Help: The Wizard Pages

 

Tutorial Section:

 

1.To initiate the Wizard, right-click on the TaskProject node and select Generate / Full Task-Based Web Service:
clip0112
 

2.At the start of the Wizard, two panels provide validation messages.  If your project is missing some screen identification or has some other serious errors impacting the quality of the code generation, the warning and error messages are displayed in these two panels.  If the Next button is disabled, it means that you need to read any error messages and make the appropriate corrections:
clip0113
Additional Help: Module and Task Validation
 
clip0114
Additional Help: Navigation Validation
 

3.The Application Details panel is next, which provides settings for the generated application.  The settings here are generally not something you want to change later (although you can) as any customized modules may require a bit of hand editing for such properties as Namespace, which is included in every generated module.  The host name is one that you can select here so that it is generated into the web.config correctly (you can easily change this setting later, but in the web.config itself:
clip0115
Additional Help: Application Details
 

4.The Solution Project Configuration includes details about the Visual Studio definitions generated with your solution:
clip0116
Additional Help: Solution Configuration
 

5.Clicking Next on the Solution Project Configuration panel runs the generation.  A number of messages will appear, which in the first generation will usually include the same messages visible in the Validation pages.  When you generate again into the same Visual Studio folder, which is very common and expected, you will want to watch for merge warnings will are described in a later tutorial.
 
When the Wizard has completed generating the solution, you have the option to run MSBUILD to create a the ASP.NET application ready for testing.  Click on Yes:
clip0118
 

6.This compiles the application--if there are errors during the compile phase, the errors will be displayed.  This may be due to the use of a reserved word or other error, but errors are not expected.  Feel free to utilize the Export / Application Archive option and email the archive zip file to your Flynet vendor technical support and we will be happy to help resolve the issue.
 
Usually, errors will not occur and you will see messages like the following.  Mark and copy the first to the clipboard:
clip0119
 

7.Now open a browser, paste the URL and press enter to access the Internet Information Services (IIS) ASP.NET html test rig that is automatically provided for your web service:
clip0120
 

8.Since Pooled Sessions were not selected, the Logon method needs to be called first in order to obtain a Session Key, which is then used as the first parameter for any other web service calls to associate each transaction call with the session obtained with the Logon call:
clip0122
 

9.You will need to key the credentials to logon, normally userid and password but that depends on the logon sequence in your host.  Here you can see the UserID and Password for the Flynet simulated Insurance host application being entered:
clip0123
 

10.A successful logon returns the session key.  [Optional:] This is a good time to load the Flynet Microsoft Management Plug-In to view the session.  Right-click on the Blue FV icon in tray icon area and select the MMC:
clip0124
 

11. [Optional:] You should see the session started--right-click and select View Selected:
clip0125
 

12. [Optional:]  This will display a Terminal Emulator attached to the session started with the Logon method, which you can use to watch any subsequent transactions run:
clip0126
 

13.Going back to the web browser with the session key, Select and Copy the session key to the clipboard:
clip0127
 

14.Now return to the original browser session for the ASMX module and select the transaction you modeled in the earlier tutorial:
clip0128
clip0129
 

15.Now paste the session key, key the other parameters and click on Invoke:
clip0130
 

16.This displays the results, which is a "complex object" return type, which in web services terminology simply means that it is an object with many properties rather than a simple value such as an integer or string:
clip0131
 

17.When all finished, return and run the Logoff method using the same session key, and the session will be logged-off and terminated (stopped).  That is the completion of this tutorial...