Wednesday, January 28, 2009

at 8:09 AM Posted by Visuals India

After selecting a web service, generating its proxy, and adding it to the Components panel, you can insert it into a page.

The illustration below shows the Components panel with the web service proxy Helloworld added. The Helloworld proxy provides one method, sayHello, which prints "Hello World."

This is a picture of the feature being described.

The following example instantiates the HelloWorld web service using ColdFusion. To learn more about creating a web services, and to see additional examples using .NET and JSP, visit the Macromedia Support Center at: www.macromedia.com/go/creating_web_services.

To add a web service to a page:

  1. In the Document window, in Code view, drag the sayHello method into the page’s HTML.

    Dreamweaver adds the method and dummy parameters to the page.

  2. Edit the inserted code with appropriate service instance names, data types, and parameter values, as required by the web service. The web service should provide descriptions of the data types and parameter values.

    In the ColdFusion example shown below, the web service is enclosed by the tags. When developing a web service in ColdFusion, use to instantiate the web service and invoke its methods.

               
  3. If you want to bind a return value to a visual element, switch to Design view and place a visual element on the page that can accept data binding. Then switch back to Code view and enter the appropriate code to bind the returned value to the visual element. When creating web services, refer to the technology provider’s documentation for the proper syntax with which to both instantiate the service and display the returned values to the page.

    In this example, the value returned for the variable aString is output using the ColdFusion tag. This will display the sentence "The web service says: Hello world!" to the page.

            The web service says: #aString#   
  4. When you deploy web pages to a production server, Dreamweaver automatically copies the pages, the proxy, and any necessary libraries to the web server.

0 comments: