• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Chapter 19. Adding and Modifying Data Co... > Using the Web Service Connector

Using the Web Service Connector

The WebServiceConnector component enables you to access remote methods offered by a server using the industry-standard SOAP (Simple Object Access Protocol) protocol. This gives a Web service the ability to accept parameters and return a result back to the generating script. By using the Flash Professional authoring tool and the WebServiceConnector component, you can access and bind data between a remote Web service and your Flash application. To save programming time, a single instance of WebServiceConnector component can be used to make multiple calls to the same operation. All you would have to do is to use a different instance of the WebServiceConnector for each different operation you wanted to call. You can use the WebServiceConnector to connect to a Web service, and make the properties of the Web service available for binding to properties of Flash UI components within your application. Think of a Web Service as a database of information, which can be downloaded—using the WebServiceConnector—and then displayed inside a Flash movie. For example, the Virginia Department of Parks and Recreation has a Web service (large database) that contains information in the WSDL format that you can download and display within a Flash document. Since the connection to the service is live, every time the Park Service changes information such as, the opening and closing times for the park, the Web Service would send that information to your Flash document (called listening) and automatically update the page.

Use the WebServiceConnector Component

Click the Window menu, point to Other Panels, and then click Web Services.

Click the Define Web Services button.

Click the Add (+) button to add the path for a Web service WSDL file.

Add a call to a method of the Web service by selecting the method, Control-clicking (Mac) or right-clicking (Win), and then selecting Add Method Call from the context menu.

Click OK.

This will create a WebServiceConnector component instance in your application.

Click the Parameters tab in the Component Inspector panel to edit these properties as needed. For example to provide additional formatting or validation settings.

Use the Bindings tab in the Component Inspector panel to bind the Web service parameters and the results that are now defined in your schema to UI Components within your application, such as a DataGrid.

Add a trigger to initiate the data binding operation by attaching the trigger to a button.

You can add an ActionScript on the WebServiceConnector component or create a binding between a Web service parameter and a UI control. Set its Kind property to AutoTrigger.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint