diff --git a/mozilla/extensions/webservices/public/nsIWSDLLoader.idl b/mozilla/extensions/webservices/public/nsIWSDLLoader.idl index 32af9bbd4c6..355a7da226a 100644 --- a/mozilla/extensions/webservices/public/nsIWSDLLoader.idl +++ b/mozilla/extensions/webservices/public/nsIWSDLLoader.idl @@ -36,7 +36,8 @@ interface nsIWSDLLoader : nsISupports { void loadAsync(in AString wsdlURI, in AString portName, in nsIWSDLLoadListener listener); nsISupports createPortProxy(in nsIWSDLPort service, - in AString nameSpace); + in AString nameSpace, + in boolean sync); }; [scriptable, function, uuid(0458dac6-65de-11d5-9b42-00104bdf5339)] diff --git a/mozilla/extensions/webservices/schema/src/Makefile.in b/mozilla/extensions/webservices/schema/src/Makefile.in index 28323da18e5..934a9f8bb77 100644 --- a/mozilla/extensions/webservices/schema/src/Makefile.in +++ b/mozilla/extensions/webservices/schema/src/Makefile.in @@ -28,13 +28,18 @@ include $(DEPTH)/config/autoconf.mk MODULE = xmlextras LIBRARY_NAME = xmlextrasschema_s -REQUIRES = xpcom \ - string \ - dom \ - caps \ - necko \ - xpconnect \ - $(NULL) + +REQUIRES = xpcom \ + string \ + dom \ + xpconnect \ + caps \ + layout \ + widget \ + content \ + js \ + necko \ + $(NULL) CPPSRCS = \ nsSchema.cpp \ diff --git a/mozilla/extensions/webservices/wsdl/src/Makefile.in b/mozilla/extensions/webservices/wsdl/src/Makefile.in index bdc1ec5afcd..13ce00959ec 100644 --- a/mozilla/extensions/webservices/wsdl/src/Makefile.in +++ b/mozilla/extensions/webservices/wsdl/src/Makefile.in @@ -28,13 +28,17 @@ include $(DEPTH)/config/autoconf.mk MODULE = xmlextras LIBRARY_NAME = xmlextraswsdl_s -REQUIRES = xpcom \ - string \ - dom \ - caps \ - necko \ - xpconnect \ - $(NULL) +REQUIRES = xpcom \ + string \ + dom \ + xpconnect \ + caps \ + layout \ + widget \ + content \ + js \ + necko \ + $(NULL) CPPSRCS = \ nsWSDLLoader.cpp \ diff --git a/mozilla/extensions/webservices/wsdl/src/nsWSDLLoader.cpp b/mozilla/extensions/webservices/wsdl/src/nsWSDLLoader.cpp index 013be15be4b..aecb646399a 100644 --- a/mozilla/extensions/webservices/wsdl/src/nsWSDLLoader.cpp +++ b/mozilla/extensions/webservices/wsdl/src/nsWSDLLoader.cpp @@ -257,7 +257,8 @@ nsWSDLLoader::LoadAsync(const nsAReadableString& wsdlURI, /* nsISupports createPortProxy(in nsIWSDLPort service, in AString nameSpace); */ NS_IMETHODIMP nsWSDLLoader::CreatePortProxy(nsIWSDLPort *port, - const nsAReadableString& nameSpace, + const nsAReadableString& nameSpace, + PRBool sync, nsISupports **_retval) { return NS_ERROR_NOT_IMPLEMENTED; diff --git a/mozilla/extensions/webservices/wsdl/src/nsWSDLPrivate.h b/mozilla/extensions/webservices/wsdl/src/nsWSDLPrivate.h index d714715bbaf..637c78c5f76 100644 --- a/mozilla/extensions/webservices/wsdl/src/nsWSDLPrivate.h +++ b/mozilla/extensions/webservices/wsdl/src/nsWSDLPrivate.h @@ -38,6 +38,14 @@ #include "nsVoidArray.h" #include "nsSupportsArray.h" #include "nsString.h" +#include "nsWeakReference.h" + +// Typelib includes +#include "nsIInterfaceInfo.h" +#include "nsIInterfaceInfoManager.h" +#include "xpt_struct.h" +#include "xptcall.h" + #define NS_WSDL_SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema" #define NS_WSDL_NAMESPACE "http://schemas.xmlsoap.org/wsdl/" @@ -184,6 +192,83 @@ protected: nsCOMPtr mBinding; }; +#define NS_WSDLINTERFACEINFOID_ISUPPORTS 0 +// The boundary number should be incremented as reserved +// ids are added. +#define NS_WSDLINTERFACEINFOID_RESERVED_BOUNDARY 1 + +class nsWSDLInterfaceSet : public nsIInterfaceInfoManager, + public nsSupportsWeakReference +{ +public: + nsWSDLInterfaceSet(); + virtual ~nsWSDLInterfaceSet(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIINTERFACEINFOMANAGER + + nsresult AppendInterface(nsIInterfaceInfo* aInfo, PRUint16* aIndex); + nsresult GetInterfaceAt(PRUint16 aIndex, nsIInterfaceInfo** aInfo); + PRUint16 Count(); + XPTArena* GetArena() { return mArena; } + +private: + nsSupportsArray mInterfaces; + XPTArena* mArena; +}; + +class nsWSDLInterfaceInfo : public nsIInterfaceInfo, + public nsSupportsWeakReference +{ +public: + nsWSDLInterfaceInfo(nsAReadableCString& aName, + const nsIID& aIID, + nsWSDLInterfaceSet* aInterfaceSet); + virtual ~nsWSDLInterfaceInfo(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIINTERFACEINFO + + void AddMethod(XPTMethodDescriptor* aMethod); + void AddAdditionalType(XPTTypeDescriptor* aType); + +private: + nsresult GetTypeInArray(const nsXPTParamInfo* param, + uint16 dimension, + const XPTTypeDescriptor** type); + +private: + nsCString mName; + nsIID mIID; + nsVoidArray mMethodDescriptors; + nsVoidArray mAdditionalTypes; + nsWSDLInterfaceSet* mInterfaceSet; +}; + +#if 0 +class nsWSDLServiceProxy : public nsXPTCStubBase, + public nsIWSDLServiceProxy, + public nsIClassInfo +{ +public: + nsWSDLServiceProxy(); + virtual ~nsWSDLServiceProxy(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIWSDLSERVICEPROXY + NS_DECL_NSICLASSINFO + + NS_IMETHOD GetInterfaceInfo(nsIInterfaceInfo** info); + NS_IMETHOD CallMethod(PRUint16 methodIndex, + const nsXPTMethodInfo* info, + nsXPTCMiniVariant* params); + +private: + nsWSDLInterfaceSet* mInterfaceSet; + nsCOMPtr mInterfaceInfo; + nsCOMPtr mPort; +}; +#endif #define NS_WSDLPORT_CID \ { /* c1dfb250-0c19-4339-8211-24eabc0103e5 */ \ diff --git a/mozilla/extensions/xmlextras/Makefile.in b/mozilla/extensions/xmlextras/Makefile.in index 7670420d023..c96deee6f47 100644 --- a/mozilla/extensions/xmlextras/Makefile.in +++ b/mozilla/extensions/xmlextras/Makefile.in @@ -32,8 +32,8 @@ ifdef MOZ_SOAP DIRS += soap endif -ifdef MOZ_SCHEMA -DIRS += schema +ifdef MOZ_WSDL +DIRS += schema wsdl endif DIRS += build diff --git a/mozilla/extensions/xmlextras/build/src/Makefile.in b/mozilla/extensions/xmlextras/build/src/Makefile.in index e8c3f656789..843a14af9c8 100644 --- a/mozilla/extensions/xmlextras/build/src/Makefile.in +++ b/mozilla/extensions/xmlextras/build/src/Makefile.in @@ -56,15 +56,16 @@ SHARED_LIBRARY_LIBS += $(DIST)/lib/libxmlextrassoap_s.$(LIB_SUFFIX) DEFINES = -DMOZ_SOAP endif -ifdef MOZ_SCHEMA -SHARED_LIBRARY_LIBS += $(DIST)/lib/libxmlextrasschema_s.$(LIB_SUFFIX) -DEFINES = -DMOZ_SCHEMA +ifdef MOZ_WSDL +SHARED_LIBRARY_LIBS += $(DIST)/lib/libxmlextrasschema_s.$(LIB_SUFFIX) $(DIST)/lib/libxmlextraswsdl_s.$(LIB_SUFFIX) +DEFINES = -DMOZ_SCHEMA -DMOZ_WSDL endif LOCAL_INCLUDES = \ -I$(srcdir)/../../base/src \ -I$(srcdir)/../../soap/src \ -I$(srcdir)/../../schema/src \ + -I$(srcdir)/../../wsdl/src $(NULL) EXTRA_DSO_LDOPTS = \ diff --git a/mozilla/extensions/xmlextras/build/src/makefile.win b/mozilla/extensions/xmlextras/build/src/makefile.win index d9c93d8f4b2..583a043a372 100644 --- a/mozilla/extensions/xmlextras/build/src/makefile.win +++ b/mozilla/extensions/xmlextras/build/src/makefile.win @@ -37,7 +37,7 @@ MODULE_NAME=nsXMLExtrasModule ################################################################################ ## library -LINCS=-I..\..\base\src -I..\..\soap\src -I..\..\schema\src +LINCS=-I..\..\base\src -I..\..\soap\src -I..\..\schema\src -I..\..\wsdl\src CPP_OBJS= \ .\$(OBJDIR)\nsXMLExtrasModule.obj \ @@ -48,8 +48,9 @@ SUB_LIBRARIES= \ !if defined(MOZ_SOAP) $(DIST)\lib\xmlextrassoap_s.lib \ !endif -!if defined(MOZ_SCHEMA) +!if defined(MOZ_WSDL) $(DIST)\lib\xmlextrasschema_s.lib \ + $(DIST)\lib\xmlextraswsdl_s.lib \ !endif $(NULL) @@ -62,8 +63,8 @@ LLIBS= \ !if defined(MOZ_SOAP) DEFINES = -DMOZ_SOAP !endif -!if defined(MOZ_SCHEMA) -DEFINES =$(DEFINES) -DMOZ_SCHEMA +!if defined(MOZ_WSDL) +DEFINES =$(DEFINES) -DMOZ_SCHEMA -DMOZ_WSDL !endif LCFLAGS = \ diff --git a/mozilla/extensions/xmlextras/build/src/nsXMLExtrasModule.cpp b/mozilla/extensions/xmlextras/build/src/nsXMLExtrasModule.cpp index 28f37a4ef85..8002516dc1e 100644 --- a/mozilla/extensions/xmlextras/build/src/nsXMLExtrasModule.cpp +++ b/mozilla/extensions/xmlextras/build/src/nsXMLExtrasModule.cpp @@ -57,9 +57,11 @@ #include "nsHTTPSOAPTransport.h" #endif -#ifdef MOZ_SCHEMA +#ifdef MOZ_WSDL #include "nsSchemaLoader.h" #include "nsSchemaPrivate.h" +#include "nsWSDLLoader.h" +#include "nsWSDLPrivate.h" #endif #include "nsString.h" @@ -82,7 +84,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultSOAPEncoder) NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTTPSOAPTransport) #endif -#ifdef MOZ_SCHEMA +#ifdef MOZ_WSDL NS_GENERIC_FACTORY_CONSTRUCTOR(nsSchemaLoader) NS_DECL_CLASSINFO(nsSchemaLoader) NS_DECL_CLASSINFO(nsSchema) @@ -103,6 +105,16 @@ NS_DECL_CLASSINFO(nsSchemaAttributeGroup) NS_DECL_CLASSINFO(nsSchemaAttributeGroupRef) NS_DECL_CLASSINFO(nsSchemaAnyAttribute) NS_DECL_CLASSINFO(nsSchemaFacet) + +NS_GENERIC_FACTORY_CONSTRUCTOR(nsWSDLLoader) +NS_DECL_CLASSINFO(nsWSDLLoader) +NS_DECL_CLASSINFO(nsWSDLPort) +NS_DECL_CLASSINFO(nsWSDLOperation) +NS_DECL_CLASSINFO(nsWSDLMessage) +NS_DECL_CLASSINFO(nsWSDLPart) +NS_DECL_CLASSINFO(nsSOAPPortBinding) +NS_DECL_CLASSINFO(nsSOAPOperationBinding) +NS_DECL_CLASSINFO(nsSOAPPartBinding) #endif class nsXMLExtrasNameset : public nsISupports @@ -216,12 +228,17 @@ RegisterXMLExtras(nsIComponentManager *aCompMgr, NS_ENSURE_SUCCESS(rv, rv); #endif -#ifdef MOZ_SCHEMA +#ifdef MOZ_WSDL rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY, "SchemaLoader", NS_SCHEMALOADER_CONTRACTID, PR_TRUE, PR_TRUE, getter_Copies(previous)); NS_ENSURE_SUCCESS(rv, rv); + rv = catman->AddCategoryEntry(JAVASCRIPT_GLOBAL_CONSTRUCTOR_CATEGORY, + "WSDLLoader", + NS_WSDLLOADER_CONTRACTID, + PR_TRUE, PR_TRUE, getter_Copies(previous)); + NS_ENSURE_SUCCESS(rv, rv); #endif return rv; @@ -251,7 +268,7 @@ static nsModuleComponentInfo components[] = { { "HTTP SOAP Transport", NS_HTTPSOAPTRANSPORT_CID, NS_HTTPSOAPTRANSPORT_CONTRACTID, nsHTTPSOAPTransportConstructor }, #endif -#ifdef MOZ_SCHEMA +#ifdef MOZ_WSDL { "SchemaLoader", NS_SCHEMALOADER_CID, NS_SCHEMALOADER_CONTRACTID, nsSchemaLoaderConstructor, nsnull, nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaLoader), nsnull, @@ -337,14 +354,47 @@ static nsModuleComponentInfo components[] = { nsnull, nsnull, nsnull, nsnull, NS_CI_INTERFACE_GETTER_NAME(nsSchemaFacet), nsnull, &NS_CLASSINFO_NAME(nsSchemaFacet), nsIClassInfo::DOM_OBJECT }, + { "WSDLLoader", NS_WSDLLOADER_CID, NS_WSDLLOADER_CONTRACTID, + nsWSDLLoaderConstructor, nsnull, nsnull, nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsWSDLLoader), nsnull, + &NS_CLASSINFO_NAME(nsWSDLLoader), nsIClassInfo::DOM_OBJECT }, + { "WSDLPort", NS_WSDLPORT_CID, NS_WSDLPORT_CONTRACTID, + nsnull, nsnull, nsnull, nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsWSDLPort), nsnull, + &NS_CLASSINFO_NAME(nsWSDLPort), nsIClassInfo::DOM_OBJECT }, + { "WSDLOperation", NS_WSDLOPERATION_CID, NS_WSDLOPERATION_CONTRACTID, + nsnull, nsnull, nsnull, nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsWSDLOperation), nsnull, + &NS_CLASSINFO_NAME(nsWSDLOperation), nsIClassInfo::DOM_OBJECT }, + { "WSDLMessage", NS_WSDLMESSAGE_CID, NS_WSDLMESSAGE_CONTRACTID, + nsnull, nsnull, nsnull, nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsWSDLMessage), nsnull, + &NS_CLASSINFO_NAME(nsWSDLMessage), nsIClassInfo::DOM_OBJECT }, + { "WSDLPart", NS_WSDLPART_CID, NS_WSDLPART_CONTRACTID, + nsnull, nsnull, nsnull, nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsWSDLPart), nsnull, + &NS_CLASSINFO_NAME(nsWSDLPart), nsIClassInfo::DOM_OBJECT }, + { "SOAPPortBinding", NS_SOAPPORTBINDING_CID, NS_SOAPPORTBINDING_CONTRACTID, + nsnull, nsnull, nsnull, nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsSOAPPortBinding), nsnull, + &NS_CLASSINFO_NAME(nsSOAPPortBinding), nsIClassInfo::DOM_OBJECT }, + { "SOAPOperationBinding", NS_SOAPOPERATIONBINDING_CID, + NS_SOAPOPERATIONBINDING_CONTRACTID, nsnull, nsnull, nsnull, nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsSOAPOperationBinding), nsnull, + &NS_CLASSINFO_NAME(nsSOAPOperationBinding), nsIClassInfo::DOM_OBJECT }, + { "SOAPPartBinding", NS_SOAPPARTBINDING_CID, NS_SOAPPARTBINDING_CONTRACTID, + nsnull, nsnull, nsnull, nsnull, + NS_CI_INTERFACE_GETTER_NAME(nsSOAPPartBinding), nsnull, + &NS_CLASSINFO_NAME(nsSOAPPartBinding), nsIClassInfo::DOM_OBJECT }, #endif }; void PR_CALLBACK XMLExtrasModuleDestructor(nsIModule* self) { -#ifdef MOZ_SCHEMA +#ifdef MOZ_WSDL nsSchemaAtoms::DestroySchemaAtoms(); + nsWSDLAtoms::DestroyWSDLAtoms(); #endif } diff --git a/mozilla/extensions/xmlextras/makefile.win b/mozilla/extensions/xmlextras/makefile.win index ce4e51465b9..0da73912673 100644 --- a/mozilla/extensions/xmlextras/makefile.win +++ b/mozilla/extensions/xmlextras/makefile.win @@ -26,8 +26,9 @@ DIRS= \ !if defined(MOZ_SOAP) soap \ !endif -!if defined(MOZ_SCHEMA) +!if defined(MOZ_WSDL) schema \ + wsdl \ !endif build \ !if !defined(DISABLE_TESTS) diff --git a/mozilla/extensions/xmlextras/schema/src/Makefile.in b/mozilla/extensions/xmlextras/schema/src/Makefile.in index 28323da18e5..934a9f8bb77 100644 --- a/mozilla/extensions/xmlextras/schema/src/Makefile.in +++ b/mozilla/extensions/xmlextras/schema/src/Makefile.in @@ -28,13 +28,18 @@ include $(DEPTH)/config/autoconf.mk MODULE = xmlextras LIBRARY_NAME = xmlextrasschema_s -REQUIRES = xpcom \ - string \ - dom \ - caps \ - necko \ - xpconnect \ - $(NULL) + +REQUIRES = xpcom \ + string \ + dom \ + xpconnect \ + caps \ + layout \ + widget \ + content \ + js \ + necko \ + $(NULL) CPPSRCS = \ nsSchema.cpp \ diff --git a/mozilla/extensions/xmlextras/schema/src/makefile.win b/mozilla/extensions/xmlextras/schema/src/makefile.win index 74a2a70bb81..2ceb745ca34 100644 --- a/mozilla/extensions/xmlextras/schema/src/makefile.win +++ b/mozilla/extensions/xmlextras/schema/src/makefile.win @@ -24,6 +24,18 @@ DEPTH=..\..\..\.. LIBRARY_NAME=xmlextrasschema_s MODULE=xmlextras +REQUIRES = xpcom \ + string \ + dom \ + xpconnect \ + caps \ + layout \ + widget \ + content \ + js \ + necko \ + $(NULL) + DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN CPPSRCS= \ diff --git a/mozilla/extensions/xmlextras/wsdl/public/nsIWSDLLoader.idl b/mozilla/extensions/xmlextras/wsdl/public/nsIWSDLLoader.idl index 32af9bbd4c6..355a7da226a 100644 --- a/mozilla/extensions/xmlextras/wsdl/public/nsIWSDLLoader.idl +++ b/mozilla/extensions/xmlextras/wsdl/public/nsIWSDLLoader.idl @@ -36,7 +36,8 @@ interface nsIWSDLLoader : nsISupports { void loadAsync(in AString wsdlURI, in AString portName, in nsIWSDLLoadListener listener); nsISupports createPortProxy(in nsIWSDLPort service, - in AString nameSpace); + in AString nameSpace, + in boolean sync); }; [scriptable, function, uuid(0458dac6-65de-11d5-9b42-00104bdf5339)] diff --git a/mozilla/extensions/xmlextras/wsdl/src/Makefile.in b/mozilla/extensions/xmlextras/wsdl/src/Makefile.in index bdc1ec5afcd..13ce00959ec 100644 --- a/mozilla/extensions/xmlextras/wsdl/src/Makefile.in +++ b/mozilla/extensions/xmlextras/wsdl/src/Makefile.in @@ -28,13 +28,17 @@ include $(DEPTH)/config/autoconf.mk MODULE = xmlextras LIBRARY_NAME = xmlextraswsdl_s -REQUIRES = xpcom \ - string \ - dom \ - caps \ - necko \ - xpconnect \ - $(NULL) +REQUIRES = xpcom \ + string \ + dom \ + xpconnect \ + caps \ + layout \ + widget \ + content \ + js \ + necko \ + $(NULL) CPPSRCS = \ nsWSDLLoader.cpp \ diff --git a/mozilla/extensions/xmlextras/wsdl/src/makefile.win b/mozilla/extensions/xmlextras/wsdl/src/makefile.win index af877e50001..e587cdf1c2a 100644 --- a/mozilla/extensions/xmlextras/wsdl/src/makefile.win +++ b/mozilla/extensions/xmlextras/wsdl/src/makefile.win @@ -26,14 +26,28 @@ MODULE=xmlextras DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN +REQUIRES = xpcom \ + string \ + dom \ + xpconnect \ + caps \ + layout \ + widget \ + content \ + js \ + necko \ + $(NULL) + CPPSRCS= \ nsWSDLLoader.cpp \ nsWSDLDefinitions.cpp \ + nsWSDLInterfaceInfo.cpp \ $(NULL) CPP_OBJS= \ .\$(OBJDIR)\nsWSDLLoader.obj \ .\$(OBJDIR)\nsWSDLDefinitions.obj \ + .\$(OBJDIR)\nsWSDLInterfaceInfo.obj \ $(NULL) EXPORTS = \ diff --git a/mozilla/extensions/xmlextras/wsdl/src/nsWSDLLoader.cpp b/mozilla/extensions/xmlextras/wsdl/src/nsWSDLLoader.cpp index 013be15be4b..aecb646399a 100644 --- a/mozilla/extensions/xmlextras/wsdl/src/nsWSDLLoader.cpp +++ b/mozilla/extensions/xmlextras/wsdl/src/nsWSDLLoader.cpp @@ -257,7 +257,8 @@ nsWSDLLoader::LoadAsync(const nsAReadableString& wsdlURI, /* nsISupports createPortProxy(in nsIWSDLPort service, in AString nameSpace); */ NS_IMETHODIMP nsWSDLLoader::CreatePortProxy(nsIWSDLPort *port, - const nsAReadableString& nameSpace, + const nsAReadableString& nameSpace, + PRBool sync, nsISupports **_retval) { return NS_ERROR_NOT_IMPLEMENTED; diff --git a/mozilla/extensions/xmlextras/wsdl/src/nsWSDLPrivate.h b/mozilla/extensions/xmlextras/wsdl/src/nsWSDLPrivate.h index d714715bbaf..637c78c5f76 100644 --- a/mozilla/extensions/xmlextras/wsdl/src/nsWSDLPrivate.h +++ b/mozilla/extensions/xmlextras/wsdl/src/nsWSDLPrivate.h @@ -38,6 +38,14 @@ #include "nsVoidArray.h" #include "nsSupportsArray.h" #include "nsString.h" +#include "nsWeakReference.h" + +// Typelib includes +#include "nsIInterfaceInfo.h" +#include "nsIInterfaceInfoManager.h" +#include "xpt_struct.h" +#include "xptcall.h" + #define NS_WSDL_SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema" #define NS_WSDL_NAMESPACE "http://schemas.xmlsoap.org/wsdl/" @@ -184,6 +192,83 @@ protected: nsCOMPtr mBinding; }; +#define NS_WSDLINTERFACEINFOID_ISUPPORTS 0 +// The boundary number should be incremented as reserved +// ids are added. +#define NS_WSDLINTERFACEINFOID_RESERVED_BOUNDARY 1 + +class nsWSDLInterfaceSet : public nsIInterfaceInfoManager, + public nsSupportsWeakReference +{ +public: + nsWSDLInterfaceSet(); + virtual ~nsWSDLInterfaceSet(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIINTERFACEINFOMANAGER + + nsresult AppendInterface(nsIInterfaceInfo* aInfo, PRUint16* aIndex); + nsresult GetInterfaceAt(PRUint16 aIndex, nsIInterfaceInfo** aInfo); + PRUint16 Count(); + XPTArena* GetArena() { return mArena; } + +private: + nsSupportsArray mInterfaces; + XPTArena* mArena; +}; + +class nsWSDLInterfaceInfo : public nsIInterfaceInfo, + public nsSupportsWeakReference +{ +public: + nsWSDLInterfaceInfo(nsAReadableCString& aName, + const nsIID& aIID, + nsWSDLInterfaceSet* aInterfaceSet); + virtual ~nsWSDLInterfaceInfo(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIINTERFACEINFO + + void AddMethod(XPTMethodDescriptor* aMethod); + void AddAdditionalType(XPTTypeDescriptor* aType); + +private: + nsresult GetTypeInArray(const nsXPTParamInfo* param, + uint16 dimension, + const XPTTypeDescriptor** type); + +private: + nsCString mName; + nsIID mIID; + nsVoidArray mMethodDescriptors; + nsVoidArray mAdditionalTypes; + nsWSDLInterfaceSet* mInterfaceSet; +}; + +#if 0 +class nsWSDLServiceProxy : public nsXPTCStubBase, + public nsIWSDLServiceProxy, + public nsIClassInfo +{ +public: + nsWSDLServiceProxy(); + virtual ~nsWSDLServiceProxy(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIWSDLSERVICEPROXY + NS_DECL_NSICLASSINFO + + NS_IMETHOD GetInterfaceInfo(nsIInterfaceInfo** info); + NS_IMETHOD CallMethod(PRUint16 methodIndex, + const nsXPTMethodInfo* info, + nsXPTCMiniVariant* params); + +private: + nsWSDLInterfaceSet* mInterfaceSet; + nsCOMPtr mInterfaceInfo; + nsCOMPtr mPort; +}; +#endif #define NS_WSDLPORT_CID \ { /* c1dfb250-0c19-4339-8211-24eabc0103e5 */ \