How to invoke a service from url

hello all,

        I want to invoke a service from web url.How to invoke and is there any settings to invoke a service from url.

thanking you in advance.

Hi,

Its very simple to invoke a webMethods service.

Assume that I am invoking a service addValues which is there in Bijendra package and taking 2 inputs a and b …So URL will be like below…

http://serverName:portNo/invoke/Bijendra/addValues?a=2&b=3

Thats it.

Thanks,

You can invoke a service using http protocol specifying in the browser.
you just type the following in the url bar
http://hostname:port/invoke/folder.subfolder:servicename?arg1=val&arg2=val2 etc this is using http get method

If you want invoke using HTTP post method, you create one html file
in that use

now you can pass input values to the service by using input fields in the html for example num1
1 Like

Hi Team,
I want to invoke a service of list of numbers from browser. i have used addIntList predefined built in service. How a list can be invoked from browser.

thanking you in advance.

If you are talking about pub.math:addInts service, you can use the following url to invoke the service

http://localhost:5555/invoke/pub.math:addInts?num1=2&num2=3

Regards,
-Kalpesh.

Hi Lavanya,

The preferable way is to use Postman for posting such a request, as List can grow to any level. So fitting them in query params is not good idea.

But still, you can try this way, it will work.

http://localhost:5555/invoke/pub.math:addIntList?numList=2&numList=3&numList=4

Regards
Firoz N

1 Like

Hi Firoz,

Thanks a lot it is working fine.

Regards,
Lavanya