Inheritance diagram for ilBMFWSDL:
Collaboration diagram for ilBMFWSDL:Public Member Functions | |
| ilBMFWSDL ($wsdl_uri=false, $proxy=array(), $cacheUse=WSDL_CACHE_USE, $cacheMaxAge=WSDL_CACHE_MAX_AGE) | |
| ilBMFWSDL constructor | |
| set_service ($service) | |
| parse ($wsdl_uri, $proxy=array()) | |
| parseURL ($wsdl_uri, $proxy=array()) | |
| Fill the WSDL array tree with data from a WSDL file. | |
| parseObject (&$wsdl_obj, $targetNamespace, $service_name, $service_desc= '') | |
| Fill the WSDL array tree with data from one or more PHP class objects. | |
| getEndpoint ($portName) | |
| _getPortName ($operation, $service) | |
| getPortName ($operation, $service=null) | |
| getOperationData ($portName, $operation) | |
| matchMethod (&$operation) | |
| getDataHandler ($datatype, $namespace) | |
| getDataHandler | |
| getSoapAction ($portName, $operation) | |
| getNamespace ($portName, $operation) | |
| getNamespaceAttributeName ($namespace) | |
| addNamespace ($namespace) | |
| _validateString ($string) | |
| _addArg (&$args, &$argarray, $argname) | |
| _elementArg (&$args, &$argarray, &$_argtype, $_argname) | |
| _complexTypeArg (&$args, &$argarray, &$_argtype, $_argname) | |
| generateProxyCode ($port= '', $classname='') | |
| generateProxyCode generates stub code from the wsdl that can be saved to a file, or eval'd into existence | |
| generateAllProxies () | |
| & | getProxy ($port= '', $name= '') |
| & | _getComplexTypeForElement ($name, $namespace) |
| getComplexTypeNameForElement ($name, $namespace) | |
| getComplexTypeChildType ($ns, $name, $child_ns, $child_name) | |
| getSchemaType ($type, $name, $type_namespace) | |
| _getDeepestArrayType ($nsPrefix, $arrayType) | |
| Recurse through the WSDL structure looking for the innermost array type of multi-dimensional arrays. | |
Data Fields | |
| $tns = null | |
| $definition = array() | |
| $namespaces = array() | |
| $ns = array() | |
| $xsd = SOAP_XML_SCHEMA_VERSION | |
| $complexTypes = array() | |
| $elements = array() | |
| $messages = array() | |
| $portTypes = array() | |
| $bindings = array() | |
| $imports = array() | |
| $services = array() | |
| $service = '' | |
| $uri = '' | |
| $proxy = null | |
| $trace = 0 | |
| $cacheUse = null | |
| $cacheMaxAge = null | |
Definition at line 47 of file class.ilBMFWSDL.php.
| ilBMFWSDL::_addArg | ( | &$ | args, | |
| &$ | argarray, | |||
| $ | argname | |||
| ) |
Definition at line 372 of file class.ilBMFWSDL.php.
References $args, and _validateString().
Referenced by _complexTypeArg(), _elementArg(), and generateProxyCode().
{
if ($args) $args .= ", ";
$args .= "\$".$argname;
if (!$this->_validateString($argname)) return NULL;
if ($argarray) $argarray .= ", ";
$argarray .= "\"$argname\"=>\$".$argname;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBMFWSDL::_complexTypeArg | ( | &$ | args, | |
| &$ | argarray, | |||
| &$ | _argtype, | |||
| $ | _argname | |||
| ) |
Definition at line 414 of file class.ilBMFWSDL.php.
References $args, and _addArg().
Referenced by generateProxyCode().
{
$comments = '';
if (isset($this->complexTypes[$_argtype['namespace']][$_argtype['type']])) {
$comments = " // $_argname is a ComplexType {$_argtype['type']},\n";
$comments .= " //refer to wsdl for more info\n";
if (isset($this->complexTypes[$_argtype['namespace']][$_argtype['type']]['attribute'])) {
$comments .= " // $_argname may require attributes, refer to wsdl for more info\n";
}
$wrapname = '{'.$this->namespaces[$_argtype['namespace']].'}'.$_argtype['type'];
$comments .= " \$$_argname =& new ilBMFValue('$_argname','$wrapname',\$$_argname);\n";
}
$this->_addArg($args,$argarray,$_argname);
return $comments;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBMFWSDL::_elementArg | ( | &$ | args, | |
| &$ | argarray, | |||
| &$ | _argtype, | |||
| $ | _argname | |||
| ) |
Definition at line 381 of file class.ilBMFWSDL.php.
References $args, $tns, and _addArg().
Referenced by generateProxyCode().
{
$comments = '';
$el = $this->elements[$_argtype['namespace']][$_argtype['type']];
$tns = isset($this->ns[$el['namespace']])?$this->ns[$el['namespace']]:$_argtype['namespace'];
if (isset($this->complexTypes[$tns][$el['type']])) {
// the element is actually a complex type!
$comments = " // {$el['type']} is a ComplexType, refer to wsdl for more info\n";
$attrname = "{$_argtype['type']}_attr";
if (isset($this->complexTypes[$tns][$el['type']]['attribute'])) {
$comments .= " // {$el['type']} may require attributes, refer to wsdl for more info\n";
}
$comments .= " \${$attrname}['xmlns'] = '{$this->namespaces[$_argtype['namespace']]}';\n";
$comments .= " \${$_argtype['type']} =& new ilBMFValue('{$_argtype['type']}',false,\${$_argtype['type']},\$$attrname);\n";
$this->_addArg($args,$argarray,$_argtype['type']);
if (isset($this->complexTypes[$tns][$el['type']]['attribute'])) {
if ($args) $args .= ", ";
$args .= "\$".$attrname;
}
#$comments = $this->_complexTypeArg($args,$argarray,$el,$_argtype['type']);
} else if (isset($el['elements'])) {
foreach ($el['elements'] as $ename => $element) {
$comments .= " \$$ename =& new ilBMFValue('{{$this->namespaces[$element['namespace']]}}$ename','{$element['type']}',\$$ename);\n";
$this->_addArg($args,$argarray,$ename);
}
} else {
#$echoStringParam =& new ilBMFValue('{http://soapinterop.org/xsd}echoStringParam',false,$echoStringParam);
$comments .= " \$$_argname =& new ilBMFValue('{{$this->namespaces[$tns]}}$_argname','{$el['type']}',\$$_argname);\n";
$this->_addArg($args,$argarray,$_argname);
}
return $comments;
}
Here is the call graph for this function:
Here is the caller graph for this function:| & ilBMFWSDL::_getComplexTypeForElement | ( | $ | name, | |
| $ | namespace | |||
| ) |
Definition at line 620 of file class.ilBMFWSDL.php.
References $ns, $t, and $type.
Referenced by getComplexTypeChildType(), and getComplexTypeNameForElement().
{
$t = NULL;
if (isset($this->ns[$namespace]) &&
isset($this->elements[$this->ns[$namespace]][$name]['type'])) {
$type = $this->elements[$this->ns[$namespace]][$name]['type'];
$ns = $this->elements[$this->ns[$namespace]][$name]['namespace'];
if (isset($this->complexTypes[$ns][$type])) {
$t = $this->complexTypes[$ns][$type];
}
}
return $t;
}
Here is the caller graph for this function:| ilBMFWSDL::_getDeepestArrayType | ( | $ | nsPrefix, | |
| $ | arrayType | |||
| ) |
Recurse through the WSDL structure looking for the innermost array type of multi-dimensional arrays.
Takes a namespace prefix and a type, which can be in the form 'type' or 'type[]', and returns the full namespace URI, the type of the most deeply nested array type found, and the number of levels of nesting.
private
Definition at line 728 of file class.ilBMFWSDL.php.
References $result.
Referenced by getSchemaType().
{
static $trail = array();
$arrayType = ereg_replace('\[\]$', '', $arrayType);
// Protect against circular references
// XXX We really need to remove trail from this altogether (it's very inefficient and
// in the wrong place!) and put circular reference checking in when the WSDL info
// is generated in the first place
if (array_search($nsPrefix . ':' . $arrayType, $trail)) {
return array(NULL, NULL, -count($trail));
}
if (array_key_exists($nsPrefix, $this->complexTypes) &&
array_key_exists($arrayType, $this->complexTypes[$nsPrefix]) &&
array_key_exists('arrayType', $this->complexTypes[$nsPrefix][$arrayType])) {
$trail[] = $nsPrefix . ':' . $arrayType;
$result = $this->_getDeepestArrayType( $this->complexTypes[$nsPrefix][$arrayType]['namespace'],
$this->complexTypes[$nsPrefix][$arrayType]['arrayType']);
return array($result[0], $result[1], $result[2] + 1);
}
return array($this->namespaces[$nsPrefix], $arrayType, 0);
}
Here is the caller graph for this function:| ilBMFWSDL::_getPortName | ( | $ | operation, | |
| $ | service | |||
| ) |
Definition at line 163 of file class.ilBMFWSDL.php.
References $service, and $type.
Referenced by getPortName().
{
if (isset($this->services[$service]['ports'])) {
foreach ($this->services[$service]['ports'] as $port => $portAttrs) {
$type = $this->services[$service]['ports'][$port]['type'];
if ($type == 'soap' &&
isset($this->bindings[$portAttrs['binding']]['operations'][$operation])) {
return $port;
}
}
}
return null;
}
Here is the caller graph for this function:| ilBMFWSDL::_validateString | ( | $ | string | ) |
Definition at line 365 of file class.ilBMFWSDL.php.
Referenced by _addArg(), and generateProxyCode().
{
// XXX this should be done sooner or later
return true;
#if (preg_match("/^[\w_:#\/]+$/",$string)) return true;
#return false;
}
Here is the caller graph for this function:| ilBMFWSDL::addNamespace | ( | $ | namespace | ) |
Definition at line 354 of file class.ilBMFWSDL.php.
Referenced by getNamespaceAttributeName().
{
if (array_key_exists($namespace, $this->ns)) {
return $this->ns[$namespace];
}
$n = count($this->ns);
$attr = 'ns'.$n;
$this->namespaces['ns'.$n] = $namespace;
$this->ns[$namespace] = $attr;
return $attr;
}
Here is the caller graph for this function:| ilBMFWSDL::generateAllProxies | ( | ) |
Definition at line 581 of file class.ilBMFWSDL.php.
References $key, and generateProxyCode().
{
$proxycode = '';
foreach (array_keys($this->services[$this->service]['ports']) as $key) {
$port =& $this->services[$this->service]['ports'][$key];
$proxycode .= $this->generateProxyCode($port);
}
return $proxycode;
}
Here is the call graph for this function:| ilBMFWSDL::generateProxyCode | ( | $ | port = '', |
|
| $ | classname = '' | |||
| ) |
generateProxyCode generates stub code from the wsdl that can be saved to a file, or eval'd into existence
Definition at line 435 of file class.ilBMFWSDL.php.
References $args, $key, $ns, _addArg(), _complexTypeArg(), _elementArg(), and _validateString().
Referenced by generateAllProxies(), and getProxy().
{
$multiport = count($this->services[$this->service]['ports']) > 1;
if (!$port) {
reset($this->services[$this->service]['ports']);
$port = current($this->services[$this->service]['ports']);
}
// XXX currently do not support HTTP ports
if ($port['type'] != 'soap') return NULL;
// XXX currentPort is BAD
$clienturl = $port['address']['location'];
if (!$classname) {
if ($multiport || $port) {
$classname = 'WebService_'.$this->service.'_'.$port['name'];
} else {
$classname = 'WebService_'.$this->service;
}
$classname = str_replace('-','_',$classname);
}
if (!$this->_validateString($classname)) return NULL;
if (is_array($this->proxy) && count($this->proxy) > 0) {
$class = "class $classname extends ilBMFClient\n{\n".
" function $classname()\n{\n".
" \$this->ilBMFClient(\"$clienturl\", 0, 0,
array(";
foreach($this->proxy as $key => $val) {
if (is_array($val)) {
$class .= "\"$key\" => array(";
foreach ($val as $key2 => $val2) {
$class .= "\"$key2\" => \"$val2\",";
}
$class .= ')';
} else {
$class .= "\"$key\"=>\"$val\",";
}
}
$class .= "));\n }\n";
$class = str_replace(',))', '))', $class);
} else {
$class = "class $classname extends ilBMFClient\n{\n".
" function $classname()\n{\n".
" \$this->ilBMFClient(\"$clienturl\", 0);\n".
" }\n";
}
// get the binding, from that get the port type
$primaryBinding = $port['binding']; //$this->services[$this->service]['ports'][$port['name']]["binding"];
$primaryBinding = preg_replace("/^(.*:)/","",$primaryBinding);
$portType = $this->bindings[$primaryBinding]['type'];
$portType = preg_replace("/^(.*:)/","",$portType);
$style = $this->bindings[$primaryBinding]['style'];
// XXX currentPortType is BAD
foreach ($this->portTypes[$portType] as $opname => $operation) {
$soapaction = $this->bindings[$primaryBinding]['operations'][$opname]['soapAction'];
if (isset($this->bindings[$primaryBinding]['operations'][$opname]['style'])) {
$opstyle = $this->bindings[$primaryBinding]['operations'][$opname]['style'];
} else {
$opstyle = $style;
}
$use = $this->bindings[$primaryBinding]['operations'][$opname]['input']['use'];
if ($use == 'encoded') {
$namespace = $this->bindings[$primaryBinding]['operations'][$opname]['input']['namespace'];
} else {
$bindingType = $this->bindings[$primaryBinding]['type'];
$ns = $this->portTypes[$bindingType][$opname]['input']['namespace'];
$namespace = $this->namespaces[$ns];
}
$args = '';
$argarray = '';
$comments = '';
$wrappers = '';
foreach ($operation['input'] as $argname => $argtype) {
if ($argname == "message") {
foreach ($this->messages[$argtype] as $_argname => $_argtype) {
$comments = '';
if ($opstyle == 'document' && $use == 'literal' &&
$_argtype['name'] == 'parameters') {
// the type or element refered to is used for parameters!
$elattrs = null;
$element = $_argtype['element'];
$el = $this->elements[$_argtype['namespace']][$_argtype['type']];
if($el['complex']) {
$namespace = $this->namespaces[$_argtype['namespace']];
// XXX need to wrap the parameters in a soap_value
}
if (isset($el['elements'])) {
foreach ($el['elements'] as $elname => $elattrs) {
// is the element a complex type?
if (isset($this->complexTypes[$elattrs['namespace']][$elname])) {
$comments .= $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
} else {
$this->_addArg($args, $argarray, $elname);
}
}
}/* else {
$comments = $this->_complexTypeArg($args, $argarray, $elattrs, $elattrs['name']);
}*/
if($el['complex'] && $argarray) {
$wrapname = '{'.$this->namespaces[$_argtype['namespace']].'}'.$el['name'];
$comments .= " \${$el['name']} =& new ilBMFValue('$wrapname',false,\$v=array($argarray));\n";
$argarray = "'{$el['name']}'=>\${$el['name']}";
}
} else
if (isset($_argtype['element'])) {
// element argument
$comments = $this->_elementArg($args, $argarray, $_argtype, $_argtype['type']);
} else {
// complex type argument
$comments = $this->_complexTypeArg($args, $argarray, $_argtype, $_argname);
}
}
}
}
// validate entries
if (!$this->_validateString($opname)) return NULL;
if (!$this->_validateString($namespace)) return NULL;
if (!$this->_validateString($soapaction)) return NULL;
if ($argarray) {
$argarray = "array($argarray)";
} else {
$argarray = 'null';
}
$class .= " function &$opname($args) {\n$comments$wrappers".
" return \$this->call(\"$opname\", \n".
" \$v = $argarray, \n".
" array('namespace'=>'$namespace',\n".
" 'soapaction'=>'$soapaction',\n".
" 'style'=>'$opstyle',\n".
" 'use'=>'$use'".
($this->trace?",'trace'=>1":"")." ));\n".
" }\n";
}
$class .= "}\n";
return $class;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBMFWSDL::getComplexTypeChildType | ( | $ | ns, | |
| $ | name, | |||
| $ | child_ns, | |||
| $ | child_name | |||
| ) |
Definition at line 645 of file class.ilBMFWSDL.php.
References $ns, $t, and _getComplexTypeForElement().
{
// is the type an element?
$t = $this->_getComplexTypeForElement($name, $ns);
if ($t) {
// no, get it from complex types directly
if (isset($t['elements'][$child_name]['type']))
return $t['elements'][$child_name]['type'];
}
return NULL;
}
Here is the call graph for this function:| ilBMFWSDL::getComplexTypeNameForElement | ( | $ | name, | |
| $ | namespace | |||
| ) |
Definition at line 636 of file class.ilBMFWSDL.php.
References $t, and _getComplexTypeForElement().
{
$t = $this->_getComplexTypeForElement($name, $namespace);
if ($t) {
return $t['name'];
}
return NULL;
}
Here is the call graph for this function:| ilBMFWSDL::getDataHandler | ( | $ | datatype, | |
| $ | namespace | |||
| ) |
getDataHandler
Given a datatype, what function handles the processing? this is used for doc/literal requests where we receive a datatype, and we need to pass it to a method in out server class
| string | datatype | |
| string | namespace |
Definition at line 288 of file class.ilBMFWSDL.php.
{
// see if we have an element by this name
if (isset($this->namespaces[$namespace]))
$namespace = $this->namespaces[$namespace];
if (isset($this->ns[$namespace])) {
$nsp = $this->ns[$namespace];
#if (!isset($this->elements[$nsp]))
# $nsp = $this->namespaces[$nsp];
if (isset($this->elements[$nsp][$datatype])) {
$checkmessages = array();
// find what messages use this datatype
foreach ($this->messages as $messagename=>$message) {
foreach ($message as $partname=>$part) {
if ($part['type']==$datatype) {
$checkmessages[] = $messagename;
break;
}
}
}
// find the operation that uses this message
$dataHandler = NULL;
foreach($this->portTypes as $portname=>$porttype) {
foreach ($porttype as $opname=>$opinfo) {
foreach ($checkmessages as $messagename) {
if ($opinfo['input']['message'] == $messagename) {
return $opname;
}
}
}
}
}
}
return null;
}
| ilBMFWSDL::getEndpoint | ( | $ | portName | ) |
Definition at line 156 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::_raiseSoapFault().
{
return (isset($this->services[$this->service]['ports'][$portName]['address']['location']))
? $this->services[$this->service]['ports'][$portName]['address']['location']
: $this->_raiseSoapFault("no endpoint for port for $portName", $this->uri);
}
Here is the call graph for this function:| ilBMFWSDL::getNamespace | ( | $ | portName, | |
| $ | operation | |||
| ) |
Definition at line 332 of file class.ilBMFWSDL.php.
{
if (isset($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]) &&
isset($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace']) &&
$namespace = $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace']) {
return $namespace;
}
return false;
}
| ilBMFWSDL::getNamespaceAttributeName | ( | $ | namespace | ) |
Definition at line 342 of file class.ilBMFWSDL.php.
References addNamespace().
{
/* if it doesn't exist at first, flip the array and check again */
if (!array_key_exists($namespace, $this->ns)) {
$this->ns = array_flip($this->namespaces);
}
/* if it doesn't exist now, add it */
if (!array_key_exists($namespace, $this->ns)) {
return $this->addNamespace($namespace);
}
return $this->ns[$namespace];
}
Here is the call graph for this function:| ilBMFWSDL::getOperationData | ( | $ | portName, | |
| $ | operation | |||
| ) |
Definition at line 198 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::_raiseSoapFault().
{
if (isset($this->services[$this->service]['ports'][$portName]['binding'])
&& $binding = $this->services[$this->service]['ports'][$portName]['binding']) {
// get operation data from binding
if (is_array($this->bindings[$binding]['operations'][$operation])) {
$opData = $this->bindings[$binding]['operations'][$operation];
}
// get operation data from porttype
$portType = $this->bindings[$binding]['type'];
if (!$portType) {
return $this->_raiseSoapFault("no port type for binding $binding in wsdl " . $this->uri);
}
if (is_array($this->portTypes[$portType][$operation])) {
if (isset($this->portTypes[$portType][$operation]['parameterOrder']))
$opData['parameterOrder'] = $this->portTypes[$portType][$operation]['parameterOrder'];
$opData['input'] = array_merge($opData['input'], $this->portTypes[$portType][$operation]['input']);
$opData['output'] = array_merge($opData['output'], $this->portTypes[$portType][$operation]['output']);
}
if (!$opData)
return $this->_raiseSoapFault("no operation $operation for port $portName, in wsdl", $this->uri);
$opData['parameters'] = false;
if (isset($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace']))
$opData['namespace'] = $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace'];
// message data from messages
$inputMsg = $opData['input']['message'];
if (is_array($this->messages[$inputMsg])) {
foreach ($this->messages[$inputMsg] as $pname => $pattrs) {
if ($opData['style'] == 'document' && $opData['input']['use'] == 'literal'
&& $pname == 'parameters') {
$opData['parameters'] = true;
$opData['namespace'] = $this->namespaces[$pattrs['namespace']];
$el = $this->elements[$pattrs['namespace']][$pattrs['type']];
if (isset($el['elements'])) {
foreach ($el['elements'] as $elname => $elattrs) {
$opData['input']['parts'][$elname] = $elattrs;
}
}
} else {
$opData['input']['parts'][$pname] = $pattrs;
}
}
}
$outputMsg = $opData['output']['message'];
if (is_array($this->messages[$outputMsg])) {
foreach ($this->messages[$outputMsg] as $pname => $pattrs) {
if ($opData['style'] == 'document' && $opData['output']['use'] == 'literal'
&& $pname == 'parameters') {
$el = $this->elements[$pattrs['namespace']][$pattrs['type']];
if (isset($el['elements'])) {
foreach ($el['elements'] as $elname => $elattrs) {
$opData['output']['parts'][$elname] = $elattrs;
}
}
} else {
$opData['output']['parts'][$pname] = $pattrs;
}
}
}
return $opData;
}
return $this->_raiseSoapFault("no binding for port $portName in wsdl", $this->uri);
}
Here is the call graph for this function:| ilBMFWSDL::getPortName | ( | $ | operation, | |
| $ | service = null | |||
| ) |
Definition at line 178 of file class.ilBMFWSDL.php.
References $service, _getPortName(), and ilBMFBase_Object::_raiseSoapFault().
{
if (!$service) $service = $this->service;
if (isset($this->services[$service]['ports'])) {
$portName = $this->_getPortName($operation,$service);
if ($portName) return $portName;
}
// try any service in the wsdl
foreach ($this->services as $serviceName=>$service) {
if (isset($this->services[$serviceName]['ports'])) {
$portName = $this->_getPortName($operation,$serviceName);
if ($portName) {
$this->service = $serviceName;
return $portName;
}
}
}
return $this->_raiseSoapFault("no operation $operation in wsdl", $this->uri);
}
Here is the call graph for this function:| & ilBMFWSDL::getProxy | ( | $ | port = '', |
|
| $ | name = '' | |||
| ) |
Definition at line 591 of file class.ilBMFWSDL.php.
References $proxy, and generateProxyCode().
{
$multiport = count($this->services[$this->service]['ports']) > 1;
if (!$port) {
reset($this->services[$this->service]['ports']);
$port = current($this->services[$this->service]['ports']);
}
if ($multiport || $port) {
$classname = 'WebService_' . $this->service . '_' . $port['name'];
} else {
$classname = 'WebService_' . $this->service;
}
if ($name) {
$classname = $name . '_' . $classname;
}
$classname = preg_replace('/[ .\-\(\)]+/', '_', $classname);
if (!class_exists($classname)) {
$proxy = $this->generateProxyCode($port, $classname);
eval($proxy);
}
return new $classname;
}
Here is the call graph for this function:| ilBMFWSDL::getSchemaType | ( | $ | type, | |
| $ | name, | |||
| $ | type_namespace | |||
| ) |
Definition at line 656 of file class.ilBMFWSDL.php.
References $ns, $type, and _getDeepestArrayType().
{
# see if it's a complex type so we can deal properly with SOAPENC:arrayType
if ($name && $type) {
# XXX TODO:
# look up the name in the wsdl and validate the type
foreach ($this->complexTypes as $ns=> $types) {
if (array_key_exists($type, $types)) {
if (array_key_exists('type', $types[$type])) {
list($arraytype_ns, $arraytype, $array_depth) = isset($types[$type]['arrayType'])?
$this->_getDeepestArrayType($types[$type]['namespace'], $types[$type]['arrayType'])
: array($this->namespaces[$types[$type]['namespace']], NULL, 0);
return array($types[$type]['type'], $arraytype, $arraytype_ns, $array_depth);
}
if (array_key_exists('arrayType', $types[$type])) {
list($arraytype_ns, $arraytype, $array_depth) =
$this->_getDeepestArrayType($types[$type]['namespace'], $types[$type]['arrayType']);
return array('Array', $arraytype, $arraytype_ns, $array_depth);
}
if (array_key_exists('elements', $types[$type]) &&
array_key_exists($name, $types[$type]['elements'])) {
$type = $types[$type]['elements']['type'];
return array($type, NULL, $this->namespaces[$types[$type]['namespace']], NULL);
}
}
}
}
if ($type && $type_namespace) {
$arrayType = NULL;
# XXX TODO:
# this code currently handles only one way of encoding array types in wsdl
# need to do a generalized function to figure out complex types
$p = $this->ns[$type_namespace];
if ($p &&
array_key_exists($p, $this->complexTypes) &&
array_key_exists($type, $this->complexTypes[$p])) {
if ($arrayType = $this->complexTypes[$p][$type]['arrayType']) {
$type = 'Array';
} else if ($this->complexTypes[$p][$type]['order']=='sequence' &&
array_key_exists('elements', $this->complexTypes[$p][$type])) {
reset($this->complexTypes[$p][$type]['elements']);
# assume an array
if (count($this->complexTypes[$p][$type]['elements']) == 1) {
$arg = current($this->complexTypes[$p][$type]['elements']);
$arrayType = $arg['type'];
$type = 'Array';
} else {
foreach($this->complexTypes[$p][$type]['elements'] as $element) {
if ($element['name'] == $type) {
$arrayType = $element['type'];
$type = $element['type'];
}
}
}
} else {
$type = 'Struct';
}
return array($type, $arrayType, $type_namespace, null);
}
}
return array(null, null, null, null);
}
Here is the call graph for this function:| ilBMFWSDL::getSoapAction | ( | $ | portName, | |
| $ | operation | |||
| ) |
Definition at line 323 of file class.ilBMFWSDL.php.
{
if (isset($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['soapAction']) &&
$soapAction = $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['soapAction']) {
return $soapAction;
}
return false;
}
| ilBMFWSDL::ilBMFWSDL | ( | $ | wsdl_uri = false, |
|
| $ | proxy = array(), |
|||
| $ | cacheUse = WSDL_CACHE_USE, |
|||
| $ | cacheMaxAge = WSDL_CACHE_MAX_AGE | |||
| ) |
ilBMFWSDL constructor
| string | endpoint_uri (URL to WSDL file) | |
| array | contains options for HTTP_Request class (see HTTP/Request.php) | |
| boolean | use WSDL caching | |
| int | cache max lifetime (in seconds) public |
Definition at line 96 of file class.ilBMFWSDL.php.
References $cacheMaxAge, $cacheUse, $proxy, ilBMFBase::ilBMFBase(), and parseURL().
{
parent::ilBMFBase('WSDL');
$this->uri = $wsdl_uri;
$this->proxy = $proxy;
$this->cacheUse = $cacheUse;
$this->cacheMaxAge = $cacheMaxAge;
if ($wsdl_uri) {
$this->parseURL($wsdl_uri);
reset($this->services);
$this->service = key($this->services);
}
}
Here is the call graph for this function:| ilBMFWSDL::matchMethod | ( | &$ | operation | ) |
Definition at line 264 of file class.ilBMFWSDL.php.
{
// Overloading lowercases function names :(
foreach ($this->services[$this->service]['ports'] as $port => $portAttrs) {
foreach (array_keys($this->bindings[$portAttrs['binding']]['operations']) as $op) {
if (strcasecmp($op, $operation) == 0) {
$operation = $op;
}
}
}
}
| ilBMFWSDL::parse | ( | $ | wsdl_uri, | |
| $ | proxy = array() | |||
| ) |
Definition at line 120 of file class.ilBMFWSDL.php.
References $proxy, and parseURL().
Here is the call graph for this function:| ilBMFWSDL::parseObject | ( | &$ | wsdl_obj, | |
| $ | targetNamespace, | |||
| $ | service_name, | |||
| $ | service_desc = '' | |||
| ) |
Fill the WSDL array tree with data from one or more PHP class objects.
| mixed | $wsdl_obj An object or array of objects to add to the internal WSDL tree | |
| string | $service_name Name of the WSDL <service> | |
| string | $service_desc Optional description of the WSDL <service> |
Definition at line 147 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::_raiseSoapFault().
{
$parser =& new ilBMFWSDL_ObjectParser($wsdl_obj, $this, $targetNamespace, $service_name, $service_desc);
if ($parser->fault) {
$this->_raiseSoapFault($parser->fault);
}
}
Here is the call graph for this function:| ilBMFWSDL::parseURL | ( | $ | wsdl_uri, | |
| $ | proxy = array() | |||
| ) |
Fill the WSDL array tree with data from a WSDL file.
| string | ||
| array | proxi related parameters |
Definition at line 131 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::_raiseSoapFault().
Referenced by ilBMFWSDL(), and parse().
{
$parser =& new ilBMFWSDL_Parser($wsdl_uri, $this);
if ($parser->fault) {
$this->_raiseSoapFault($parser->fault);
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilBMFWSDL::set_service | ( | $ | service | ) |
Definition at line 111 of file class.ilBMFWSDL.php.
References $service.
| ilBMFWSDL::$bindings = array() |
Definition at line 58 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$cacheMaxAge = null |
Definition at line 85 of file class.ilBMFWSDL.php.
Referenced by ilBMFWSDL().
| ilBMFWSDL::$cacheUse = null |
Definition at line 78 of file class.ilBMFWSDL.php.
Referenced by ilBMFWSDL().
| ilBMFWSDL::$complexTypes = array() |
Definition at line 54 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$definition = array() |
Definition at line 50 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$elements = array() |
Definition at line 55 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$imports = array() |
Definition at line 59 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$messages = array() |
Definition at line 56 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$namespaces = array() |
Definition at line 51 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$ns = array() |
Definition at line 52 of file class.ilBMFWSDL.php.
Referenced by _getComplexTypeForElement(), generateProxyCode(), getComplexTypeChildType(), and getSchemaType().
| ilBMFWSDL::$portTypes = array() |
Definition at line 57 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$proxy = null |
Definition at line 69 of file class.ilBMFWSDL.php.
Referenced by getProxy(), ilBMFWSDL(), and parse().
| ilBMFWSDL::$service = '' |
Definition at line 61 of file class.ilBMFWSDL.php.
Referenced by _getPortName(), getPortName(), and set_service().
| ilBMFWSDL::$services = array() |
Definition at line 60 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$tns = null |
Definition at line 49 of file class.ilBMFWSDL.php.
Referenced by _elementArg().
| ilBMFWSDL::$trace = 0 |
Definition at line 71 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$uri = '' |
Definition at line 62 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$xsd = SOAP_XML_SCHEMA_VERSION |
Definition at line 53 of file class.ilBMFWSDL.php.
1.7.1