.NET Web Service Targets
PowerBuilder includes a target type for creating .NET Web services from nonvisual custom class objects.
The .NET Web Service target wizard gives you the option of creating a target from scratch or from an existing PowerBuilder target.
Creating a target from scratch
The .NET Web Service target wizard shares the following fields in common with the .NET Assembly target: Project Name, Target, Library, Library Search Path, PowerBuilder Object Name, Description, Resource Files, and Win32 Dynamic DLLs. However, it has four additional fields (Web service virtual directory name, Web service URL preview, Generate setup file, and Directly deploy to IIS), and the Namespace and Assembly File Name fields are specific to the .NET Assembly wizard.
Wizard field | Description |
---|---|
Project name | Name of the project object the wizard creates. |
Library | Name of the library file the wizard creates. By default, this includes the current Workspace path and takes the name you enter for the project object with a PBL extension. |
Target | Name of the target the wizard creates. By default, this includes the current Workspace path and takes the name you enter for the project object with a PBT extension. |
Library search path | Lets you add PBLs and PBDs to the search path for the new target. |
PowerBuilder object name | Name of the nonvisual object the wizard creates. By default this takes the name that you entered for a project object with an �n_� prefix. |
Description | Lets you add a description for the project object the wizard creates. |
Web service virtual directory name | The directory path you want to use as the current directory in the virtual file system on the server. By default, this is the full path name for the current PowerBuilder target. This field is similar to the �Initial current directory� field in the Web Forms wizard. |
Web service URL preview | Address for accessing the .NET Web service from an application. |
Resource file and directory list | List of resource files, or directories containing resource files, that you want to deploy with the project.
You can use the Add Files, Add Directories, or Search PBR Files buttons to add files and directories to the list box. You can select a file or directory in the list and click the Delete button to remove that file or directory from the list. When you select a directory, the resource files in all of its subdirectories are also selected by default. However, you can use the Resource Files tab in the Project painter to prevent deployment of subdirectory files. For more information, see �Resource Files and Library Files tabs� on page 195. |
Win32 dynamic library file list | Specifies any Win32 DLLs you want to include with your project. Click the Add button to open a file selection dialog box and add a DLL to the list. Select a DLL in the list and click Delete to remove the DLL from the list. |
Generate setup file | Select this option to deploy the Web service in an MSI file. When you select this option, you must provide a name for the setup file. |
Setup file name | Name of the setup file the wizard creates. You can copy this MSI file to client computers, then double-click the files to install the .NET Web service on those computers. |
Directly deploy to IIS | Select this option to deploy the Web service directly to an IIS server. When you select this option, you must provide an IIS server address. By default, the server address is �localhost�. |
When you click Finish in the wizard for a target you are creating from scratch, the wizard generates an Application object, a project object, a target, and a nonvisual object. You must add and implement a public method in the nonvisual object generated by the wizard before you can deploy it as a Web service.
Creating a target from an existing target
As with the other .NET target wizards, you can use the .NET Web Service target wizard to create a target from an existing PowerBuilder target. The existing target must be added to the current workspace and must include a PBL with at least one nonvisual object having at least one public method. The public method must be implemented by the nonvisual object or inherited from a parent. The AutoInstantiate property of the nonvisual object must be set to false.
When you click Finish in the wizard for a target you are creating from an existing target, the wizard creates a .NET Web Service target and a .NET Web Service project. The .NET Web Service target uses the same library list as the existing target from which you select nonvisual user objects.
Wizard field | Description |
---|---|
Choose a target | Select a target from the list of targets in the current workspace. |
Specify a project name | Select a name for the project you want to create. You must create a project object to deploy nonvisual objects as .NET components. |
Choose a project library | Specify a library from the list of target libraries where you want to store the new project object. |
Choose NVO objects to be deployed | Expand the library node or nodes in the list box and select check boxes next to the nonvisual objects that you want to deploy. |
Use .NET nullable types | Select this check box to map PowerBuilder standard datatypes to .NET nullable datatypes. Nullable datatypes are not Common Type System (CTS) compliant, but they can be used with .NET Generic classes if a component accepts or returns null arguments or if reference arguments are set to null. |
Only include functions with supported datatypes | Select this check box if you do not want to list functions that are not supported in the .NET environment. After you create the .NET project, the functions are listed on the Objects tab for the project when you open it in the Project painter. |
Only include functions with supported datatypes | Select this check box if you do not want to list functions that are not supported in the .NET environment. The functions will be listed in the Select Objects dialog box that you can open for the project from the Project painter. |
- Modifying a .NET Web Service Project
You can modify a .NET Web Service project from the Project painter. - Configuring ASP.NET for a .NET Web Service Project
Configure .NET Web Service projects in the same way you configure .NET Web Forms projects. - Deploying and Running a .NET Web Service Project
After you create a .NET Web Service project, you can deploy it from the Project painter or from a context menu on the project object in the System Tree.