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, $docs=false) | |
| ilBMFWSDL constructor. | |
| set_service ($service) | |
| parse ($wsdl_uri, $proxy=array()) | |
| parseURL ($wsdl_uri, $proxy=array()) | |
| Fills the WSDL array tree with data from a WSDL file. | |
| parseObject (&$wsdl_obj, $targetNamespace, $service_name, $service_desc= '') | |
| Fills the WSDL array tree with data from one or more PHP class objects. | |
| getEndpoint ($portName) | |
| _getPortName ($operation, $service) | |
| getPortName ($operation, $service=null) | |
| Finds the name of the first port that contains an operation of name $operation. | |
| getOperationData ($portName, $operation) | |
| matchMethod (&$operation) | |
| getDataHandler ($datatype, $namespace) | |
| Given a datatype, what function handles the processing? | |
| 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= '') | |
| 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 = '' | |
| $docs = false | |
| $proxy = null | |
| $trace = 0 | |
| $cacheUse = null | |
| $cacheMaxAge = null | |
| $wsdlParserClass = 'ilBMFWSDL_Parser' | |
Definition at line 49 of file class.ilBMFWSDL.php.
| ilBMFWSDL::_addArg | ( | &$ | args, | |
| &$ | argarray, | |||
| $ | argname | |||
| ) |
Definition at line 441 of file class.ilBMFWSDL.php.
References _validateString().
Referenced by _complexTypeArg(), _elementArg(), and generateProxyCode().
{
if ($args) {
$args .= ', ';
}
$args .= '$' . $argname;
if (!$this->_validateString($argname)) {
return;
}
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 499 of file class.ilBMFWSDL.php.
References _addArg().
Referenced by generateProxyCode().
{
$comments = '';
if (isset($this->complexTypes[$_argtype['namespace']][$_argtype['type']])) {
$comments = " // $_argname is a ComplexType {$_argtype['type']},\n" .
" // 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 456 of file class.ilBMFWSDL.php.
References $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 (!empty($el['complex']) ||
(isset($el['type']) &&
isset($this->complexTypes[$tns][$el['type']]))) {
// The element is a complex type.
$comments .= " // {$_argtype['type']} is a ComplexType, refer to the WSDL for more info.\n";
$attrname = "{$_argtype['type']}_attr";
if (isset($el['type']) &&
isset($this->complexTypes[$tns][$el['type']]['attribute'])) {
$comments .= " // {$_argtype['type']} may require attributes, refer to the 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($el['type']) &&
isset($this->complexTypes[$tns][$el['type']]['attribute'])) {
if ($args) {
$args .= ', ';
}
$args .= '$' . $attrname;
}
} elseif (isset($el['elements'])) {
foreach ($el['elements'] as $ename => $element) {
$comments .= " \$$ename =& new ilBMFValue('{{$this->namespaces[$element['namespace']]}}$ename', '" .
(isset($element['type']) ? $element['type'] : false) .
"', \$$ename);\n";
$this->_addArg($args, $argarray, $ename);
}
} else {
$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 734 of file class.ilBMFWSDL.php.
References $namespace, $ns, and $t.
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 846 of file class.ilBMFWSDL.php.
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 197 of file class.ilBMFWSDL.php.
References $service.
Referenced by getPortName().
{
if (isset($this->services[$service]['ports'])) {
$ports = $this->services[$service]['ports'];
foreach ($ports as $port => $portAttrs) {
$type = $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 436 of file class.ilBMFWSDL.php.
Referenced by _addArg(), and generateProxyCode().
{
return preg_match('/^[\w_:#\/]+$/', $string);
}
Here is the caller graph for this function:| ilBMFWSDL::addNamespace | ( | $ | namespace | ) |
Definition at line 422 of file class.ilBMFWSDL.php.
References $namespace.
Referenced by getNamespaceAttributeName().
{
if (!empty($this->ns[$namespace])) {
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 689 of file class.ilBMFWSDL.php.
References 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 = '' | |||
| ) |
Generates stub code from the WSDL that can be saved to a file or eval'd into existence.
Definition at line 521 of file class.ilBMFWSDL.php.
References $namespace, $ns, ilBMFBase_Object::__getfault(), ilBMFBase_Object::__isfault(), _addArg(), _complexTypeArg(), _elementArg(), and _validateString().
Referenced by generateAllProxies(), and getProxy().
{
if ($this->__isfault()) {
return $this->__getfault();
}
$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 = preg_replace('/[ .\-\(\)]+/', '_', $classname);
}
if (!$this->_validateString($classname)) {
return null;
}
if (is_array($this->proxy) && count($this->proxy)) {
$class = "class $classname extends ilBMFClient\n{\n" .
" function $classname(\$path = '$clienturl')\n {\n" .
" \$this->ilBMFClient(\$path, 0, 0,\n" .
' 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(\$path = '$clienturl')\n {\n" .
" \$this->ilBMFClient(\$path, 0);\n" .
" }\n";
}
// Get the binding, from that get the port type.
$primaryBinding = $port['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) {
$binding = $this->bindings[$primaryBinding]['operations'][$opname];
if (isset($binding['soapAction'])) {
$soapaction = $binding['soapAction'];
} else {
$soapaction = null;
}
if (isset($binding['style'])) {
$opstyle = $binding['style'];
} else {
$opstyle = $style;
}
$use = $binding['input']['use'];
if ($use == 'encoded') {
$namespace = $binding['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) {
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
// ilBMFValue.
}
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);
}
}
}
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.
// Operation names are function names, so try to make sure it's
// legal. This could potentially cause collisions, but let's try
// to make everything callable and see how many problems that
// causes.
$opname_php = preg_replace('/[ .\-\(\)]+/', '_', $opname);
if (!$this->_validateString($opname_php)) {
return null;
}
if ($argarray) {
$argarray = "array($argarray)";
} else {
$argarray = 'null';
}
$class .= " function &$opname_php($args)\n {\n$comments$wrappers" .
" \$result = \$this->call('$opname',\n" .
" \$v = $argarray,\n" .
" array('namespace' => '$namespace',\n" .
" 'soapaction' => '$soapaction',\n" .
" 'style' => '$opstyle',\n" .
" 'use' => '$use'" .
($this->trace?",\n 'trace' => 1" : '') . "));\n" .
" return \$result;\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 759 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 750 of file class.ilBMFWSDL.php.
References $namespace, $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 | |||
| ) |
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 342 of file class.ilBMFWSDL.php.
References $namespace.
{
// 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 186 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::__getfault(), ilBMFBase_Object::__isfault(), and ilBMFBase_Object::_raiseSoapFault().
{
if ($this->__isfault()) {
return $this->__getfault();
}
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 394 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::__getfault(), and ilBMFBase_Object::__isfault().
{
if ($this->__isfault()) {
return $this->__getfault();
}
if (!empty($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace'])) {
return $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['input']['namespace'];
}
return false;
}
Here is the call graph for this function:| ilBMFWSDL::getNamespaceAttributeName | ( | $ | namespace | ) |
Definition at line 407 of file class.ilBMFWSDL.php.
References $namespace, and addNamespace().
{
/* If it doesn't exist at first, flip the array and check again. */
if (empty($this->ns[$namespace])) {
$this->ns = array_flip($this->namespaces);
}
/* If it doesn't exist now, add it. */
if (empty($this->ns[$namespace])) {
return $this->addNamespace($namespace);
}
return $this->ns[$namespace];
}
Here is the call graph for this function:| ilBMFWSDL::getOperationData | ( | $ | portName, | |
| $ | operation | |||
| ) |
Definition at line 242 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::__getfault(), ilBMFBase_Object::__isfault(), and ilBMFBase_Object::_raiseSoapFault().
{
if ($this->__isfault()) {
return $this->__getfault();
}
if (!isset($this->services[$this->service]['ports'][$portName]['binding']) ||
!($binding = $this->services[$this->service]['ports'][$portName]['binding'])) {
return $this->_raiseSoapFault("No binding for port $portName in WSDL.", $this->uri);
}
// 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($type = $this->portTypes[$portType][$operation])) {
if (isset($type['parameterOrder'])) {
$opData['parameterOrder'] = $type['parameterOrder'];
}
$opData['input'] = array_merge($opData['input'], $type['input']);
$opData['output'] = array_merge($opData['output'], $type['output']);
}
if (!$opData)
return $this->_raiseSoapFault("No operation $operation for port $portName in WSDL.", $this->uri);
$opData['parameters'] = false;
if (isset($this->bindings[$binding]['operations'][$operation]['input']['namespace']))
$opData['namespace'] = $this->bindings[$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;
}
Here is the call graph for this function:| ilBMFWSDL::getPortName | ( | $ | operation, | |
| $ | service = null | |||
| ) |
Finds the name of the first port that contains an operation of name $operation.
Always returns a SOAP portName.
Definition at line 216 of file class.ilBMFWSDL.php.
References $service, ilBMFBase_Object::__getfault(), ilBMFBase_Object::__isfault(), _getPortName(), and ilBMFBase_Object::_raiseSoapFault().
{
if ($this->__isfault()) {
return $this->__getfault();
}
if (!$service) {
$service = $this->service;
}
if (isset($this->services[$service]['ports'])) {
if ($portName = $this->_getPortName($operation, $service)) {
return $portName;
}
}
// Try any service in the WSDL.
foreach ($this->services as $serviceName => $service) {
if (isset($this->services[$serviceName]['ports'])) {
if ($portName = $this->_getPortName($operation, $serviceName)) {
$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 699 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::$fault, $proxy, ilBMFBase_Object::__getfault(), ilBMFBase_Object::__isfault(), and generateProxyCode().
{
if ($this->__isfault()) {
$fault =& $this->__getfault();
return $fault;
}
$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);
require_once 'SOAP/Client.php';
eval($proxy);
}
$proxy =& new $classname;
return $proxy;
}
Here is the call graph for this function:| ilBMFWSDL::getSchemaType | ( | $ | type, | |
| $ | name, | |||
| $ | type_namespace | |||
| ) |
Definition at line 771 of file class.ilBMFWSDL.php.
References $ns, 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';
} elseif ($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 381 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::__getfault(), and ilBMFBase_Object::__isfault().
{
if ($this->__isfault()) {
return $this->__getfault();
}
if (!empty($this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['soapAction'])) {
return $this->bindings[$this->services[$this->service]['ports'][$portName]['binding']]['operations'][$operation]['soapAction'];
}
return false;
}
Here is the call graph for this function:| ilBMFWSDL::ilBMFWSDL | ( | $ | wsdl_uri = false, |
|
| $ | proxy = array(), |
|||
| $ | cacheUse = WSDL_CACHE_USE, |
|||
| $ | cacheMaxAge = WSDL_CACHE_MAX_AGE, |
|||
| $ | docs = false | |||
| ) |
ilBMFWSDL constructor.
| string | $wsdl_uri URL to WSDL file. | |
| array | $proxy Contains options for HTTP_Request class |
| boolean | $cacheUse Use WSDL caching. Defaults to false. | |
| integer | $cacheMaxAge Cache max lifetime (in seconds). | |
| boolean | $docs Parse documentation in the WSDL? Defaults to false. |
public
Definition at line 111 of file class.ilBMFWSDL.php.
References $cacheMaxAge, $cacheUse, $docs, $proxy, ilBMFBase::ilBMFBase(), and parseURL().
{
parent::ilBMFBase('WSDL');
$this->uri = $wsdl_uri;
$this->proxy = $proxy;
$this->cacheUse = $cacheUse;
$this->cacheMaxAge = $cacheMaxAge;
$this->docs = $docs;
if ($wsdl_uri) {
if (!PEAR::isError($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 315 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::__getfault(), and ilBMFBase_Object::__isfault().
{
if ($this->__isfault()) {
return $this->__getfault();
}
// 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;
}
}
}
}
Here is the call graph for this function:| ilBMFWSDL::parse | ( | $ | wsdl_uri, | |
| $ | proxy = array() | |||
| ) |
Definition at line 142 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 = '' | |||
| ) |
Fills 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 | $targetNamespace The target namespace of schema types etc. | |
| string | $service_name Name of the WSDL service. | |
| string | $service_desc Optional description of the WSDL service. |
Definition at line 174 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() | |||
| ) |
Fills the WSDL array tree with data from a WSDL file.
| string | $wsdl_uri URL to WSDL file. | |
| array | $proxy Contains options for HTTP_Request class |
Definition at line 154 of file class.ilBMFWSDL.php.
References ilBMFBase_Object::_raiseSoapFault().
Referenced by ilBMFWSDL(), and parse().
{
$parser =& new $this->wsdlParserClass($wsdl_uri, $this, $this->docs);
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 132 of file class.ilBMFWSDL.php.
References $service.
| ilBMFWSDL::$bindings = array() |
Definition at line 60 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$cacheMaxAge = null |
Definition at line 88 of file class.ilBMFWSDL.php.
Referenced by ilBMFWSDL().
| ilBMFWSDL::$cacheUse = null |
Definition at line 81 of file class.ilBMFWSDL.php.
Referenced by ilBMFWSDL().
| ilBMFWSDL::$complexTypes = array() |
Definition at line 56 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$definition = array() |
Definition at line 52 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$docs = false |
Definition at line 65 of file class.ilBMFWSDL.php.
Referenced by ilBMFWSDL().
| ilBMFWSDL::$elements = array() |
Definition at line 57 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$imports = array() |
Definition at line 61 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$messages = array() |
Definition at line 58 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$namespaces = array() |
Definition at line 53 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$ns = array() |
Definition at line 54 of file class.ilBMFWSDL.php.
Referenced by _getComplexTypeForElement(), generateProxyCode(), getComplexTypeChildType(), and getSchemaType().
| ilBMFWSDL::$portTypes = array() |
Definition at line 59 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$proxy = null |
Definition at line 72 of file class.ilBMFWSDL.php.
Referenced by getProxy(), ilBMFWSDL(), and parse().
| ilBMFWSDL::$service = '' |
Definition at line 63 of file class.ilBMFWSDL.php.
Referenced by _getPortName(), getPortName(), and set_service().
| ilBMFWSDL::$services = array() |
Definition at line 62 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$tns = null |
Definition at line 51 of file class.ilBMFWSDL.php.
Referenced by _elementArg().
| ilBMFWSDL::$trace = 0 |
Definition at line 74 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$uri = '' |
Definition at line 64 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$wsdlParserClass = 'ilBMFWSDL_Parser' |
Definition at line 96 of file class.ilBMFWSDL.php.
| ilBMFWSDL::$xsd = SOAP_XML_SCHEMA_VERSION |
Definition at line 55 of file class.ilBMFWSDL.php.
1.7.1