Invoking flow service from a JAVA service using Service.doThreadInvoke

Hi Team,

I am trying to invoke flow service from a JAVA service using Service.doThreadInvoke.but i am getting access denied exception.
it works if i make execute ACL as anonymous for called svc but i dont want to do that.I tried passing session object in the input still its not working.

ServiceThread st=
Service.doThreadInvoke(“DocServices_v5_4.v1_0.Util”,“invokeDocURL”,Service.getSession(),input);
output=st.getIData();

error:

com.wm.app.b2b.server.ServiceException: java.util.concurrent.ExecutionException: com.wm.app.b2b.server.ServiceException: com.wm.app.b2b.server.ServiceException: Error occured: com.wm.app.b2b.server.AccessException: [ISS.0084.9004] Access Denied

please suggest if there is any other way to implement this.

Thanks,
Shiva

thanks ,
shiva

Are you getting this error other than Anonymous ACL, did you create your own group,created a user in that group and tried to assign that user to call a flow from java service ?

Thanks,

Definitely access issue.
Please verify the permission of the service which is being invoked from JAVA Service.

Regards,
Syed

Hi Shiva,

please provide your wM version.

Service.doThreadInvoke (at least most of them, depends on Signature) is meanwhile deprecated (at least for 9.5 SP1 and newer) and is being replaced by Service.doThreadInvoke with an additional parameter time of Type long for how long to wait for the thread according to JavaAPI Reference.

Please check the JavaAPI Reference for further details.

Regards,
Holger

You need to create context by connecting to the server with credentials and then use the context.invoke to execute the flow service. Best way to do this would be to follow below steps,

  1. Go to Designer and connect to the Integration server hosting your Flow service.
  2. Right click on the flow service in the package navigator and click “Generate Code”.
  3. Choose the last option in the list “For calling this service from a client”.
  4. When prompted to save the .java file, save it to your machine.
  5. Add this Java code to your original Java project and add wm-isclient.jar to the build path in eclipse.
  6. Now use username\password to connect.
    context.connect(server, username, password);
  7. After that use the context.invoke(NSName svcName, Values data)

Hi,

Point seven can be one of the following:

  • IData invoke(NSName svcName, IData data) throws ServiceException
  • Values invoke(NSName svcName, Values data) throws ServiceException
  • IData invoke(java.lang.String ifc, java.lang.String svc, IData data) throws ServiceException
  • Values invoke(java.lang.String ifc, java.lang.String svc, Values data) throws ServiceException
  • InvokeThread invokeThreaded(NSName svcName, Values data)
  • InvokeThread invokeThreaded(java.lang.String ifc, java.lang.String svc, Values data)
    (from JavaAPI reference for Class Context)

Regards,
Holger