Hey everyone,

Some persons from EMC Documentum Forums stated that AcmeCustomService which comes with DFS SDK seems to be too complex for beginners, and “HelloWorld” service would be more understandable. I will try to show you how to create your first own simple HelloWorld like DFS service.

This tutorial will contain of 3 parts:

  • Service creation
  • Java client creation
  • .NET remote client

Before we’ll start, we should setup our build environment.

Note: You should have ant installed in order to run tutorial scripts.

1. Download attached helloworldservice.zip and extract it into emc-dfs-sdk-6.0\samples folder. It contains project template similar to AcmeCustomService. Lets assume “HelloWorldService” folder as root.

2. Open etc\dfc.properties and set host, repository name, username and password for your docbase.

3. Open build.properties and set preferred context root and module names, or leave them as they’re now.

Here is service code:

package com.service.example;

import com.emc.documentum.fs.rt.annotations.DfsPojoService;

@DfsPojoService(targetNamespace = “http://example.service.com”, requiresAuthentication = true)
public class HelloWorldService
{
public String sayHello(String name)
{
return “Hello ” + name;
}
}

@DfsPojoService annotation specifies service’s namespace, and states if service requires docbase authentication (true by default)

Place this source with appropriate package into src\service folder.

Go to root folder (HelloWorldService) and run from command line the following command:

ant artifacts package

This command converts annotated classes to DFS services and package them into ear file.

At this step, you should have example.ear deployment file in HelloWorldService\build folder. This ear file contains our service which can be deployed into Weblogic application server.

Copy this file into weblogic’s autodeploy directory. You can also set weblogic deployment dir at autodeploy.properties file and run “ant deploy” command.

With default values at build.properties, your service should be available by the path: http://host:port/services/example/HelloWorldService

That’s all for now. In the next part of tutorial I will explain how to create client and call this service remotely.