Tags · Functions · Objects
Lucee Function Reference
Choose a function:

Function CREATEOBJECT

The CreateObject function takes different arguments depending on the value of the first argument:

CreateObject('com', class, context, serverName)
CreateObject('component', component-name)
CreateObject('corba', context, class, locale)
CreateObject('java', class)
CreateObject('webservice', urltowsdl, [, portname])

Example

createobject(string type,[string classname,[object context,[object arg4]]]):any

Arguments

The arguments for this function are set. You can not use other arguments except the following ones.
Name Type Required Description
type string  Yes one of the following:
  • com: for loading a com Object
  • java: for loading a java object
  • webservice: for loading a remote webservice
  • component: for loading a Component  
  • classname string  No the usage of this argument depend on type defined with argument "type":
  • com: Component ProgID for the object to invoke.
  • java: java class to load
  • webservice: WSDL url to call
  • component: The CFC name; corresponds to the name of the file that defines the component  
  • context object  No the usage of this argument depend on type defined with argument "type":
  • com: not used (ignored)
  • java: classpath used to load the defined class, this can be a list of multiple paths (directories containing class files or jar files)
  • webservice: a struct containing the following optional keys (username,password,proxyServer,proxyPort,proxyUser,proxyPassword)
  • component: not used (ignored)  
  • arg4 object  No the usage of this argument depend on type defined with argument "type":
  • com: not used (ignored)
  • java: delimiter used for the classpath (default comma)
  • webservice: not used (ignored)
  • component: not used (ignored)