| 1 |
Open the page that you want to add the web service to. The page you create must be a dynamic page using either ASP.NET VB or ASP.NET C#. |
| 2 |
Choose Window > Server Components to open the Server Components panel. |
| 3 |
In the Server Components panel, choose Web Services from the pop-up menu in the upper left of the panel, click the Plus (+) button, and select Add Using WSDL.
 |
| 4 |
Specify the URL of the WSDL file you want to use: |
 |
If you know the URL of the WSDL file, enter it in the URL of the WSDL text box.
 |
 |
If you don't know the URL of the WSDL file, browse a directory of web services. When you find the web service you want, copy and paste the URL of the web service into the WSDL text box. To launch a web browser, click the UDDI browse button (the Globe icon) and select one of the listed web service registries from the pop-up menu. Dreamweaver launches a browser and opens the selected registry. Locate the web service you want to use, and copy the URL of the WSDL file to the Clipboard (Control+C). Return to the Web Services Chooser and paste the URL into the dialog box. |
| 5 |
Ensure that the Proxy Generator pop-up menu is set to either .NET C# or .NET VB, as appropriate for your document type. |
| 6 |
Click OK. The proxy generator creates a proxy for the web service and introspects it. Introspection is the process of querying the internal structure of the web service proxy and making its fields, methods, and properties available through Dreamweaver MX. |
|
The proxy (also known as an abstraction class) contains the fields, methods, and properties of the web service and makes them available to the locally hosted page. When you generate a proxy for your page, Dreamweaver lets you view the fields, methods, and properties in the Components panel by introspecting the proxy. |
|
The web service is now available for use in the page. The web service and its available methods appear in the Server Components panel, and the proxy itself is visible in the File panel as a DLL file.
 |
| 7 |
In the Document window, in Code view, drag the methods you want to use into the page's code. |
|
Dreamweaver MX adds the method and dummy parameters to the page. |
| 8 |
Edit the inserted code with appropriate service instance names, data types, and parameter values, as required by the web service. The web service's author should provide descriptions of the necessary data types and parameter values. |
|
<html>
<head>
<title>Web Service</title>
<%@ Page Language="C#" ContentType="text/html" %>
</head>
<body>
<%
HelloWorld aHelloWorld = new HelloWorld();
String aString = aHelloWorld.SayHelloWorld();
%>
The web service says: <%=aString%>
</body>
</html>
|
|
The web page will appear similar to the example shown below in Code and design view.
 |
| 9 |
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 a 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. |
| 10 |
You must deploy the proxy DLL file to the web server, and place it in a directory labeled "bin." For example, if the path to the root of your web server is //myserver/wwwroot, then you must place the proxy DLL file in the directory //myserver/wwwroot/bin. If you or the server administrator have not yet created a "bin" directory, do so now. |
| 11 |
To deploy the proxy DLL files, click the Deploy arrow is the upper right of the components panel. The Deploy Supporting Files dialog box appears. |
|
Select the access method from the Access pop-up menu, and the server and directory path into which you want Dreamweaver MX to upload the web service's supporting files, and click the Deploy button.
 |
| 12 |
Dreamweaver MX copies the DLL file to the bin directory, and displays a dialog when the proxy has been successfully deployed. |
| 13 |
Test your page using the Dreamweaver MX Preview in Browser option (File > Preview in Browser).
 |
| 14 |
When you are done developing the page, deploy it to your production web server. |
 |
|