Hi.
I'm trying to develop a custom webservice using the DFS SDK tools using the WSDL-first approach.
I've used the the “generateService” task in order to generate my server client code.
Inside of the getDocument method code, I've tried to get a DFC session using the following code:
(from DFS 6.6 Development Guide)
IDfSessionManager manager = null;
IDfSession session = null;
try {
manager = DfcSessionManager.getSessionManager();
session = manager.getSession(dataObject.getIdentity().getRepositoryName());
// do DFC stuff with DFC session
} catch (DfException e) {
throw new ServiceException("E_EXCEPTION_STRING", e, dataObject.getIdentity());
} finally {
if (manager != null && session != null) {
manager.release(session);
}
}
But every single time I call the method, I get this error message:
ServiceException has occurred.
com.emc.documentum.ws.test.ServiceException
: Authorization failed, could not find identities in service context with token "temporary/127.0.0.1-1369139103688-3706247520840938757"
I've also tried to use the code below, in which I tried to create a new session, without counting on DFC sessions being managed by DFS:
| IDfClientX clientX = new DfClientX(); |
| IDfClient client = clientX.getLocalClient(); |
| |
| IDfSessionManager sessionManager = client.newSessionManager(); |
| |
| IDfLoginInfo loginInfo = clientX.getLoginInfo(); |
| loginInfo.setUser(userName); |
| loginInfo.setPassword(password); |
| loginInfo.setDomain(""); |
| sessionManager.setIdentity(repoName, loginInfo); |
but the same error occour.
I've read that I need to set a valid service context in the SOAP header, but I'm still trying to get this done.
My questions are:
Can I create a fresh new DFC session using pure DFC code without the DFS intervention?
Do I have to create this service context even though my custom service is annotated with "requiresAuthentication = false"?
Can I insert empty service context in the SOAP header? Or it's needed to have a full service context, containing username, password and repository name, even though my custom service is taking care of the process of creating and releasing DFC sessions?
Thanks in advance.