Beruflich Dokumente
Kultur Dokumente
Issue:
When you chain custom services and try to build the Services the build fails lets see a Scenario
from the DFS sample code itself
import com.emc.services.samples.common.client.IAcmeCustomService;
import com.emc.documentum.fs.rt.ServiceException;
import com.emc.documentum.fs.rt.ServiceInvocationException;
import com.emc.documentum.fs.rt.annotations.DfsPojoService;
import com.emc.documentum.fs.rt.context.ContextFactory;
import com.emc.documentum.fs.rt.context.IServiceContext;
import com.emc.documentum.fs.rt.context.ServiceFactory;
@DfsPojoService(targetNamespace =
"http://common.samples.services.emc.com", requiresAuthentication =
true)
public class HelloWorldService
{
public String sayHello(String name)
{
e.printStackTrace();
} catch (CustomException e) {
e.printStackTrace();
} catch (ServiceException e) {
e.printStackTrace();
}
return "Hello " + name;
}
}
Here in the sample code of DFS I am chaining the services, Here everything looks fine and when
you now you build this service during the genarateArtifacts ant task the Build will fail with a will
get a ClassNotFound compiler error at
IAcmeCustomService secondService =
serviceFactory.getService(IAcmeCustomService.class, context);
What happens here is when the build does the initial clean up all the generated Client interfaces
are deleted and DFS currently not checking for any dependencies.
Let me take the example of dfs-build.xml that’s the part of CoreDocumentumProject in composer
<generateArtifacts serviceModel="${gen.src.dir}/${context.root}-
${module.name}-service-model.xml" destdir="${gen.src.dir}/">
<src location="${src.dir}" />
<classpath>
<path refid="projectclasspath.path" />
</classpath>
</generateArtifacts>
</target>
I had raised a support case with EMC and they told me that this is not currently supported!!!!
And they will add this as a feature request
This means we cannot Chain Custom Services unless EMC fix this or we do a semi manual
workaround to overcome this issue.
Step 1,
Identify the Services those will call the custom services, and create a new source directory for it
in composer, here I am calling them as depended_src and move the services that calls the
custom services to there, the depended src should be in a separate path than the webservices-
src
Step 2
1) Now Edit the Build file and add these two properties
<property name="my.core.services.classes"
value="${service.projectdir}/Web Services/bin/classes" />
The dep.src.dir should point to the depended src location mentioned in step 1
<generateArtifacts serviceModel="${gen.src.dir}/${context.root}-
${module.name}-service-model.xml" destdir="${gen.src.dir}/">
<src location="${dep.src.dir}" />
<classpath>
<pathelement
location="${my.core.services.classes}"/>
<path refid="projectclasspath.path" />
</classpath>
</generateArtifacts>
<!-- signal build is done -->
<!-- used by DFSBuilder.java -->
<copy todir="${src.dir}/../" file="${basedir}/dfs-
builddone.flag" />
</target>
Step 3
2) Copy all the service entries from (between <module> and </module><context-
root>-<module-name>-service-model.xml you can find this in <project_dir>\Web
Services\bin\gen-src folder
5) If you want to create the jar files now you can call the package task after this.
This should help you to chain custom services , and if you found any alternate ways please
comment.