/** * Initialize PhpWsdl */ public static function Init() { self::Debug('Init'); // Configuration self::$HTML2PDFSettings = array('attachments' => '1', 'outline' => '1'); self::$NameSpaces = array('soap' => 'http://schemas.xmlsoap.org/wsdl/soap/', 's' => 'http://www.w3.org/2001/XMLSchema', 'wsdl' => 'http://schemas.xmlsoap.org/wsdl/', 'soapenc' => 'http://schemas.xmlsoap.org/soap/encoding/'); self::EnableCache(); self::$Config['extensions'] = array(); // A configuration space for extensions self::$Config['tns'] = 'tns'; // The xmlns name for the target namespace self::$Config['xsd'] = 's'; // The xmlns name for the XSD namespace // Parser hooks self::RegisterHook('InterpretKeywordserviceHook', 'internal', 'PhpWsdl::InterpretService'); // WSDL hooks self::RegisterHook('CreateWsdlHeaderHook', 'internal', 'PhpWsdl::CreateWsdlHeader'); self::RegisterHook('CreateWsdlTypeSchemaHook', 'internal', 'PhpWsdl::CreateWsdlTypeSchema'); self::RegisterHook('CreateWsdlMessagesHook', 'internal', 'PhpWsdl::CreateWsdlMessages'); self::RegisterHook('CreateWsdlPortsHook', 'internal', 'PhpWsdl::CreateWsdlPorts'); self::RegisterHook('CreateWsdlBindingsHook', 'internal', 'PhpWsdl::CreateWsdlBindings'); self::RegisterHook('CreateWsdlServiceHook', 'internal', 'PhpWsdl::CreateWsdlService'); self::RegisterHook('CreateWsdlFooterHook', 'internal', 'PhpWsdl::CreateWsdlFooter'); self::RegisterHook('CreateWsdlOptimizeHook', 'internal', 'PhpWsdl::CreateWsdlOptimize'); // HTML hooks self::RegisterHook('CreateHtmlGeneralHook', 'internal', 'PhpWsdl::CreateHtmlGeneral'); self::RegisterHook('CreateHtmlIndexHook', 'internal', 'PhpWsdl::CreateHtmlIndex'); self::RegisterHook('CreateHtmlMethodsHook', 'internal', 'PhpWsdl::CreateHtmlMethods'); self::RegisterHook('CreateHtmlComplexTypesHook', 'internal', 'PhpWsdl::CreateHtmlComplexTypes'); // Extensions self::Debug('Load extensions'); $files = glob(dirname(__FILE__) . '/' . 'class.phpwsdl.*.php'); if ($files !== false) { $i = -1; $len = sizeof($files); while (++$i < $len) { self::Debug('Load ' . $files[$i]); require_once $files[$i]; } } else { self::Debug('"glob" failed'); } }
/** * Initialize PhpWsdl */ public static function Init() { self::Debug('Init'); // Configuration self::$HTML2PDFSettings = array('attachments' => '1', 'outline' => '1'); self::$NameSpaces = array('soap' => 'http://schemas.xmlsoap.org/wsdl/soap/', 's' => 'http://www.w3.org/2001/XMLSchema', 'wsdl' => 'http://schemas.xmlsoap.org/wsdl/', 'soapenc' => 'http://schemas.xmlsoap.org/soap/encoding/'); //TODO How to encode the missing basic types? self::$TypeEncoding = array('parameter' => array(), 'return' => array(), 'default' => array('string' => array('encoding' => XSD_STRING), 'boolean' => array('encoding' => XSD_BOOLEAN), 'decimal' => array('encoding' => XSD_DECIMAL), 'float' => array('encoding' => XSD_FLOAT), 'double' => array('encoding' => XSD_DOUBLE), 'duration' => array('encoding' => XSD_DURATION), 'dateTime' => array('encoding' => XSD_DATETIME), 'time' => array('encoding' => XSD_TIME), 'date' => array('encoding' => XSD_DATE), 'gYearMonth' => array('encoding' => XSD_GYEARMONTH), 'gYear' => array('encoding' => XSD_GYEAR), 'gMonthDay' => array('encoding' => XSD_GMONTHDAY), 'gDay' => array('encoding' => XSD_GDAY), 'gMonth' => array('encoding' => XSD_GMONTH), 'hexBinary' => array('encoding' => XSD_HEXBINARY), 'base64Binary' => array('encoding' => XSD_BASE64BINARY), 'anyURI' => array('encoding' => XSD_ANYURI), 'QName' => array('encoding' => XSD_QNAME), 'NOTATION' => array('encoding' => XSD_NOTATION), 'int' => array('encoding' => XSD_INT), 'integer' => array('encoding' => XSD_INTEGER), 'long' => array('encoding' => XSD_LONG), 'short' => array('encoding' => XSD_SHORT), 'byte' => array('encoding' => XSD_BYTE), 'anyType' => array('encoding' => XSD_ANYTYPE))); self::EnableCache(); self::$Config['extensions'] = array(); // A configuration space for extensions self::$Config['tns'] = 'tns'; // The xmlns name for the target namespace self::$Config['xsd'] = 's'; // The xmlns name for the XSD namespace // Parser hooks self::RegisterHook('InterpretKeywordserviceHook', 'internal', 'PhpWsdl::InterpretService'); self::RegisterHook('InterpretKeywordpw_setHook', 'internal', 'PhpWsdl::InterpretSetting'); // WSDL hooks self::RegisterHook('CreateWsdlHeaderHook', 'internal', 'PhpWsdl::CreateWsdlHeader'); self::RegisterHook('CreateWsdlTypeSchemaHook', 'internal', 'PhpWsdl::CreateWsdlTypeSchema'); self::RegisterHook('CreateWsdlMessagesHook', 'internal', 'PhpWsdl::CreateWsdlMessages'); self::RegisterHook('CreateWsdlPortsHook', 'internal', 'PhpWsdl::CreateWsdlPorts'); self::RegisterHook('CreateWsdlBindingsHook', 'internal', 'PhpWsdl::CreateWsdlBindings'); self::RegisterHook('CreateWsdlServiceHook', 'internal', 'PhpWsdl::CreateWsdlService'); self::RegisterHook('CreateWsdlFooterHook', 'internal', 'PhpWsdl::CreateWsdlFooter'); self::RegisterHook('CreateWsdlOptimizeHook', 'internal', 'PhpWsdl::CreateWsdlOptimize'); // HTML hooks self::RegisterHook('CreateHtmlGeneralHook', 'internal', 'PhpWsdl::CreateHtmlGeneral'); self::RegisterHook('CreateHtmlIndexHook', 'internal', 'PhpWsdl::CreateHtmlIndex'); self::RegisterHook('CreateHtmlMethodsHook', 'internal', 'PhpWsdl::CreateHtmlMethods'); self::RegisterHook('CreateHtmlComplexTypesHook', 'internal', 'PhpWsdl::CreateHtmlComplexTypes'); // Extensions self::Debug('Load extensions'); $files = glob(dirname(__FILE__) . '/' . 'class.phpwsdl.*.php'); if ($files !== false) { $i = -1; $len = sizeof($files); while (++$i < $len) { self::Debug('Load ' . $files[$i]); require_once $files[$i]; } } else { self::Debug('"glob" failed'); } }