Refer to Choosing WCF or Web API for additional information on WCF and Web API.
This presentation project provides a WCF service interface for ClearPath Data Source applications. This project does not rely on ASP.Net; instead, it uses SOAP for session management and security.
This presentation project uses scaffolding to generate the application code. Scaffolding provides some advantages over the traditional way ePortal generated the WCF service application code:
You have the ability to target multiple ePortal data sources.
You can create a custom scaffold template to help control code generation.
The code is not regenerated on every build.
Notes:
If you are creating a new WCF web service, it is recommended that you use this project type rather than the WCF Service Application.
Refer to Creating a WCF Service Application for more information.
This topic describes a simple case of adding a WCF Service project to an existing solution that already contains a data source project. Other use cases are also possible, such as cases where multiple data source projects exist. Refer to Reference Information for Scaffolded Projects for more information.
Procedure 1 - Creating a WCF Service Application using Scaffolding
To add a WCF Service Application project, do the following:
On the File menu, point to New and click Project.
In the Create a new project dialog box, do the following:
Notes:
Select C# or All Languages from the Language list.
Select Windows or All Platforms from the Platform list.
The ePortal templates are not displayed if other values are selected.
Select ePortal Presentation from the Project Type list.
The ePortal Presentation templates are displayed.
Do any one of the following to select the template:
From the templates list, select WCF Service Application, and then click Next.
Enter WCF Service Application in the search option, select the template from the search result, and then click Next.
Optionally, change the Project name, Location, and Framework, and click Create.
Notes:
If you do not select a desired Framework, a default Framework version is selected.
For guidelines on selecting the .NET version, refer to Multi-Targeting Issues.
In Solution Explorer, right-click the new presentation project name and select Add Unisys ePortal Data Source Reference.
The Add Unisys ePortal Data Source Reference Dialog box appears. For more information, refer to Adding Unisys ePortal Data Source Reference.
Select the desired data source project and click OK.
Click Build and select Build Solution.
In Solution Explorer, right-click the new presentation project and select Add then select New Scaffolded Item. The Add Scaffold dialog opens.
Select Unisys WCF Service for ePortal Data Source, then click Add.
The Scaffold Unisys WCF Service for ePortal Data Source Dialog opens.
Complete the dialog as described in the help reference.
Refer to Consuming the Web Service Methods by a Web Service Client for information about using the methods in a Web service client.
Procedure 2 - Preparing to use the Presentation Project
To prepare to use a WCF Service Application project, do the following:
Modify the Web.config file.
Perform custom programming if required.
Modifying the Web.config File
The Web.config file is preconfigured with three bindings:
basicHttpBinding (name=SessionlessBinding) for use with services that do not require a session
wsHttpBinding(name=ReleaseBinding) for use by a deployed application that requires a session
wsHttpBinding(name=TestBinding) for local testing of applications that require a session
For information on using these bindings, refer to Modifying the Web.config File.
Performing Custom Programming
When you create and scaffold the project, ePortal Developer generates code to implement your service. Refer to Controlling the Runtime Behavior for WCF Services Using Scaffolding for information for customizing this implementation.
Procedure 3 - Testing
Refer to Testing a Presentation Project.
Procedure 4 - Modifying the Service.svc File
When you create the solution, ePortal Developer sets the Service.svc file as follows:
<%@ ServiceHost Language="Ce Debug="true" Service="WcfServicel.Service" Factory="ServiceFactory" CodeBehind="Service1.scv.cs" %>
Before you stage the website to ePortal, set the Debug option to False.
Next Step
Continue to Staging a Presentation Project.