This is a simple XMLRPC client concept.
With this concept you can invoke methods to execute on XMLRPC server.
Can use the following protocols for the URL: xmlrpc://, xmlrpcs://,
http://, https://. For secure connections like xmlrpcs:// and https:// you
need to set up your masine for the security sessions (eg. install JSSE, create
keys and certificates, modify in mn8Config.xml security properties)
A simple way to connect to a XMLRPC server on your computer (default
settings) using the host: localhost, port: 10300, user: guest and
password: guest:
$rpc typeof XMLRPCClient
#To connect a XMLRPC server using a scpecific URL:
$rpc = XMLRPCClient.create( URL )
#where the URL is: xmlrpc://user:password@host:port/
#URL can have also this protocols: xmlrpcs:// http:// https://
# Connecting to DataStore you can use the following parapeters
$params typeof Series
$params.add($sep)
# $sep is SEP command
$params.add("XMLDB")
# database name
$params.add("guest")
# user name
$params.add("guest")
# user password to acces database
After you have a connection $rpc you need to execute a command on the
server:
$concept = $rpc.executeCmd( method, parameters)
where:
- the "method" is the method name ont XMLRPC server
- the "parameters" is a Series concept and you need to add it the method
parameters (see below the variable $params)
- the $concept is the returned concept from the method
Methods inherited from: Concept
| cloneConcept, extendsConcept, fromXML, getAllInheritedConcepts, getConceptAttribute, getConceptAttributeField, getConceptAttributeFields, getConceptAttributes, getConceptConstructors, getConceptElement, getConceptElementField, getConceptElementFields, getConceptElements, getConceptLabel, getConceptMethod, getConceptMethods, getConceptOperators, getConceptType, getErrorHandler, getInheritedConcepts, getResourceURI, hasConceptAttribute, hasConceptElement, hasConceptMethod, hasPath, isHidden, loadContent, setConceptLabel, setErrorHandler, setHidden, setShowEmpty, showEmpty, toTXT, toXML, setResourceURI |
|
| Parameters: |
| $url : | Complete URL string, like "xmlrpc://user:password@host:port/" |
|
| Exceptions: |
unsupportedProtocolException :
(Error) | If the protocol is unsupported by XMLRPCClient. |
badURLException :
(Error) | If the URL is not valid. |
Create the XMLRPC connection to the server specified in the parameter
| Parameters: |
| $method : | The method name on the XMLRPC server |
| $params : | This Series concept holds the parameters to the method |
|
| Exceptions: |
executeException :
(Error) | If unable to execute method on XMLRPC server. |
This method executes the specified method on the XMLRPC server and
returns XMLRPC supported concept.
$param typeof Series
$param.add("Hello")
$rpc = XMLRPCClient.create( "xmlrpc://guest:guest@localhost:10300/" )
print $rpc.executeCmd("url.echo" , $param )
-- the result is --
Hello