Requires Platform 4.5+
Accessing Web Services
Nexaweb 4.5 provides a data service to provide Nexaweb Applications with access to data from web services.
The web services data service supports Representational State Transfer (REST) and Simple Object Access Protocol (SOAP) requests.
Configuring the Web Services Data Service
The web services data service configuration file, nexaweb-webservices.xml, contains the following sections:
Configuration Section | Description |
webServiceDefinitions | Defines the types of web services available through this data service. |
webServiceRequests | Lists REST and SOAP requests defined on the server that your application can use by reference to access external data. Note: You can also specify web service requests in the client UI within an embeddedServiceRequest. |
webServiceDefinitions
The webServiceDefinitions section includes the following element:
...
- Specify an ID for the SOAP service.
- Specify the location of the wsdl file for the SOAP service.
webServiceRequests
This section includes each of the REST and SOAP requests that you want defined on the server and to reference in serviceResourceReference elements of dataDefinitionRequests. You can also create REST and SOAP requests in the client UI file inline in an embeddedServiceRequest.
Creating REST Requests
The web service data service type provides support for communicating with web services implemented using REST architecture.
REST uses HTTP and supports the following methods:
...
In this example, the restRequest, searchFlickrPara, invokes a GET to the URL, http://www.flickr.com/services/rest with the following additional parameters: method=flickr.photos.search; api_key=ffdbbd159bdde999cc638c280377a8d1; text=a user supplied value; per_page=25.
Creating SOAP Requests
The Web Service data service provides support for communicating with web services using SOAP.
SOAP is an XML-based protocol for accessing web services over HTTP.
...
In this example, the SOAP message, searchFlickrSoap, goes to the webservice on the server specified by the URL: http://www.flickr.com/services/soap. urn:flickr is the default namespace for the SOAP request, with a localName of FlickrRequest. The body of the message contains the namespace specific method, flickr.photos.search and specifies an api_key, text, and the number of results per page.
Using Web Services Requests in a Service Request
You can specify a web services request to use in a serviceRequest in any of the following ways:
...