mn8 Language Reference | Index    

XMLRPCHandler

SUMMARY: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTORS SUMMARY  NO OPERATORS  METHODS SUMMARYDETAIL: NO ATTRIBUTES  NO ELEMENTS  CONSTRUCTOR DETAILS  NO OPERATORS  METHOD DETAILS

Description

XMLRPC URL handler concept for all URIs starting with "xmlrpc://" and "xmlrpcs://" (for secure connection).
With this concept you can invoke methods to execute on XMLRPC server.

URL format is : xmlrpc://<userName>:<password>@<hostName>:<port>/<separator><handlerName>.<methodName>?<parameters>

The separator is used to separe the path and the handler name, eg:

xmlrpc://localhost/_Date.getToday

Possible options :

If these options are specified then the userName and the passwd will be overwrited in the URL.

Usage

Execute a SEP command on XMLRPC server.

                $x FROM "xmlrpc://user:passwd@host:port/_handler.method?sep=SEPCommand&db=DBName&user=DBUser&pwd=DBPasswd"
                print $x
            

Version: 0.1
Authors:Szabo Csaba ()
Antal Attila ()
Location:
Inherits: Concept, URIHandler

Constructor List

create (String $url)
top

Method List

static LogicalacceptsURI (String $url)
LogicalcloseConnection
ConceptgetContent
Logicalinitialize (Map $options)
LogicalopenConnection
LogicalsetContent (Concept $value)
top
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
Methods inherited from: URIHandler
acceptsURI, closeConnection, getContent, initialize, openConnection, setContent

Detailed Constructor Info

create (String $url)
Parameters:
$url :URI string

Creates the URL handler concept

top

Detailed Method Info

static acceptsURI (String $url)
Parameters:
$url :URI string
Returns: Logical

Determines whether this implementation can handle the URI.

                print XMLRPCHandler.acceptsURI("xmlrpc://guest:guest@localhost:10300/")
                -- the result is --
                true
            

top
closeConnection
Returns: Logical

Flag to close the connection.

                $url = "xmlrpc://guest:guest@localhost:10300/_url.echo?msg='Hello!!!'"                                            
                $xmlrpc = XMLRPCHandler.create( $url )                                                                            
                if $xmlrpc.acceptsURI( $url ) then [                                                                              
                    $m typeof Map                                                                                                 
                    if ( $xmlrpc.initialize( $m ) ) then [                                                                            
                        if ( $xmlrpc.openConnection ) then [                                                                        
                            print $xmlrpc.getContent                                                                              

                            $xmlrpc.closeConnection                                                                               

                        ]                                                                                                         
                    ]                                                                                                             
                ] 
            

top
getContent
Returns: Concept
Exceptions:
connectionException :
(Error)
If unable to connect to XMLRPC server.

Get the all informations from URL.

                $url = "xmlrpc://guest:guest@localhost:10300/_url.echo?msg='Hello!!!'"                                            
                $xmlrpc = XMLRPCHandler.create( $url )                                                                            
                if $xmlrpc.acceptsURI( $url ) then [                                                                              
                    $m typeof Map                                                                                                 
                    if ( $xmlrpc.initialize( $m ) ) then [                                                                            
                        if ( $xmlrpc.openConnection ) then [
                                                                        
                            print $xmlrpc.getContent                                                                              

                            $xmlrpc.closeConnection                                                                               
                        ]                                                                                                         
                    ]                                                                                                             
                ] 
            

top
initialize (Map $options)
Parameters:
$options :Map concept with user and password informations
Returns: Logical
Exceptions:
badURLException :
(Error)
If the URL is not valid.

Initializes the URL useing the user informations

                $url = "xmlrpc://guest:guest@localhost:10300/_url.echo?msg='Hello!!!'"                                            
                $xmlrpc = XMLRPCHandler.create( $url )                                                                            
                if $xmlrpc.acceptsURI( $url ) then [                                                                              
                    $m typeof Map                                                                                                 

                    if ( $xmlrpc.initialize( $m ) ) then [                                                                            
                
                        if ( $xmlrpc.openConnection ) then [
                            print $xmlrpc.getContent                                                                              
                            $xmlrpc.closeConnection                                                                               
                        ]                                                                                                         
                    ]                                                                                                             
                ] 
            

top
openConnection
Returns: Logical
Exceptions:
connectionException :
(Error)
If unable to connect to XMLRPC server.

Opens the XMLRPCClient connection

                $url = "xmlrpc://guest:guest@localhost:10300/_url.echo?msg='Hello!!!'"                                            
                $xmlrpc = XMLRPCHandler.create( $url )                                                                            
                if $xmlrpc.acceptsURI( $url ) then [                                                                              
                    $m typeof Map                                                                                                 
                    if ( $xmlrpc.initialize( $m ) ) then [                                                                            
                
                        if ( $xmlrpc.openConnection ) then [
              
                            print $xmlrpc.getContent                                                                              
                            $xmlrpc.closeConnection                                                                               
                        ]                                                                                                         
                    ]                                                                                                             
                ] 
            

top
setContent (Concept $value)
Parameters:
$value :The new value to be set.
Returns: Logical

Rerurn false.

top