How to do HTTP post to a service running at Integration server


I am working with Webmethods integration Server 4.6, and want to execute a service named (pub.math:addInts) using HTTP based communication. what is the URL I should point in my java code? what is the data I need to post to this service?. Here the issue is I cannot use JAVA Client API of Webmethods, but we should use only pure Java API like following.

Please help me and share some points to how to proceed in this.


---- CODE BELOW -----------

URL url = new URL(url);
HttpURLConnection connection = (HttpURLConnection)url.openConnection();
connection.setRequestProperty(“Authorization”, "Basic " + Base64.encode(“user:password”));

--------- END OF CODE ----------

Here is the URL to call the service and pass the parameters to be added together.


In Developer, either Ctrl_B or the >Test>Run in Browser will show you how this works.

Hope this helps