addMethod
Declares a function on the service.
addMethod
(name
, action
, arguments
, responses
, requestNodeName
, responseNodeName
)
Parameters
name
Name of the method. This is the name exposed in JavaScript and the name of the SOAP method.
action
SOAP-Action parameter.
arguments
Declaration of arguments in the form of a table containing a list of strings grouped by pairs. The first string is the name of the argument and the second corresponds to the type: ["name1", "type1", "name2", "type2", ...]
responses
Declaration of return values in the form of a table containing a list of strings grouped by pairs: The first string is the name of the argument and the second corresponds to the type: ["name1", "type1", "name2", "type2", ...]
requestNodeName
A string of characters which specifies the name of the XML node of the SOAP query instead of the method name.
responseNodeName
A string of characters which specifies the name of the XML node of the SOAP response instead of the method name followed by Response.
Return value
None.
Remarks
- string
- boolean
- long
- short
- byte
- float
- double
- date
- time
- datetime
- NLDocument
- NLElement
- NLRawXML
- NLCollection
var cnx = new HttpSoapConnection("http://localhost/nl/jsp/soaprouter.jsp", "utf-8", 0)
var session = new SoapService(cnx, "xtk:session")
session.addMethod("GetOption", "xtk:session#GetOption",
["token", "string", "name", "string"],
["value", "string", "type", "byte"])
try
{
var result = session.GetOption("admin/", "NmsBroadcast_DefaultProvider")
var value = result[0]
var type = result[1]
logInfo("Value = " + value)
logInfo("Type = " + type)
}
catch( e )
{
if( e.soapFault )
logInfo("A SOAP Fault occured : " + e.soapFault.toXMLString());
else
logInfo("An error occured : " + e);
}
Features
Method of class: SoapService
Available in:
- Content management
- Delivery properties
- Delivery message
- Typology rule
- Import
- JSSP
- SOAP Method
- WebApp
- Workflow