---
title: "How to use JasperSoft Studio with Web Service Data Adapter?"
canonical: "https://onesaitplatform.refined.site/space/DOCT/2220845125/How%20to%20use%20JasperSoft%20Studio%20with%20Web%20Service%20Data%20Adapter%3F"
format: markdown
---
You can configure a data adapter to connect to a REST web service. This mechanism is supported by the JSON and XML data adapters and supports the PUT, POST, and GET verbs. For this, once installed Jaspersoft Studio, it is necessary to download from  https://community.jaspersoft.com/project/web-service-data-source/releases  the Jaspersoft Web Service Data Source zip, which contains the necessary plugins to use the REST service. To install it, access the JSS folder and copy the jar files to the plugins folder of the Jaspersoft Studio installation directory. If you have any questions, you can follow the following tutorial  https://community.jaspersoft.com/wiki/installing-webservice-datasource . After installing the plugin a new Data Adapter Type will be available. To create it, access  New > Data Adapter  and select Web Service. To configure the data adapter, the properties needed are: Name Server URI : the first part or URI address. Bear in mind that the same Data Adapter can be used to call different web services, so this should include only the unmodifiable part of URL, but there is no check or rule governing this. Connection Type : possible Values are: POST, GET, Elastic Search Connection. Language : is the language used to decode the response from the web service. Possible values are: xml or json. Authentication : the authentication methor required by the web service. None . Basic : username and password. Google Authentication : Google API key. This authentication method was build as a sample for extending the Webservice DataAdapter. Once the Data Adapter is created, you will have to go to  New > Jasper Report  and create a new empty report. Once the report is created, the following window will open and you will have to click on the button to open the DataSet and Query editor dialog. To configure the request that is sent to the Web Service, you must fill in the following fields: Query Language : WebServiceQuery Base URL : this url will be concatenated to the base URI that you defined in the Data Adapter. As per the sample, the OpenWeatherMap expose many APIs, and each of this APIs has a different url, but the root URI is the same (the site domain) - so, the Base URL would be the second half of the URL, excluding the parameters (see image below). Content Type & Content of Request : XML : This will show a text area to input the Content of the Request. Here you can paste your XML. JSON : This will show a text area to input the Content of the Request. Here you can paste your JSON. GET Parameters : for GET Request, parameters are passed in the URL. Often, the parameters contain special characters that will have to be escaped. This is done automatically, you will just have to add the parameters using the Add Button, insert Parameter Name and Value. Headers : Some APIs require you to pass some parameters in the header (as example an authentication key). In addition, you must select the Web Service Data Adapter created above. To configure how the result from the web service call should be mapped to Fields, go to the “Fields” tab. The actions required are  Get Server Response , and Drag & Drop the fields from the left area to the right  Fields List . To show the data, open  Data Preview Tab  after click  Read Fields  to check if your fields are correctly extracted. In some Jaspersoft Studio versions, the action "Get Server Response" is not working properly and the server response is never shown. In these cases, the message "Loading Json data" is shown permanently In these cases, you must create the fields mappings manually using the add buttons: To design the document, click on  OK  and access the  Design  tab. Besides being able to create elements by dragging and dropping the different elements from the right (Text Field, Image ...), you can Drag&Drop the fields retrieved from the Web Service, located in the Fields branch of the tree on the lower left. From the  Preview  tab, you can see how the file would look.