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

Hi,

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.

Thanks
Kumar

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

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

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

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

http://localhost:5555/invoke/pub.math/addInts?num1=55&num2=66

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

Hope this helps