How To : Importing a WSDL File
Contents |
[edit] Description
This document describes how to import a Web Services Description Language file (WSDL) into a project .
[edit] Prerequisites
[edit] Procedure
To import a WSDL into your project:
- Choose between path A or B:
- On the menu bar at the top of Bungee Builder, choose Solution > New,
- In the dialog that appears, from the Design Group drop down box, choose the design group in which you want to create the new solution.
- In the Soution Name text box, type the name you want to give your solution.
- In the Choose the Projects you would like to include in your Solution pane, select WSDL (Web Service Description Language).
Note You may also want to keep the TypeLib and AppProject items selected as well, as you are likely to need both types of projects if you are creating a full-fledged application.
- Click Next.
- In the New Typelib Project Settings pane, in the Name text box, type the name you want to give your WSDL file.
- Click Next.
- At the top of the Solution Explorer on the root node of the solution tree, right-click and choose Add Project.
- From the Choose the Projects you would like to include in your Solution pane, select WSDL (Web Service Description Language).
- Click Next.
- On the menu bar at the top of Bungee Builder, choose Solution > New,
- In the New WSDL Project Settings pane that appears, in the Name text box, type the name you want to give your WSDL file.
Note The name you provide must be unique, at least within the scope of the solution, or the Bungee system appends a number ensuring name uniqueness.
- In the WSDL URL text box, type the URL of the WSDL you want to import (for example: http://www.weather.gov/forecasts/xml/DWMLgen/wsdl/ndfdXML.wsdl).
- If you are importing your WSDL from a disk, select Upload WSDL from Disk, then click Upload.
- In the dialog that appears, click Upload, then browse to the disk location and click Open, then click Attach File.
- If you are wanting to import more than one WSDL into this project, click Import. When the Success! text appears, then type a new Name and new WSDL URL, then click Import again. Repeat for as many separate WSDLs as you are adding.
- Click Done.
- The new WSDL appears at the bottom of the Solution Explorer. If you want, you can expand the solution tree node for the imported service, and begin inspecting the structure of the WSDL.
- Note If a WSDL has more than one namespace, the Bungee system imports each namespace in the WSDL into a separate TypeLib. The naming convention of these TypeLibs is: <namespace>. Since most WSDLs only have one namespace, the entire WSDL will be imported into one project named <WSDL project name>.
[edit] Updating a WSDL
When a WSDL is updated by the source that publishes the WSDL, your Bungee-powered application may "break." When this occurs, re-synchronize the WSDL, which updates the imported data.
To update a WSDL:
- Open your application in Bungee Builder.
- Either right-click on the WSDL project and choose Update project WSDL, or click the Update Project WSDL button at the top of the Solution Explorer.
- If needed, in the Change WSDL Location text box, type the new location of the updated WSDL, or if you have a copy of the WSDL on disk, select Upload WSDL from Disk, then click Upload.
- In the dialog that appears, click Upload, then browse to the disk location and click Open, then click Attach File.
- In the dialog box that's displayed, click OK.
[edit] Error Handling
If there is a problem importing the WSDL, an error dialog appears containing information about the errors encountered. For example, in the image below, the URL supplied as the WSDL Location was for a web page that contains a link to the WSDL, and was not for the actual WSDL. This resulted in the error message details that appear in the image.
In addition, you can use the Event Viewer to view the actual XML received and sent. When an error occurs, the XML is automatically sent to the Event Viewer. However, if you want the XML to always be sent to the Event Viewer, you need to set a variable on the SOAP service. To set the variable, add an assignment statement, in Bungee Logic, and set the left side to servicename.throwDebugMessages (under Inherited : SoapService), and the right side to Data with the checkbox checked (this sets the Boolean to true), where servicename is the name of the SOAP service (see below).
[edit] Examples
The image below shows a WSDL that has been imported into Bungee Builder, and the resulting class structure in the Solution Explorer.
[edit] Next Steps
Adding a Class
Adding a Field to a Class
Adding a Function to a Class
Adding a Form to a Class