Quantcast
Channel: SCN : All Content - Web Dynpro Java
Viewing all articles
Browse latest Browse all 1288

How to Pass List as Input to Webservice

$
0
0

Hello All,

For our one of the PI webservice we were using single values as input parameters but now it should accept multiple values or list as input. Please find below mentioned code :

 

 

private final List<String> purchaseOrderValues = new ArrayList<String>();

 

SPI_OrderStatus model = new SPI_OrderStatus();

 

  IWDMessageManager manager = wdComponentAPI.getMessageManager();

 

   

  IPublicSPIComponent.ISearchSPINode searchNode = wdContext.nodeSearchSPI();

 

  IPublicSPIComponent.ISearchSPIElement searchElement = wdContext.currentSearchSPIElement();

 

 

  OrderStatus_Request_Columns request = new OrderStatus_Request_Columns(model);

 

  if(!this.purchaseOrderValues.isEmpty() || searchElement.getPurchase_Order() != null){

 

   if(this.purchaseOrderValues.isEmpty()){

 

   this.purchaseOrderValues.add(searchElement.getPurchase_Order());

  }

 

request.setPurchase_Order(this.purchaseOrderValues);

 

     }

 

********************************

request.setPurchase_Order(this.purchaseOrderValues); on this line when we are setting Purchase_order as input list I am getting below mentioned error on this line.


java.lang.ClassCastException: Cannot cast class java.lang.String to interface com.sap.tc.cmi.model.ICMIModelClass


Please let me know how to add those mutiple values to webservice input.


Regards,

Mayank Saxena




Viewing all articles
Browse latest Browse all 1288

Latest Images

Trending Articles



Latest Images