Previous topic  Top  Next topic  Print this Topic
 

Web Service Connector

 

Builtin:

_webserviceInfo/4 retrieves information for web service

Usage:

_webserviceInfo(webservice input map, service, method, method info map);

Keys in Webservice input map:

[_wsdl ->"url of wsdl",_service ->”service name”,_method->"method name",_port->"port"]

The _service, _method and _port key/value pairs in this map are optional and can be left out, if the WSDL contains only one item of them.

The service, method and method info map arguments must not be bound.

Example:

?- _webserviceInfo([_wsdl ->"http://weatherservicename/WeatherForecastSoap?wsdl"], ?

X, ?Y, ?Z)

The web service connector supports access on web services.

Builtin:

_webserviceAccess/3 calls a web service

Usage:

_webserviceAccess(webservice input map, input parameter map, output map)

Webservice input map:

[_wsdl ->"wsdl string",_service ->_service,_method->"method name",_port->"port", _user->”username”, _password->”password”]

The _service, _method and _port key/value pairs in this map are optional and can be left out, if the WSDL contains only one item of them. If they are needed, you should use on of the values  returned from the _webserviceInfo built-in.

If the web service is protected with Basic authentication, you need to provide the _user, and _password key/value pairs. The  values for the _user and _password  parameters must be filled with user name and the password. Please note that the WSDL must be accessible freely. If this is not the case, download the WSDL manually and provide a file URL to it, e.g. "file:///C:/temp/service-to-access.wsdl"

Input parameter map:

The concrete input parameter values are depending on the webservice.

["Parameter name"->"value"]

Output map

This map contains the results of the web service call. The concrete structure depends on the web service. Use built-ins like _memberByPath/3 or _map2Table/4 to extract values.

For further information about map data type click here .

Example:

?- _webserviceAccess([_wsdl ->"http://weatherservicename/WeatherForecastSoap?wsdl",

_method->"GetWeatherByPlaceName"], ["PlaceName"->"Karlsruhe"],?Z).

Example for BASIC authentication:

?- _webserviceAccess([_wsdl->”file:///C:/temp/protectedService.wsdl”, _user->"scott", _password->"tiger"], [...], [...], ?Result).