I have created a project with two mock services. In the second mock service I am calling the first mock service using it's URL(I use the second service as a type of proxy). What I need is to "build" this URL using the port of the first mock service, which I want to be overridden by a global variable maybe.
Is that any way to do this?
Please help me, as I am stuck at this step for over a week and googling din't provide me any solution.
and the MockProxy is working as a "proxy" and returns the response of the MockService using this script: The problem is that the MockService Port is set:
So I want to override this Mock Service Port=8089 through command line or a property file, and then, in the script, instead of the http://localhost:8089/budg/inforeuro/api/public/monthly-rates use the overridden port, lets say http://localhost:<port>/budg/inforeuro/api/public/monthly-rates.
I don't know if it is possible to override the Port=8089 and then pass it as parameter in the URL.
Sorry if I didn't explain it in the first time, and thanks again for the quick reply!
I think that I answer my question when I was writing it. I have the same script, the one that builds the MockService URL and returns the response, in two places. In MockService level and in Get Currencies level (into the MockService). So maybe, the scripts were running one by one, so the first time, the port was taken. So I was receiving a connection refuse exception.
I have retain the script in the Get Currencies level, I hope this is the correct level to have it. And now I am able, using command line to run the service in any port and build dynamically the URL in the MockProxy using the solution you gave me.
Thank you for helping, it was the first time I am writing to such a community, I should have done it earlier.