Link to home
Create AccountLog in
Avatar of ank5
ank5Flag for India

asked on

Cannot call DFS webservice from Java client

I have created a Java client which calls a custom DFS service.

public class ClientGetResume {
    
    private static String ehrsModuleName = "ehrs";
    private static String host = "http://localhost:8888/services";
    
    public static void main(String[] args) {
        
        ContextFactory contextFactory = ContextFactory.getInstance();
        IServiceContext serviceContext = contextFactory.newContext();
        RepositoryIdentity repoId = new RepositoryIdentity();
        repoId.setRepositoryName("test123");
        repoId.setUserName("Administrator");
        repoId.setPassword("Hello123");
        serviceContext.addIdentity(repoId);;
        ServiceFactory serviceFactory = ServiceFactory.getInstance();
        IEHRS ehrsSvc = null;
        try {
            ehrsSvc = serviceFactory.getRemoteService(IEHRS.class, 
                             serviceContext, ehrsModuleName, host);
            
            String empName = ehrsSvc.getEmployeeName("1"); 
        }catch(ServiceInvocationException sie) {
            sie.printStackTrace();
        }catch(ServiceException se) {
            se.printStackTrace();
        }
    }

Open in new window

Then I run this client, I get the following error
com.emc.documentum.fs.rt.AuthenticationException: Authorization failed, please review identities provided in service context "temporary/127.0.0.1-1289576056736-8988088621673498558"

Open in new window

I have verified that the credentails are correct and also dfc.properties is in classpath. I can otherwise access the service from browser at
http://localhost:8888/services/ehrs/EHRS

Open in new window

Is there something that I am doing incorrectly in the client that I have written?

Thank you
Avatar of ank5
ank5
Flag of India image

ASKER

Also, if I call this web service using soapUI by passing the SOAP request directly it works absolutely. Here is the SOAP request I am passing in soapUI

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ehrs="http://www.mycompany.org/EHRS/">

   <soapenv:Header>
      <ServiceContext xmlns="http://context.core.datamodel.fs.documentum.emc.com/" xmlns:ns2="http://properties.core.datamodel.fs.documentum.emc.com/" xmlns:ns3="http://profiles.core.datamodel.fs.documentum.emc.com/">
       <Identities password="Hello123" 
          repositoryName="test123" 
       userName="Administrator" 
        xsi:type="RepositoryIdentity" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>
      </ServiceContext>
   </soapenv:Header>

   <soapenv:Body>
      <ehrs:GetEmployeeName>
         <empID>2</empID>
      </ehrs:GetEmployeeName>
   </soapenv:Body>
</soapenv:Envelope>

Open in new window

Avatar of ank5

ASKER

Here is the complete stack trace

 
22:03:42,127 DEBUG [DFS] com.emc.documentum.fs.rt.context.impl.ClientReflectionServiceInvoker - assignProperties: can't find setter for getClass
com.emc.documentum.fs.rt.AuthenticationException: Authorization failed, please review identities provided in service context temporary/127.0.0.1-1289579611408-1305564370477894500
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.authenticate(AuthorizationHandler.java:119)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.handleMessage(AuthorizationHandler.java:63)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.handleMessage(AuthorizationHandler.java:1)
    at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:284)
    at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:135)
    at com.sun.xml.ws.handler.ServerSOAPHandlerTube.callHandlersOnRequest(ServerSOAPHandlerTube.java:133)
    at com.sun.xml.ws.handler.HandlerTube.processRequest(HandlerTube.java:116)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
    at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)
    at local.stacktrace(0:0)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at com.emc.documentum.fs.rt.context.impl.ClientReflectionServiceInvoker.invoke(ClientReflectionServiceInvoker.java:78)
    at com.emc.documentum.fs.rt.context.impl.SoapClientInvocationHandler.invoke(SoapClientInvocationHandler.java:66)
    at com.emc.documentum.fs.rt.context.impl.UcfClientInvocationHandler.invoke(UcfClientInvocationHandler.java:47)
    at com.emc.documentum.fs.rt.context.impl.HttpSessionInvocationHandler.invoke(HttpSessionInvocationHandler.java:65)
    at com.emc.documentum.fs.rt.context.impl.ReturnedContentTransformationHandler.invoke(ReturnedContentTransformationHandler.java:45)
    at com.emc.documentum.fs.rt.context.impl.OperationOptionsHandler.invoke(OperationOptionsHandler.java:59)
    at com.emc.documentum.fs.rt.context.impl.ContextThreadLocalInvocationHandler.invoke(ContextThreadLocalInvocationHandler.java:51)
    at com.emc.documentum.fs.rt.context.impl.ServiceContextInvocationHandler.invoke(ServiceContextInvocationHandler.java:30)
    at $Proxy14.getEmployeeName(Unknown Source)
    at com.db.client.prodlayer.ClientGetResume.main(ClientGetResume.java:32)
Caused by: java.lang.NoClassDefFoundError
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.newClient(SessionManagerFactory.java:171)
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.getClient(SessionManagerFactory.java:161)
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.newManager(SessionManagerFactory.java:105)
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.getManager(SessionManagerFactory.java:96)
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory.getSessionManager(SessionManagerFactory.java:60)
    at com.emc.documentum.fs.rt.context.impl.SessionHandlerUtil.getManager(SessionHandlerUtil.java:37)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.authenticate(AuthorizationHandler.java:84)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.handleMessage(AuthorizationHandler.java:63)
    at com.emc.documentum.fs.rt.impl.handler.AuthorizationHandler.handleMessage(AuthorizationHandler.java:1)
    at com.sun.xml.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:284)
    at com.sun.xml.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:135)
    at com.sun.xml.ws.handler.ServerSOAPHandlerTube.callHandlersOnRequest(ServerSOAPHandlerTube.java:133)
    at com.sun.xml.ws.handler.HandlerTube.processRequest(HandlerTube.java:116)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:243)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:444)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:135)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServletDelegate.java:129)
    at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServletDelegate.java:160)
    at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java:75)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:179)
    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:241)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
    at java.lang.Thread.run(Thread.java:595)

Open in new window

Avatar of Mick Barry
Caused by: java.lang.NoClassDefFoundError
    at com.emc.documentum.fs.rt.context.impl.SessionManagerFactory$SessionManagerWrapper.newClient(SessionManagerFactory.java:171)


that looks like the real cause.  It can't find a dependant class
ASKER CERTIFIED SOLUTION
Avatar of Mick Barry
Mick Barry
Flag of Australia image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ank5

ASKER

It could not find the dfc.properties as it was not in the ear.

Thanks for the help