# \*WEB/WEBSERVICE: Web Service Utility

> Source: https://manual.pvxplus.com/web-utilities/web-service-utility

## Description

The **\*web/webservice** utility may be called to display a **[Web Service](https://manual.pvxplus.com/pxplus-web-services)** within a resizable dialog containing a **[\*BROWSER](https://manual.pvxplus.com/utilities/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.  <br>  <br>If the Web Service has been previously defined using the **[Web Services Maintenance](https://manual.pvxplus.com/web-services-maintenance)** utility, this *url$* value can be simplified to the following format:  <br>  <br> **id**=*serviceID*  <br>  <br>***Where:***  <br>  <br> *serviceID* is the Service ID value used when defining the Web Service.<br>Additional *type* parameter values can be entered *(optional)*, each separated by a space.<br>***Example:***<br>**id=*tasks*&type=*pdf***<br>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.  <br>  <br>If the *url$* value has been defined to reference a Web Service ID value and this parameter is left blank, the **[Title](https://manual.pvxplus.com/web-services-maintenance#parameter)** 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:<br>*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](https://manual.pvxplus.com/ezwebserver/ezweb-introduction)** running locally:

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

![](https://manual.pvxplus.com/migration-assets/d7716ce680c9e665e9cfbfeb44c8a4db28262d648cbbb175af9ffbd5b727a3ef.jpg)

***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](https://manual.pvxplus.com/pxplus-dashboard/overview)**:

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