Skip to content

Creating a Client Web Service Class

Before you can create a web-service client class, you need to locate the service’s WSDL file. You can do this by loading your Internet Browser and pointing to a WSDL file. Any service available on the web should have a mechanism for locating its WSDL. For an example of this, visit x-methods here.

If you are testing a DataFlex web-service, the convention for locating the service (e.g. http://localhost/MyApplication/HelloService.wso) and its WSDL has already been discussed (e.g. http://localhost/MyApplication/HelloService.wso?WSDL).

Once you’ve located your WSDL in your browser, you will want to enter the URL into the client class generator. It might be a good idea to mark and copy the URL.

Within the Studio, select the following from the menu:

  1. File
  2. New
  3. Class
  4. Client Web Service Class

When the class generator is loaded, enter (or paste) the WSDL name into the form labeled WSDL URL:. Press the Parse button. The class generator will now locate the WSDL, load it, parse it, and determine how it should be represented as a DataFlex class.

Next, you need to save this class and add it to the Studio. Press the Generate Class button. This will invoke a dialog that allows you to determine the class name and a group name in your class palette.

You are allowed to regenerate classes. For example, if your server web-service changes, you will need to generate the class again. If the generator sees that you are generating a duplicate class, it will warn you and allow you to overwrite the existing class definition.

This is all you need to do to create a web-service client. The class is now created and available for use in your project. At this point, you can choose to create additional clients or you can close the class generator and use the client in your application.

See Also