lundi 17 octobre 2016

Java Reflection - serviceCall

I want to call a Webservice with Reflection, because I generate all Webservice Files dynamically at runtime.

This is the Code statement:

 List<ResultObject> resObject = transaction.executeServiceCall("webservicename", new String[] { "webserviceInput" }, new Object[] { serviceList }, ResultObject.class);

The Declaration of the input parameters:

    Object resultObject = "com.test.ResultObject"; 
    String webservicename = "webservicename"; // from the choosen Webservice
    String webserviceinput = "webserviceInput; // from the choosen Webservice
   List<WebserviceInputObject> siList = new ArrayList<WebserviceInputObject>();

How can I call the executeServiceCall dynamically with the given Paramers?

Second Question is how to realize that construct with reflection:

 List<WebserviceInputObject> siList = new ArrayList<WebserviceInputObject>()

WebserviceInputObject is a Object, which also has to be loaded by java reflection





Aucun commentaire:

Enregistrer un commentaire