How can get the service type that is used by 'wm.server.services:serviceInfo' in Java Service

Hi , I try to get the value of flow service’s service type by Java service, but i get the null value in result panel.
I use the method in wm.server.services:serviceInfo of WmRoot in Intergration Server.It 's can get the param svc_type of IS webpage,
but in my java service, the value of svc_type is showed null.
Can you help me to resolve this issue?
My java service code as below:


		IDataCursor idatacursor = pipeline.getCursor();  
		String serviceName = IDataUtil.getString(idatacursor, "serviceName");  
		IData idata1 = IDataFactory.create();  
		IDataCursor idatacursor1 = idata1.getCursor();  
		IDataUtil.put(idatacursor1, "service", serviceName);
		String serviceType = "";
		String fullname="";
		try  
		{  
		    IData idata2 = Service.doInvoke("wm.server.services", "serviceInfo", idata1);  
		    IDataCursor idatacursor2 = idata2.getCursor();
		    fullname= IDataUtil.getString(idatacursor2, "fullname");
		    IData idata3 = IDataUtil.getIData(idatacursor2, "type");
		    IDataCursor idatacursor3 = idata3.getCursor();
		    serviceType=IDataUtil.getString(idatacursor3, "svc_type");
		    idatacursor2.destroy();  
		}  
		catch(Exception exception) {
			exception.printStackTrace();
		}
		idatacursor1.destroy();
		IDataUtil.put(idatacursor, "fullname", fullname); 
		IDataUtil.put(idatacursor, "serviceType", serviceType); 
		idatacursor.destroy();

Thanks a lot! :smiley: :smiley:
20161022154633.png

What is your wM version?

You have use the class com.wm.lang.ns.NSServiceType; inorder to get the service type of any service.

Create a wrapper flow service around wm.server.services:serviceInfo and use the output directly.

Additional information:

Rememeber to destroy ALL pipelinecursors at the proper level.

idatacursor3 is not destroyed in your code sample.
It should be destroyed inside the try-block.

Regards,
Holger

I had destroyed this idatacursor3

My wM version is about 9.0 , i do’nt understant how to use the class com.wm.lang.ns.NSServiceType,In my code, The output fullname can show the right value, but svc_type is not show any value, i confuse this issue.

For your usecase you can get it done by a simple flow service which inovkes “wm.server.services:serviceInfo”

Could you run the service “wm.server.services:serviceInfo” from designer and capture the output results and post it here. Make sure you are able to access the WmRoot package in your designer if not you must add the below property to your IS extended settings

watt.server.ns.hideWmRoot=false