I have a SOAP method with 40+ parameters, I would like to pass an map rather than list all params in the method call. Here is a sample code:
Map input = [ Param1: 'Test1', Param2: 'Test2' ]
class WSClient {
def post(String Param1, String Param2) {
println "Param1: ${Param1}, Param2: ${Param2}"
}
}
def client = new WSClient()
client.post(input)
Is there a way to "spread" map key/values to method formal parameters? Or is there any other way of doing this the groovy way?
This code above results in No signature of method: WSClient.post() is applicable for argument types: (java.util.LinkedHashMap)