I want to access method globally. However, I have different payloads with different datasource. Is there a way to determine the datasource of the payload that it needs to access from the method call.
Your problem is not entirely clear to me - can you be a little more specific?
I created a method to write some data to output file and I put this as part of the tools. Now each payload have a different service such as Payment, Transfer , Balance and this are all pointing to different datasources. Everytime I call the method to pull the data out. I would also like to access the datasource of that specific payload. Is that possible?
There is no way to dynamically read the data source that is set in the tool. You can access the data source using the SOAtest scripting API, but you have to know the name of the data source that you want to access.