Back to index

lightning-sunbird  0.9+nobinonly
nsWebServicesModule.cpp
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is the web services module code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 2002
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s): Harish Dhurvasula <harishd@netscape.com>
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either the GNU General Public License Version 2 or later (the "GPL"), or
00026  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #include "nsICategoryManager.h"
00039 #include "nsIScriptNameSpaceManager.h"
00040 
00041 #include "nsSOAPHeaderBlock.h"
00042 #include "nsSOAPParameter.h"
00043 #include "nsSOAPCall.h"
00044 #include "nsSOAPResponse.h"
00045 #include "nsSOAPEncoding.h"
00046 #include "nsSOAPFault.h"
00047 #include "nsSOAPException.h"
00048 #include "nsDefaultSOAPEncoder.h"
00049 #include "nsHTTPSOAPTransport.h"
00050 #include "nsSOAPPropertyBag.h"
00051 #include "nsSchemaLoader.h"
00052 #include "nsSchemaPrivate.h"
00053 
00054 #include "nsWSDLLoader.h"
00055 #include "nsWSDLPrivate.h"
00056 #include "wspprivate.h"
00057 #include "iixprivate.h"
00058 
00059 #include "nsWebScriptsAccess.h"
00060 
00062 // Define the constructor function for the objects
00063 //
00064 // NOTE: This creates an instance of objects by using the default constructor
00065 //
00066 NS_GENERIC_FACTORY_CONSTRUCTOR(nsGenericInterfaceInfoSet)
00067 NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableInterfaceInfo)
00068 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWebScriptsAccess)
00069 
00070 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPCall)
00071 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPResponse)
00072 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPEncoding)
00073 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPFault)
00074 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPHeaderBlock)
00075 NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPParameter)
00076 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultSOAPEncoding_1_1)
00077 NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultSOAPEncoding_1_2)
00078 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTTPSOAPTransport)
00079 NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTTPSSOAPTransport)
00080 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSOAPPropertyBagMutator, Init)
00081 NS_DECL_CLASSINFO(nsSOAPCall)
00082 NS_DECL_CLASSINFO(nsSOAPResponse)
00083 NS_DECL_CLASSINFO(nsSOAPEncoding)
00084 NS_DECL_CLASSINFO(nsSOAPFault)
00085 NS_DECL_CLASSINFO(nsSOAPHeaderBlock)
00086 NS_DECL_CLASSINFO(nsSOAPParameter)
00087 NS_DECL_CLASSINFO(nsHTTPSOAPTransport)
00088 NS_DECL_CLASSINFO(nsHTTPSOAPTransportCompletion)
00089 NS_DECL_CLASSINFO(nsHTTPSSOAPTransport)
00090 NS_DECL_CLASSINFO(nsSOAPPropertyBagMutator)
00091 NS_DECL_CLASSINFO(nsSOAPProperty)
00092 NS_DECL_CLASSINFO(nsSOAPPropertyBag)
00093 NS_DECL_CLASSINFO(nsSOAPPropertyBagEnumerator)
00094 NS_DECL_CLASSINFO(nsSOAPException)
00095 
00096 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsSchemaLoader, Init)
00097 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsBuiltinSchemaCollection, Init)
00098 NS_DECL_CLASSINFO(nsSchemaLoader)
00099 NS_DECL_CLASSINFO(nsSchema)
00100 NS_DECL_CLASSINFO(nsSchemaBuiltinType)
00101 NS_DECL_CLASSINFO(nsSchemaListType)
00102 NS_DECL_CLASSINFO(nsSchemaUnionType)
00103 NS_DECL_CLASSINFO(nsSchemaRestrictionType)
00104 NS_DECL_CLASSINFO(nsSchemaComplexType)
00105 NS_DECL_CLASSINFO(nsSchemaTypePlaceholder)
00106 NS_DECL_CLASSINFO(nsSchemaModelGroup)
00107 NS_DECL_CLASSINFO(nsSchemaModelGroupRef)
00108 NS_DECL_CLASSINFO(nsSchemaAnyParticle)
00109 NS_DECL_CLASSINFO(nsSchemaElement)
00110 NS_DECL_CLASSINFO(nsSchemaElementRef)
00111 NS_DECL_CLASSINFO(nsSchemaAttribute)
00112 NS_DECL_CLASSINFO(nsSchemaAttributeRef)
00113 NS_DECL_CLASSINFO(nsSchemaAttributeGroup)
00114 NS_DECL_CLASSINFO(nsSchemaAttributeGroupRef)
00115 NS_DECL_CLASSINFO(nsSchemaAnyAttribute)
00116 NS_DECL_CLASSINFO(nsSchemaFacet)
00117 NS_DECL_CLASSINFO(nsSOAPArray)
00118 NS_DECL_CLASSINFO(nsSOAPArrayType)
00119 
00120 NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsWSDLLoader, Init)
00121 NS_DECL_CLASSINFO(nsWSDLLoader)
00122 NS_DECL_CLASSINFO(nsWSDLPort)
00123 NS_DECL_CLASSINFO(nsWSDLOperation)
00124 NS_DECL_CLASSINFO(nsWSDLMessage)
00125 NS_DECL_CLASSINFO(nsWSDLPart)
00126 NS_DECL_CLASSINFO(nsSOAPPortBinding)
00127 NS_DECL_CLASSINFO(nsSOAPOperationBinding)
00128 NS_DECL_CLASSINFO(nsSOAPMessageBinding)
00129 NS_DECL_CLASSINFO(nsSOAPPartBinding)
00130 
00131 NS_DECL_CLASSINFO(WSPComplexTypeWrapper)
00132 NS_DECL_CLASSINFO(WSPCallContext)
00133 NS_DECL_CLASSINFO(WSPException)
00134 
00135 NS_GENERIC_FACTORY_CONSTRUCTOR(nsWSPInterfaceInfoService)
00136 NS_GENERIC_FACTORY_CONSTRUCTOR(WSPFactory)
00137 NS_DECL_CLASSINFO(WSPFactory)
00138 
00139 NS_DECL_CLASSINFO(nsWebScriptsAccess)
00140 
00141 // {79998DE9-1E34-45e0-A587-F9CCC8DB00DD}
00142 #define NS_WSP_INTERFACE_INFO_SERVICE_CID             \
00143   { 0x79998de9, 0x1e34, 0x45e0,                       \
00144     { 0xa5, 0x87, 0xf9, 0xcc, 0xc8, 0xdb, 0x0, 0xdd } \
00145   }
00146 
00147 // {B404670D-1EB1-4af8-86E5-FB3E9C4ECC4B}
00148 #define NS_GENERIC_INTERFACE_INFO_SET_CID              \
00149   { 0xb404670d, 0x1eb1, 0x4af8,                        \
00150     { 0x86, 0xe5, 0xfb, 0x3e, 0x9c, 0x4e, 0xcc, 0x4b } \
00151   }
00152 
00153 // {ED150A6A-4592-4e2c-82F8-70C8D65F74D2}
00154 #define NS_SCRIPTABLE_INTERFACE_INFO_CID               \
00155   { 0xed150a6a, 0x4592, 0x4e2c,                        \
00156     { 0x82, 0xf8, 0x70, 0xc8, 0xd6, 0x5f, 0x74, 0xd2 } \
00157   }
00158 
00159 // {0E1BDCED-4A4F-491b-906D-F4B908DBE854}
00160 #define NS_WEB_SRVC_CID                                \
00161   { 0xe1bdced, 0x4a4f, 0x491b,                         \
00162     { 0x90, 0x6d, 0xf4, 0xb9, 0x8, 0xdb, 0xe8, 0x54 }  \
00163   }
00164 
00165 static NS_METHOD 
00166 RegisterWebService(nsIComponentManager *aCompMgr,
00167                    nsIFile *aPath,
00168                    const char *registryLocation,
00169                    const char *componentType,
00170                    const nsModuleComponentInfo *info)
00171 {
00172   nsresult rv = NS_OK;
00173 
00174   nsCOMPtr<nsICategoryManager> catman =
00175     do_GetService(NS_CATEGORYMANAGER_CONTRACTID, &rv);
00176 
00177   if (NS_FAILED(rv))
00178     return rv;
00179 
00180   nsXPIDLCString previous;
00181   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00182                                 "SOAPCall",
00183                                 NS_SOAPCALL_CONTRACTID,
00184                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00185   NS_ENSURE_SUCCESS(rv, rv);
00186 
00187   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00188                                 "SOAPResponse",
00189                                 NS_SOAPRESPONSE_CONTRACTID,
00190                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00191   NS_ENSURE_SUCCESS(rv, rv);
00192 
00193   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00194                                 "SOAPEncoding",
00195                                 NS_SOAPENCODING_CONTRACTID,
00196                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00197   NS_ENSURE_SUCCESS(rv, rv);
00198 
00199   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00200                                 "SOAPFault",
00201                                 NS_SOAPFAULT_CONTRACTID,
00202                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00203   NS_ENSURE_SUCCESS(rv, rv);
00204 
00205   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00206                                 "SOAPHeaderBlock",
00207                                 NS_SOAPHEADERBLOCK_CONTRACTID,
00208                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00209   NS_ENSURE_SUCCESS(rv, rv);
00210 
00211   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00212                                 "SOAPParameter",
00213                                 NS_SOAPPARAMETER_CONTRACTID,
00214                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00215   NS_ENSURE_SUCCESS(rv, rv);
00216 
00217   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00218                                 "SOAPPropertyBagMutator",
00219                                 NS_SOAPPROPERTYBAGMUTATOR_CONTRACTID,
00220                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00221   NS_ENSURE_SUCCESS(rv, rv);
00222 
00223   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00224                                 "SchemaLoader",
00225                                 NS_SCHEMALOADER_CONTRACTID,
00226                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00227   NS_ENSURE_SUCCESS(rv, rv);
00228 
00229   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00230                                 "WSDLLoader",
00231                                 NS_WSDLLOADER_CONTRACTID,
00232                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00233   NS_ENSURE_SUCCESS(rv, rv);
00234   rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY,
00235                                 "WebServiceProxyFactory",
00236                                 NS_WEBSERVICEPROXYFACTORY_CONTRACTID,
00237                                 PR_TRUE, PR_TRUE, getter_Copies(previous));
00238   NS_ENSURE_SUCCESS(rv, rv);
00239 
00240   return rv;
00241 }
00242 
00244 // Define a table of CIDs implemented by this module along with other
00245 // information like the function to create an instance, contractid, and
00246 // class name.
00247 //
00248 static const nsModuleComponentInfo gComponents[] = {
00249   { "SOAP Call", NS_SOAPCALL_CID, NS_SOAPCALL_CONTRACTID,
00250     nsSOAPCallConstructor, RegisterWebService, nsnull, nsnull, 
00251     NS_CI_INTERFACE_GETTER_NAME(nsSOAPCall), 
00252     nsnull, &NS_CLASSINFO_NAME(nsSOAPCall), 
00253     nsIClassInfo::DOM_OBJECT },
00254   { "SOAP Response", NS_SOAPRESPONSE_CID, NS_SOAPRESPONSE_CONTRACTID,
00255     nsSOAPResponseConstructor, nsnull, nsnull, nsnull, 
00256     NS_CI_INTERFACE_GETTER_NAME(nsSOAPResponse), 
00257     nsnull, &NS_CLASSINFO_NAME(nsSOAPResponse), 
00258     nsIClassInfo::DOM_OBJECT },
00259   { "SOAP Encoding", NS_SOAPENCODING_CID, NS_SOAPENCODING_CONTRACTID,
00260     nsSOAPEncodingConstructor, nsnull, nsnull, nsnull, 
00261     NS_CI_INTERFACE_GETTER_NAME(nsSOAPEncoding), 
00262     nsnull, &NS_CLASSINFO_NAME(nsSOAPEncoding), 
00263     nsIClassInfo::DOM_OBJECT },
00264   { "SOAP Fault", NS_SOAPFAULT_CID, NS_SOAPFAULT_CONTRACTID,
00265     nsSOAPFaultConstructor, nsnull, nsnull, nsnull, 
00266     NS_CI_INTERFACE_GETTER_NAME(nsSOAPFault), 
00267     nsnull, &NS_CLASSINFO_NAME(nsSOAPFault), 
00268     nsIClassInfo::DOM_OBJECT },
00269   { "SOAP Header Block", NS_SOAPHEADERBLOCK_CID, NS_SOAPHEADERBLOCK_CONTRACTID,
00270     nsSOAPHeaderBlockConstructor, nsnull, nsnull, nsnull, 
00271     NS_CI_INTERFACE_GETTER_NAME(nsSOAPHeaderBlock), 
00272     nsnull, &NS_CLASSINFO_NAME(nsSOAPHeaderBlock), 
00273     nsIClassInfo::DOM_OBJECT },
00274   { "SOAP Parameter", NS_SOAPPARAMETER_CID, NS_SOAPPARAMETER_CONTRACTID,
00275     nsSOAPParameterConstructor, nsnull, nsnull, nsnull, 
00276     NS_CI_INTERFACE_GETTER_NAME(nsSOAPParameter), 
00277     nsnull, &NS_CLASSINFO_NAME(nsSOAPParameter), 
00278     nsIClassInfo::DOM_OBJECT },
00279   { "Default SOAP 1.1 Encoding", NS_DEFAULTSOAPENCODING_1_1_CID,
00280     NS_DEFAULTSOAPENCODING_1_1_CONTRACTID, 
00281     nsDefaultSOAPEncoding_1_1Constructor },
00282   { "Default SOAP 1.2 Encoding", NS_DEFAULTSOAPENCODING_1_2_CID,
00283     NS_DEFAULTSOAPENCODING_1_2_CONTRACTID, 
00284     nsDefaultSOAPEncoding_1_2Constructor },
00285   { "HTTP SOAP Transport", NS_HTTPSOAPTRANSPORT_CID,
00286     NS_HTTPSOAPTRANSPORT_CONTRACTID, 
00287     nsHTTPSOAPTransportConstructor, nsnull, nsnull, nsnull,
00288     NS_CI_INTERFACE_GETTER_NAME(nsHTTPSOAPTransport), 
00289     nsnull, &NS_CLASSINFO_NAME(nsHTTPSOAPTransport), 
00290     nsIClassInfo::DOM_OBJECT },
00291   { "HTTP SOAP Transport Completion", NS_HTTPSOAPTRANSPORTCOMPLETION_CID,
00292     NS_HTTPSOAPTRANSPORTCOMPLETION_CONTRACTID, 
00293     nsnull, nsnull, nsnull, nsnull, 
00294     NS_CI_INTERFACE_GETTER_NAME(nsHTTPSOAPTransportCompletion), 
00295     nsnull, &NS_CLASSINFO_NAME(nsHTTPSOAPTransportCompletion), 
00296     nsIClassInfo::DOM_OBJECT },
00297   { "HTTPS SOAP Transport", NS_HTTPSSOAPTRANSPORT_CID,
00298     NS_HTTPSSOAPTRANSPORT_CONTRACTID, 
00299     nsHTTPSSOAPTransportConstructor, nsnull, nsnull, nsnull,
00300     NS_CI_INTERFACE_GETTER_NAME(nsHTTPSSOAPTransport), 
00301     nsnull, &NS_CLASSINFO_NAME(nsHTTPSSOAPTransport), 
00302     nsIClassInfo::DOM_OBJECT },
00303   { "SOAP Property Bag Mutator", NS_SOAPPROPERTYBAGMUTATOR_CID,
00304     NS_SOAPPROPERTYBAGMUTATOR_CONTRACTID, 
00305     nsSOAPPropertyBagMutatorConstructor, nsnull, nsnull, nsnull,
00306     NS_CI_INTERFACE_GETTER_NAME(nsSOAPPropertyBagMutator), 
00307     nsnull, &NS_CLASSINFO_NAME(nsSOAPPropertyBagMutator), 
00308     nsIClassInfo::DOM_OBJECT },
00309   { "SOAP Property", NS_SOAPPROPERTY_CID,
00310     NS_SOAPPROPERTY_CONTRACTID, 
00311     nsnull, nsnull, nsnull, nsnull, 
00312     NS_CI_INTERFACE_GETTER_NAME(nsSOAPProperty), 
00313     nsnull, &NS_CLASSINFO_NAME(nsSOAPProperty), 
00314     nsIClassInfo::DOM_OBJECT },
00315   { "SOAP Property Bag", NS_SOAPPROPERTYBAG_CID,
00316     NS_SOAPPROPERTYBAG_CONTRACTID, 
00317     nsnull, nsnull, nsnull, nsnull, 
00318     NS_CI_INTERFACE_GETTER_NAME(nsSOAPPropertyBag), 
00319     nsnull, &NS_CLASSINFO_NAME(nsSOAPPropertyBag), 
00320     nsIClassInfo::DOM_OBJECT },
00321   { "SOAP Property Bag Enumerator", NS_SOAPPROPERTYBAGENUMERATOR_CID,
00322     NS_SOAPPROPERTYBAGENUMERATOR_CONTRACTID, 
00323     nsnull, nsnull, nsnull, nsnull, 
00324     NS_CI_INTERFACE_GETTER_NAME(nsSOAPPropertyBagEnumerator), 
00325     nsnull, &NS_CLASSINFO_NAME(nsSOAPPropertyBagEnumerator), 
00326     nsIClassInfo::DOM_OBJECT },
00327   { "SOAP Exception", NS_SOAPEXCEPTION_CLASSID, 
00328     NS_SOAPEXCEPTION_CONTRACTID, 
00329     nsnull, nsnull, nsnull, nsnull, 
00330     NS_CI_INTERFACE_GETTER_NAME(nsSOAPException), nsnull, 
00331     &NS_CLASSINFO_NAME(nsSOAPException), nsIClassInfo::DOM_OBJECT },
00332   { "SchemaLoader", NS_SCHEMALOADER_CID, NS_SCHEMALOADER_CONTRACTID,
00333     nsSchemaLoaderConstructor, nsnull, nsnull, nsnull, 
00334     NS_CI_INTERFACE_GETTER_NAME(nsSchemaLoader), nsnull,
00335     &NS_CLASSINFO_NAME(nsSchemaLoader), nsIClassInfo::DOM_OBJECT },
00336   { "Schema", NS_SCHEMA_CID, NS_SCHEMA_CONTRACTID, nsnull, nsnull, 
00337     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchema), nsnull, 
00338     &NS_CLASSINFO_NAME(nsSchema), nsIClassInfo::DOM_OBJECT },
00339   { "SchemaBuiltinType", NS_SCHEMABUILTINTYPE_CID, 
00340     NS_SCHEMABUILTINTYPE_CONTRACTID, nsnull, nsnull, nsnull, nsnull, 
00341     NS_CI_INTERFACE_GETTER_NAME(nsSchemaBuiltinType), nsnull, 
00342     &NS_CLASSINFO_NAME(nsSchemaBuiltinType), nsIClassInfo::DOM_OBJECT },
00343   { "SchemaListType", NS_SCHEMALISTTYPE_CID, NS_SCHEMALISTTYPE_CONTRACTID, 
00344     nsnull, nsnull, nsnull, nsnull, 
00345     NS_CI_INTERFACE_GETTER_NAME(nsSchemaListType), nsnull, 
00346     &NS_CLASSINFO_NAME(nsSchemaListType), nsIClassInfo::DOM_OBJECT },
00347   { "SchemaUnionType", NS_SCHEMAUNIONTYPE_CID, NS_SCHEMAUNIONTYPE_CONTRACTID, 
00348     nsnull, nsnull, nsnull, nsnull, 
00349     NS_CI_INTERFACE_GETTER_NAME(nsSchemaUnionType), nsnull, 
00350     &NS_CLASSINFO_NAME(nsSchemaUnionType), nsIClassInfo::DOM_OBJECT },
00351   { "SchemaRestrictionType", NS_SCHEMARESTRICTIONTYPE_CID, 
00352     NS_SCHEMARESTRICTIONTYPE_CONTRACTID, nsnull, nsnull, 
00353     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaRestrictionType), 
00354     nsnull, &NS_CLASSINFO_NAME(nsSchemaRestrictionType), 
00355     nsIClassInfo::DOM_OBJECT },
00356   { "SchemaComplexType", NS_SCHEMACOMPLEXTYPE_CID, 
00357     NS_SCHEMACOMPLEXTYPE_CONTRACTID, nsnull, nsnull, 
00358     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaComplexType), 
00359     nsnull, &NS_CLASSINFO_NAME(nsSchemaComplexType), 
00360     nsIClassInfo::DOM_OBJECT },
00361   { "SchemaTypePlaceholder", NS_SCHEMATYPEPLACEHOLDER_CID, 
00362     NS_SCHEMATYPEPLACEHOLDER_CONTRACTID, nsnull, nsnull, 
00363     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaTypePlaceholder), 
00364     nsnull, &NS_CLASSINFO_NAME(nsSchemaTypePlaceholder), 
00365     nsIClassInfo::DOM_OBJECT },
00366   { "SchemaModelGroup", NS_SCHEMAMODELGROUP_CID, 
00367     NS_SCHEMAMODELGROUP_CONTRACTID, nsnull, nsnull, 
00368     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaModelGroup), nsnull, 
00369     &NS_CLASSINFO_NAME(nsSchemaModelGroup), nsIClassInfo::DOM_OBJECT },
00370   { "SchemaModelGroupRef", NS_SCHEMAMODELGROUPREF_CID, 
00371     NS_SCHEMAMODELGROUPREF_CONTRACTID, nsnull, nsnull, 
00372     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaModelGroupRef), 
00373     nsnull, &NS_CLASSINFO_NAME(nsSchemaModelGroupRef), 
00374     nsIClassInfo::DOM_OBJECT },
00375   { "SchemaAnyParticle", NS_SCHEMAANYPARTICLE_CID, 
00376     NS_SCHEMAANYPARTICLE_CONTRACTID, nsnull, nsnull, 
00377     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaAnyParticle), 
00378     nsnull, &NS_CLASSINFO_NAME(nsSchemaAnyParticle), 
00379     nsIClassInfo::DOM_OBJECT },
00380   { "SchemaElement", NS_SCHEMAELEMENT_CID, NS_SCHEMAELEMENT_CONTRACTID, 
00381     nsnull, nsnull, nsnull, nsnull, 
00382     NS_CI_INTERFACE_GETTER_NAME(nsSchemaElement), nsnull, 
00383     &NS_CLASSINFO_NAME(nsSchemaElement), 
00384     nsIClassInfo::DOM_OBJECT },
00385   { "SchemaElementRef", NS_SCHEMAELEMENTREF_CID, 
00386     NS_SCHEMAELEMENTREF_CONTRACTID, nsnull, nsnull, 
00387     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaElementRef), nsnull, 
00388     &NS_CLASSINFO_NAME(nsSchemaElementRef), nsIClassInfo::DOM_OBJECT },
00389   { "SchemaAttribute", NS_SCHEMAATTRIBUTE_CID, NS_SCHEMAATTRIBUTE_CONTRACTID, 
00390     nsnull, nsnull, nsnull, nsnull, 
00391     NS_CI_INTERFACE_GETTER_NAME(nsSchemaAttribute), nsnull, 
00392     &NS_CLASSINFO_NAME(nsSchemaAttribute), nsIClassInfo::DOM_OBJECT },
00393   { "SchemaAttributeRef", NS_SCHEMAATTRIBUTEREF_CID, 
00394     NS_SCHEMAATTRIBUTEREF_CONTRACTID, nsnull, nsnull, 
00395     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaAttributeRef), 
00396     nsnull, &NS_CLASSINFO_NAME(nsSchemaAttributeRef), 
00397     nsIClassInfo::DOM_OBJECT },
00398   { "SchemaAttributeGroup", NS_SCHEMAATTRIBUTEGROUP_CID, 
00399     NS_SCHEMAATTRIBUTEGROUP_CONTRACTID, nsnull, nsnull, 
00400     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaAttributeGroup), 
00401     nsnull, &NS_CLASSINFO_NAME(nsSchemaAttributeGroup), 
00402     nsIClassInfo::DOM_OBJECT },
00403   { "SchemaAttributeGroupRef", NS_SCHEMAATTRIBUTEGROUPREF_CID, 
00404     NS_SCHEMAATTRIBUTEGROUPREF_CONTRACTID, nsnull, nsnull, 
00405     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaAttributeGroupRef), 
00406     nsnull, &NS_CLASSINFO_NAME(nsSchemaAttributeGroupRef), 
00407     nsIClassInfo::DOM_OBJECT },
00408   { "SchemaAnyAttribute", NS_SCHEMAANYATTRIBUTE_CID, 
00409     NS_SCHEMAANYATTRIBUTE_CONTRACTID, nsnull, nsnull, 
00410     nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaAnyAttribute), 
00411     nsnull, &NS_CLASSINFO_NAME(nsSchemaAnyAttribute), 
00412     nsIClassInfo::DOM_OBJECT },
00413   { "SchemaFacet", NS_SCHEMAFACET_CID, NS_SCHEMAFACET_CONTRACTID, 
00414     nsnull, nsnull, nsnull, nsnull, 
00415     NS_CI_INTERFACE_GETTER_NAME(nsSchemaFacet), nsnull, 
00416     &NS_CLASSINFO_NAME(nsSchemaFacet), nsIClassInfo::DOM_OBJECT },
00417   { "SOAPArray", NS_SOAPARRAY_CID, NS_SOAPARRAY_CONTRACTID, 
00418     nsnull, nsnull, nsnull, nsnull, 
00419     NS_CI_INTERFACE_GETTER_NAME(nsSOAPArray), nsnull, 
00420     &NS_CLASSINFO_NAME(nsSOAPArray), nsIClassInfo::DOM_OBJECT },
00421   { "SOAPArrayType", NS_SOAPARRAYTYPE_CID, NS_SOAPARRAYTYPE_CONTRACTID, 
00422     nsnull, nsnull, nsnull, nsnull, 
00423     NS_CI_INTERFACE_GETTER_NAME(nsSOAPArrayType), nsnull, 
00424     &NS_CLASSINFO_NAME(nsSOAPArrayType), nsIClassInfo::DOM_OBJECT },
00425   { "Builtin Schema Collection", NS_BUILTINSCHEMACOLLECTION_CID,
00426     NS_BUILTINSCHEMACOLLECTION_CONTRACTID, 
00427     nsBuiltinSchemaCollectionConstructor },
00428   { "WSDLLoader", NS_WSDLLOADER_CID, NS_WSDLLOADER_CONTRACTID,
00429     nsWSDLLoaderConstructor, nsnull, nsnull, nsnull, 
00430     NS_CI_INTERFACE_GETTER_NAME(nsWSDLLoader), nsnull,
00431     &NS_CLASSINFO_NAME(nsWSDLLoader), nsIClassInfo::DOM_OBJECT },
00432   { "WSDLPort", NS_WSDLPORT_CID, NS_WSDLPORT_CONTRACTID, 
00433     nsnull, nsnull, nsnull, nsnull, 
00434     NS_CI_INTERFACE_GETTER_NAME(nsWSDLPort), nsnull, 
00435     &NS_CLASSINFO_NAME(nsWSDLPort), nsIClassInfo::DOM_OBJECT },
00436   { "WSDLOperation", NS_WSDLOPERATION_CID, NS_WSDLOPERATION_CONTRACTID, 
00437     nsnull, nsnull, nsnull, nsnull, 
00438     NS_CI_INTERFACE_GETTER_NAME(nsWSDLOperation), nsnull, 
00439     &NS_CLASSINFO_NAME(nsWSDLOperation), nsIClassInfo::DOM_OBJECT },
00440   { "WSDLMessage", NS_WSDLMESSAGE_CID, NS_WSDLMESSAGE_CONTRACTID, 
00441     nsnull, nsnull, nsnull, nsnull, 
00442     NS_CI_INTERFACE_GETTER_NAME(nsWSDLMessage), nsnull, 
00443     &NS_CLASSINFO_NAME(nsWSDLMessage), nsIClassInfo::DOM_OBJECT },
00444   { "WSDLPart", NS_WSDLPART_CID, NS_WSDLPART_CONTRACTID, 
00445     nsnull, nsnull, nsnull, nsnull, 
00446     NS_CI_INTERFACE_GETTER_NAME(nsWSDLPart), nsnull, 
00447     &NS_CLASSINFO_NAME(nsWSDLPart), nsIClassInfo::DOM_OBJECT },
00448   { "SOAPPortBinding", NS_SOAPPORTBINDING_CID, NS_SOAPPORTBINDING_CONTRACTID, 
00449     nsnull, nsnull, nsnull, nsnull, 
00450     NS_CI_INTERFACE_GETTER_NAME(nsSOAPPortBinding), nsnull, 
00451     &NS_CLASSINFO_NAME(nsSOAPPortBinding), nsIClassInfo::DOM_OBJECT },
00452   { "SOAPOperationBinding", NS_SOAPOPERATIONBINDING_CID, 
00453     NS_SOAPOPERATIONBINDING_CONTRACTID, nsnull, nsnull, nsnull, nsnull, 
00454     NS_CI_INTERFACE_GETTER_NAME(nsSOAPOperationBinding), nsnull, 
00455     &NS_CLASSINFO_NAME(nsSOAPOperationBinding), nsIClassInfo::DOM_OBJECT },
00456   { "SOAPMessageBinding", NS_SOAPMESSAGEBINDING_CID, 
00457     NS_SOAPMESSAGEBINDING_CONTRACTID, nsnull, nsnull, nsnull, nsnull, 
00458     NS_CI_INTERFACE_GETTER_NAME(nsSOAPMessageBinding), nsnull, 
00459     &NS_CLASSINFO_NAME(nsSOAPMessageBinding), nsIClassInfo::DOM_OBJECT },
00460   { "SOAPPartBinding", NS_SOAPPARTBINDING_CID, NS_SOAPPARTBINDING_CONTRACTID, 
00461     nsnull, nsnull, nsnull, nsnull, 
00462     NS_CI_INTERFACE_GETTER_NAME(nsSOAPPartBinding), nsnull, 
00463     &NS_CLASSINFO_NAME(nsSOAPPartBinding), nsIClassInfo::DOM_OBJECT },
00464   { "WebServiceProxy", NS_WEBSERVICEPROXY_CLASSID, 
00465     NS_WEBSERVICEPROXY_CONTRACTID, WSPProxy::Create },
00466   { "WebServiceComplexTypeWrapper", NS_WEBSERVICECOMPLEXTYPEWRAPPER_CLASSID,
00467     NS_WEBSERVICECOMPLEXTYPEWRAPPER_CONTRACTID, 
00468     WSPComplexTypeWrapper::Create, nsnull, nsnull, nsnull,
00469     NS_CI_INTERFACE_GETTER_NAME(WSPComplexTypeWrapper), nsnull, 
00470     &NS_CLASSINFO_NAME(WSPComplexTypeWrapper), nsIClassInfo::DOM_OBJECT },
00471   { "WebServicePropertyBagWrapper", NS_WEBSERVICEPROPERTYBAGWRAPPER_CLASSID, 
00472     NS_WEBSERVICEPROPERTYBAGWRAPPER_CONTRACTID, 
00473     WSPPropertyBagWrapper::Create }, 
00474   { "WebServiceCallContext", NS_WEBSERVICECALLCONTEXT_CLASSID, 
00475     NS_WEBSERVICECALLCONTEXT_CONTRACTID, nsnull, nsnull, nsnull, nsnull, 
00476     NS_CI_INTERFACE_GETTER_NAME(WSPCallContext), nsnull, 
00477     &NS_CLASSINFO_NAME(WSPCallContext), nsIClassInfo::DOM_OBJECT },
00478   { "WebServiceException", NS_WEBSERVICEEXCEPTION_CLASSID, 
00479     NS_WEBSERVICEEXCEPTION_CONTRACTID, 
00480     nsnull, nsnull, nsnull, nsnull, 
00481     NS_CI_INTERFACE_GETTER_NAME(WSPException), nsnull, 
00482     &NS_CLASSINFO_NAME(WSPException), nsIClassInfo::DOM_OBJECT },
00483   { "nsWSPInterfaceInfoService", NS_WSP_INTERFACE_INFO_SERVICE_CID, 
00484     NS_WSP_INTERFACEINFOSERVICE_CONTRACTID,
00485     nsWSPInterfaceInfoServiceConstructor},
00486   { "WSPFactory", NS_WEBSERVICEPROXYFACTORY_CLASSID, 
00487     NS_WEBSERVICEPROXYFACTORY_CONTRACTID, WSPFactoryConstructor, 
00488     nsnull, nsnull, nsnull, 
00489     NS_CI_INTERFACE_GETTER_NAME(WSPFactory), nsnull, 
00490     &NS_CLASSINFO_NAME(WSPFactory), nsIClassInfo::DOM_OBJECT },
00491   { "InterfaceInfo", 
00492     NS_GENERIC_INTERFACE_INFO_SET_CID, 
00493     NS_GENERIC_INTERFACE_INFO_SET_CONTRACTID, 
00494     nsGenericInterfaceInfoSetConstructor
00495   },
00496   { "ScriptableInterfaceInfo", 
00497     NS_SCRIPTABLE_INTERFACE_INFO_CID, 
00498     NS_SCRIPTABLE_INTERFACE_INFO_CONTRACTID, 
00499     nsScriptableInterfaceInfoConstructor
00500   },
00501   { "WebScriptsAccess",
00502     NS_WEBSCRIPTSACCESSSERVICE_CID,
00503     NS_WEBSCRIPTSACCESSSERVICE_CONTRACTID,
00504     nsWebScriptsAccessConstructor
00505   }
00506 };
00507 
00508 nsSOAPStrings *gSOAPStrings;
00509 
00510 PR_STATIC_CALLBACK(nsresult)
00511 nsWebServicesModuleConstructor(nsIModule* self)
00512 {
00513   NS_ASSERTION(gSOAPStrings == nsnull, "already initialized");
00514   gSOAPStrings = new nsSOAPStrings();
00515   if (!gSOAPStrings)
00516     return NS_ERROR_OUT_OF_MEMORY;
00517 
00518   nsresult rv = nsWSDLAtoms::AddRefAtoms();
00519   NS_ENSURE_SUCCESS(rv, rv);
00520 
00521   return nsSchemaAtoms::AddRefAtoms();
00522 }
00523 
00524 PR_STATIC_CALLBACK(void)
00525 nsWebServicesModuleDestructor(nsIModule* self)
00526 {
00527   delete gSOAPStrings;
00528   gSOAPStrings = nsnull;
00529 }
00530 
00531 NS_IMPL_NSGETMODULE_WITH_CTOR_DTOR(nsWebServicesModule, gComponents, 
00532                                    nsWebServicesModuleConstructor,
00533                                    nsWebServicesModuleDestructor)
00534