Set serviceName for calling service

I am new in creating java services in webMethods.

Can someone let me know on how can I pass a list of service Names and change the properties of those services using java services?

Thanks in advance.

Do you mean changing the flow service properties like stateless, cache results etc…?

If yes, use the service wm.server.services:serviceInfoSet at your own risk.

Hey Satya ,

Here is sample code which you can make use of , you need to customize it according to your requirement.

public static final void getAuditPropertyPerService(IData pipeline)
   throws ServiceException {
  IDataCursor pipelineCursor = pipeline.getCursor();
  String serviceName = IDataUtil.getString( pipelineCursor, "serviceName");

  
  NSName localNSName=NSName.create(serviceName);
  NSService localNSService=Namespace.current().getService(localNSName);
  
  int auditEnable=localNSService.getAuditOption(); //Give the audit enable property value
  
  AuditSettings as; 
  as=localNSService.getAuditSettings();  // to get the logOn and Include Pipeline property of the audit property
  
  IData asData = IDataFactory.create();

  asData=as.getAsData();
  
  
    
  // pipeline
  IDataCursor pipelineCursor_1 = pipeline.getCursor();
  IDataUtil.put( pipelineCursor_1, "asData", asData );
  pipelineCursor_1.destroy();
  
   
 }
1 Like

Thanks Rakesh.

But ,debugging the java service returns null in this step

NSService localNSService=Namespace.current().getService(localNSName);

Hi Sathya ,

Have you added all the import statements in the code , if not please add all the import statements mentioned below :-

import com.wm.data.*;
import com.wm.util.Values;
import com.wm.app.b2b.server.Service;
import com.wm.app.b2b.server.ServiceException;
import com.wm.app.b2b.server.ns.Namespace;
import com.wm.lang.ns.AuditSettings;
import com.wm.lang.ns.NSService;
import com.wm.lang.ns.NSName;

.

Hi Rakesh and Mahesh,

Thanks you.

I am able to set the property

But the issue now is the flow.xml of the services are getting corrupted when I reloaded the packages of the service which I have updated.

Any suggestion to get back the services.

Thanks,
Sathyaraj

Hi Sathya,

is there a flow.xml.bak available for the services affected?

If yes, you can replace the corrupted flow.xml with the bak-file and reload the package.
Hopefully it will not get corrupted again.

Can provide a sample of the correct and corrupted flow.xml for one of the services you have tested?

Sounds like strange behaviour anyway.

Regards,
Holger

Hi Holger,

Thanks for your inputs.

I services and the java code which got corrupted are the one created under a test folder in Default package.

I created them in a custom package and I don’t the issue now .

PFA the requested files

flow.xml (84 Bytes)
flow_bak.xml (84 Bytes)

Replacing the flow.xml with flow.xml.bak worked .

Thanks :slight_smile:

Hi Satya,

As the both files are identical I am not sure what happend exactly to make the flow.xml corrupt.

Regards,
Holger

Hi Sathya ,

The flow service is not corrupted , you have to reload the package to see it in package navigator.

Yes reload of restart the server some times these kind of will resolve:)

HTH,
RMG