WCF Service Target and Project Properties

You define basic properties for a WCF Services project when you create its target in the WCF Service wizard. You can define and modify all its properties later using the Project painter.

WCF Service Project Painter: General Tab

Most of the settings in this tab are also defined in the WCF Service target wizard.

Setting Description
Project name Name of the project object the wizard creates.
Library Name of the library directory the wizard creates. By default, this includes the current solution 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 solution path and takes the name you enter for the project object with a PBTX extension.
Library search path Lets you add PBL directories to the search path for the new target.
WCF service assembly name File name of the WCF service assembly. The WCF service assembly is created in the output directory. For an IIS host, it is also copied to the virtual directoy.
Output directory The full path where the service is deployed.
Application file name The console application file name. This .exe file is created in the output directory.
Note: Do not specify the same name as the assembly file.
Base address For console hosts only. The base URL for deployed WCF Services. Use this syntax:

[transport protocol]://[machine name or domain name][: port number]

For example:
http://localhost:8001
net.tcp://localhost:8002
net.pipe://localhost
You can deploy multiple WCF Services under the base address. For example:
http://localhost:8001/MyService
http://localhost:8001/MyOtherService
Web service virtual directory name The virtual directory name that the IIS-hosted WCF Service is deployed to.
Service URL preview Automatically displays the URL accesses the service, based on the virtual directory name.
Build type Choose either Debug or Release.
Options Any of these settings:
Use .NET nullable types – Maps PowerScript standard datatypes to .NET nullable datatypes when selected. 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.
Enable DEBUG symbol – Choose this option if the nonvisual objects you deploy as a Web service contain code with the DEBUG conditional compilation symbol, and you want this code to run.
Verify CLS compliance – If you choose this option, the PowerBuilder to .NET compiler (pb2cs) sets CLSCompliantAttribute to true for the component, and the C# compiler applies Common Language Specification (CLS) rules to the public methods of the component. If you set this value for a component that is not CLS-compliant, the compiler issues the appropriate warnings.
Deployment options Choose one of these deployment modes, also specified in the wizard:
Setup file name – If you enter a file name with no path information, the file is created in the directory where the PowerBuilder target file exists. If you enter a file name with the path, make sure that the directory exists before deployment begins.
Deploy directly to IIS – Enter the machine name or IP address of an IIS server.

WCF Service Project Painter: Objects Tab

To implement a WCF Service, you must define its properties in the Objects tab. The tree view on the left of the tab lists the available NVOs. Select an NVO to set its Web service name and target namespace, and to specify which functions to expose as Web service methods.

NVO icons in the tree view indicate which NVOs are configured and to be deployed; NVOs without the icon are not deployed.

Setting Description
Web service name The name of the WCF Web service for the selected NVO. Default: the NVO name.
Target namespace The targetNamespace attribute of the root descriptions element of a Web Services Description Language (.WSDL) XML file. Default: http://tempurl.org.
Web service URL The URL of the Web service. Click Run Web Service to open a Web browser to this URL.
Web service WSDL The URL of the Web service. Click View WSDL to open a Web browser to view the WSDL in the browser window
Note: No WSDL is available when the binding is set to WebHttpBinding. In this case, you can provide information about calling a RESTful Web service by specifying this URL:
http://localhost/test/servicename.svc/help”
Service Attributes These attributes control important behavior such as the InstanceContextMode property.
Service Attribute – Configure service attributes for the WCF Service class.
Operation Attribute – Configure operation attributes for a function that you select in the Functions Table (described in the next row).
Functions Table This table displays the functions available to be exposed as Web services. You must select and configure at least one function for an NVO, otherwise it cannot be deployed.

In each row, specify and modify the message name, its function prototype, and operation attribute.

  • By default, the message name is the same as the NVO function name. However, PowerBuilder modifies message names when two functions have the same name, because the Web service standard does not allow two methods to have the same name.

WCF Service Project Painter: Remaining Tabs

The remaining tabs in the Project painter are identical to the same tabs in the .NET Assembly Project painter.