PowerUp Description
The WEBSERVICE PowerUp function calls a Web Service using the provided URL. Parameters may be passed using either the GET or POST methods.
Note: In Excel 2013 and later the PowerUp version of this function is pwrWEBSERVICE.
PowerUp Syntax
WEBSERVICE(<url|file>, postdata)
The WEBSERVICE PowerUp function has the following arguments:
url|file – Required. This is one of the following:
- The complete URL to call the Web Service. If this is a GET call, include the full URL including all of the needed parameters on the URL in the querystring.
- A fully qualified file path. This can also follow the “file://” protocol syntax as well.
postdata – Optional. If you will call the web service using the POST method provide the web service parameters in the postdata function argument. Format the postdata in the same manner as in a GET. In other words, format the POST data as you would a querystring in a GET call. WEBSERVICE will submit the data as a POST.
Return Value
WEBSERVICE will return the result of the Web Service call.
Remarks
The URL value provided must be a fully-formed URL. The querystring of the URL and the postdata must also be fully-encoded URL strings.
Examples for Excel 2010 and Excel 2007
=WEBSERVICE("http://webserviceservername/serviceurl?arg1=val1&arg2=val2")
This will submit a GET request to the webservicename/serviceurl web service.
=WEBSERVICE("http://webserviceservername/serviceurl", "arg1=val1&arg2=val2")
This will submit a POST request to the webservicename/serviceurl web service with the arguments and values provided in the postdata argument.
Examples for Excel 2013 and Later
=pwrWEBSERVICE("http://webserviceservername/serviceurl?arg1=val1&arg2=val2")
This will submit a GET request to the webservicename/serviceurl web service.
=pwrWEBSERVICE("http://webserviceservername/serviceurl", "arg1=val1&arg2=val2")
This will submit a POST request to the webservicename/serviceurl web service with the arguments and values provided in the postdata argument.
How can we send the credentials?
The WEBSERVICE (and pwrWEBSERVICE) function does not handle authentication – this is the same case for the built-in Excel function.