Index | OAT homepage | OpenLink Software

# OATDOCws

- OATDOCws
- _ _ ws.js
- _ _ _ _ Functions
- _ _ _ _ _ _ OAT.WS.getEndpoint(wsdlURL, callback)
- _ _ _ _ _ _ OAT.WS.listServices(wsdlURL, callback)
- _ _ _ _ _ _ OAT.WS.listParameters(wsdlURL, service, callback)
- _ _ _ _ _ _ OAT.WS.invoke(wsdlURL, service, callback, options)
- _ _ _ _ Example

## ws.js

Web Services (WSDL) interface.

### Functions

#### OAT.WS.getEndpoint(wsdlURL, callback)

Asynchronously retrieve the endpoint URL for a given `wsdlURL` . Will `callback(url)` when retrieved.

#### OAT.WS.listServices(wsdlURL, callback)

Asynchronously retrieve a list of valid services for a given `wsdlURL` . Will `callback(servicesArray)` when retrieved.

#### OAT.WS.listParameters(wsdlURL, service, callback)

Asynchronously retrieve input and output values for given `wsdlURL` and service. Will `callback(inputObject, outputObject)` when retrieved.

#### OAT.WS.invoke(wsdlURL, service, callback, options)

Invokes a web `service` , with WSDL file located at `wsdlURL` . Input values are specified in `options` ; will `callback(outputObject)` when finished. Options:

- `type` `- (default {{{OAT.AJAX.TYPE_XML` ) }}}
- `headers` - (default `{"SOAPAction":service}` )

### Example

    /* Sample code for google search */
    var wsdl = "/google/services.wsdl";
    var serviceName = "doGoogleSearch";
    var inputObject = {
            doGoogleSearch:{
                    key:"IGWnqjhQFHKvB8MdJlVI0GPKDJxZhwBf",
                    q:"my query",
                    start:0,
                    maxResults:10,
                    filter:"",
                    restrict:"",
                    safeSearch:"",
                    lr:"",
                    ie:"",
                    oe:""
            }
    }

    function callback(outputObject) {
            alert('Data arrived!');
    }

    OAT.WS.invoke(wsdl, callback, serviceName, inputObject);

Copyright (C) 2005-2008 OpenLink Software