Compiling and Testing Your First Web Service

Now, let's test the Greeting Web Service function you have just created.

  1. Click on the Run button on the Studio's toolbar.

  2. The application should automatically load in your default browser and display the page below, with a link to the Greeting Web Service. Click the Greeting Web Service link. Your browser will now show the GreetingService.wso page:



    There are a number of things to note on this page:

  1. Click on the Service Description link to see the WSDL document for this service. This WSDL (http://localhost/greetingwebservice/greetingservice.wso?WSDL) is what is use by client programs to consume (access) this web service. You will use this URL in the next tutorial section on the Creating a Web Service Client Class page.

    When you are done viewing the WSDL, click on the Back button of your browser to return to the WSO page for your Web Service.

Testing your Web Service

  1. Click the Greeting link to load the test page for the Greeting function. You should see the following page:



    On this page, you can actually test your web service's functionality. The Studio has created the page for you to test calling the Greeting web service function.

Web Service Test Page

The test page that DataFlex Studio creates for your Web Service is just that, a test page. Normally, a Web Service function is called from a Web Service client without any visual interface. The test page provides a quick and simple way of testing your Web Service's functionality without having to create a client for it.

  1. Type your name into the sName window and click the Invoke button. Another web page should open, displaying the result of the Greeting function:

 

The Web Service you have just created could now be placed on a Web server and access by Web Service client's designed in any tool that supports web services anywhere in the world.

 

 

Next Step

Debugging Code in Web Services