# Web Utilities

*WEB/WEBSERVICE | Web Service Utility

## Description

The *web/webservice utility may be called to display a Web Service within a resizable dialog containing a *BROWSER control.

#### Note:
This utility is not applicable when running WindX.

(The *web/webservice utility was added in PxPlus 2018.)

## Calling Sequence

CALL "*web/webservice", url$, title$, servername$, errormsg$

Where:

url$ | (Input) URL needed to produce the Web Service. If the Web Service has been previously defined using the Web Services Maintenance utility, this url$ value can be simplified to the following format: id=serviceID Where: serviceID is the Service ID value used when defining the Web Service. Additional type parameter values can be entered (optional), each separated by a space. Example: id=tasks&type=pdf Using this example, the Web Service ID is tasks, and the pdf output type overrides the default output type defined for this Web Service only if Allow Override is selected. If Allow Override is not selected, the pdf output type will not override the default output type. An HTML error will display when a widget for this Web Service is in the Dashboard or when this Web Service is run as a URL on a browser. The HTML error will indicate that this Web Service ID does not allow the override of the specified parameter(s).
title$ | (Input) A string value to be used as the Windows dialog title bar. If the url$ value has been defined to reference a Web Service ID value and this parameter is left blank, the Title from the Web Service definition will be used.
servername$ | (Input) When referencing an existing Web Service ID, you may specify an alternate Web server to use (other than EZWeb running locally) by entering the server and port in the following format: servername$:port#
errormesg$ | (Output) If an error is encountered when attempting to display the Web Service, the program will load this variable with a textual description of the problem and then exit.

## Examples

Example 1:

To display a Web Service defined with a Service ID of QUERY and a Title of Invoice Query using the EZWeb Server running locally:

> CALL "*web/webservice","id=QUERY"

Example 2:

To override the Title, check for errors and use a Web Server running on machine SERVERNAME, port 8888:

> CALL "*web/webservice","id=QUERY","Different Title","http://SERVERNAME:8888",errormsg$

Example 3:

To display a Web page:

> CALL "*web/webservice","http://www.pvxplus.com","PxPlus Web Page",errormsg$

Example 4:

To display a Dashboard:

> CALL "*web/webservice","http://SERVERNAME:8888/services/dashboard","Dashboard Title",errormsg$