How can get the service type that is used by '' 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 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="";
		    IData idata2 = Service.doInvoke("", "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");
		catch(Exception exception) {
		IDataUtil.put(idatacursor, "fullname", fullname); 
		IDataUtil.put(idatacursor, "serviceType", serviceType); 

Thanks a lot! :smiley: :smiley:

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 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.


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 “”

Could you run the service “” 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