Creating Service Operations using Personify Data Services

In order to create a service operation, first we need to start with defining the service operation’s signature by using the Personify WSD. To do this, choose the service operation option from the Standard Tools window of the Personify WSD and drag it onto the canvas. This will create a new service operation on the canvas. You can then use the Properties window to name this service operation. An example of creating a new service operation is as below:

 

Each service operation will require an input entity and an output entity of type service parameter entity, which serve as input and output parameters to your implementation of the service operation. You can use the Properties window to choose your input and output entities from an existing drop-down list (as shown below) or create new ones.

 

To create a new input/output entity for your service operation, choose the Entity (Service Parameter) option from the Standard Tools window of the Personify WSD. You can then add scalar or complex properties to your input/output entity as needed by your service operation’s implementation. The following example demonstrates this:

 

After finishing designing the signatures of your service operations, you can build and publish your service operation’s signatures using the 4 available build options from the Personify WSD’s command toolbar (Please see the Compilation and Publishing section on how to use these build options).

 

At this point, only your service operations’ signatures are published to the server. The actual implementations of your service operations still need to be developed. The building process of your service operations in Personify WSD will automatically create a Visual Studio C# project, containing necessary class file definitions, and assembly references for you to implement your service operation logics. This project will be generated into the compilation output folder in the form of a zip file such as below. You can find the exact output location of this zip file by viewing the messages in the output window of the Personify WSD after build is done:

 

Please note that this generated project (and related assemblies) is not source controlled by Personify WSD. This project and its implementation will need to be managed manually.

 

To implement your service operations, extract the generated project template zip file, then open the Visual Studio project file (.csproj). This will open up a project solution, containing a class file for each of your defined service operations. An example is below:

 

Inside each of these class files is a predefine class definition corresponding to your service operation name. Each of these classes will have a generic DoProcess method, where you will need to provide the implementation logics for your service operations. An example is as below:

 

After you finish the implementations for your service operations, build your project into an assembly based on the project settings. You can see the details of the generated project settings by right clicking on the project and choosing Properties, which will show the Visual Studio project properties window, as shown below:

 

By default, the project will have the assembly name and default namespace auto-generated based on your namespace setting in the Personify WSD. However, you can customize this to your references.

 

After a successful build of your service operation implementations into an assembly file (.dll), you will need to manually publish this assembly to the bin folder of your Personify Data Service website:

 

After your service operation assembly is published, you will need to modify the web.config file of your Personify Data Service website to specify the layer priority of your implementation. Look for the “PersonifyDataServicesLayer” section in the web.config, and add a new LayerItem entry for your layer. Please see the Layering and Customization section for details on how to configure a new layer. An example of adding a new layer for the “Personify.DataServices.Business.Custom” assembly is below:

 

See also:

·            Executing Service Operations (without code)

·            Executing Service Operations (using .NET client)

·            CRUD Operations