function &getTransport($url, $encoding = SOAP_DEFAULT_ENCODING) { $urlparts = @parse_url($url); if (!$urlparts['scheme']) { $fault = ilBMFBase_Object::_raiseSoapFault("Invalid transport URI: {$url}"); return $fault; } if (strcasecmp($urlparts['scheme'], 'mailto') == 0) { $transport_type = 'SMTP'; } elseif (strcasecmp($urlparts['scheme'], 'https') == 0) { $transport_type = 'HTTP'; } else { /* handle other transport types */ $transport_type = strtoupper($urlparts['scheme']); } $transport_include = dirname(__FILE__) . '/Transport/class.ilBMFTransport_' . $transport_type . '.php'; $res = @(include_once $transport_include); if (!$res && !in_array($transport_include, get_included_files())) { $fault = ilBMFBase_Object::_raiseSoapFault("No Transport for {$urlparts['scheme']}"); return $fault; } $transport_class = "ilBMFTransport_{$transport_type}"; if (!class_exists($transport_class)) { $fault = ilBMFBase_Object::_raiseSoapFault("No Transport class {$transport_class}"); return $fault; } $t =& new $transport_class($url, $encoding); return $t; }
/** * Constructor. * * @param string $url HTTP url to SOAP endpoint. * * @access public */ function ilBMFTransport_TCP($url, $encoding = SOAP_DEFAULT_ENCODING) { parent::ilBMFBase_Object('TCP'); $this->urlparts = @parse_url($url); $this->url = $url; $this->encoding = $encoding; }
/** * Constructor. * * @see $debug_data, _debug() * * @param string $faultcode Error code. */ function ilBMFBase($faultcode = 'Client') { parent::ilBMFBase_Object($faultcode); $this->_resetNamespaces(); }