This commit is contained in:
jgaunt%netscape.com 2003-05-08 18:03:43 +00:00
Родитель 7c1c8b99ca
Коммит ca0d58c10e
6 изменённых файлов: 34 добавлений и 65 удалений

Просмотреть файл

@ -59,7 +59,7 @@
#include "nsWebScriptsAccess.h"
////////////////////////////////////////////////////////////////////////
// Define the constructor function for the objects
// Define the contructor function for the objects
//
// NOTE: This creates an instance of objects by using the default constructor
//
@ -73,8 +73,8 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPEncoding)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPFault)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPHeaderBlock)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPParameter)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultSOAPEncoding_1_1)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultSOAPEncoding_1_2)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultSOAPEncoder_1_1)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDefaultSOAPEncoder_1_2)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTTPSOAPTransport)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTTPSSOAPTransport)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsSOAPPropertyBagMutator)
@ -276,12 +276,12 @@ static const nsModuleComponentInfo gComponents[] = {
NS_CI_INTERFACE_GETTER_NAME(nsSOAPParameter),
nsnull, &NS_CLASSINFO_NAME(nsSOAPParameter),
nsIClassInfo::DOM_OBJECT },
{ "Default SOAP 1.1 Encoding", NS_DEFAULTSOAPENCODING_1_1_CID,
NS_DEFAULTSOAPENCODING_1_1_CONTRACTID,
nsDefaultSOAPEncoding_1_1Constructor },
{ "Default SOAP 1.2 Encoding", NS_DEFAULTSOAPENCODING_1_2_CID,
NS_DEFAULTSOAPENCODING_1_2_CONTRACTID,
nsDefaultSOAPEncoding_1_2Constructor },
{ "Default SOAP 1.1 Encoder", NS_DEFAULTSOAPENCODER_1_1_CID,
NS_DEFAULTSOAPENCODER_1_1_CONTRACTID,
nsDefaultSOAPEncoder_1_1Constructor },
{ "Default SOAP 1.2 Encoder", NS_DEFAULTSOAPENCODER_1_2_CID,
NS_DEFAULTSOAPENCODER_1_2_CONTRACTID,
nsDefaultSOAPEncoder_1_2Constructor },
{ "HTTP SOAP Transport", NS_HTTPSOAPTRANSPORT_CID,
NS_HTTPSOAPTRANSPORT_CONTRACTID,
nsHTTPSOAPTransportConstructor, nsnull, nsnull, nsnull,

Просмотреть файл

@ -128,12 +128,6 @@ static NS_NAMED_LITERAL_STRING(kNonNegativeIntegerSchemaType,
"nonNegativeInteger");
static NS_NAMED_LITERAL_STRING(kPositiveIntegerSchemaType, "positiveInteger");
#define MAX_ARRAY_DIMENSIONS 100
//
// Macros to declare and implement the default encoder classes
//
#define DECLARE_ENCODER(name) \
class ns##name##Encoder : \
public nsISOAPEncoder, \
@ -184,7 +178,6 @@ ns##name##Encoder::~ns##name##Encoder() {}
SetEncoder(encodingKey, handler); \
SetDecoder(encodingKey, handler); \
}
#define REGISTER_SCHEMA_ENCODER(name) REGISTER_ENCODER(name,Schema,nsSOAPUtils::kXSURI)
#define REGISTER_SOAP_ENCODER(name) REGISTER_ENCODER(name,SOAP,nsSOAPUtils::kSOAPEncURI)
@ -209,17 +202,11 @@ ns##name##Encoder::~ns##name##Encoder() {}
REGISTER_SCHEMA_ENCODER(UnsignedLong)\
REGISTER_SCHEMA_ENCODER(UnsignedInt)\
REGISTER_SCHEMA_ENCODER(UnsignedShort)\
REGISTER_SCHEMA_ENCODER(UnsignedByte)
REGISTER_SCHEMA_ENCODER(UnsignedByte)\
//
// Default SOAP Encodings
//
NS_IMPL_ADDREF(nsDefaultSOAPEncoding_1_1)
NS_IMPL_RELEASE(nsDefaultSOAPEncoding_1_1)
nsDefaultSOAPEncoding_1_1::nsDefaultSOAPEncoding_1_1()
: nsSOAPEncoding(nsSOAPUtils::kSOAPEncURI11, nsnull, nsnull)
nsDefaultSOAPEncoder_1_1::nsDefaultSOAPEncoder_1_1() : nsSOAPEncoding(nsSOAPUtils::kSOAPEncURI11,
nsnull,
nsnull)
{
PRUint16 version = nsISOAPMessage::VERSION_1_1;
PRBool result;
@ -229,11 +216,9 @@ nsDefaultSOAPEncoding_1_1::nsDefaultSOAPEncoding_1_1()
REGISTER_ENCODERS
}
NS_IMPL_ADDREF(nsDefaultSOAPEncoding_1_2)
NS_IMPL_RELEASE(nsDefaultSOAPEncoding_1_2)
nsDefaultSOAPEncoding_1_2::nsDefaultSOAPEncoding_1_2()
: nsSOAPEncoding(nsSOAPUtils::kSOAPEncURI, nsnull, nsnull)
nsDefaultSOAPEncoder_1_2::nsDefaultSOAPEncoder_1_2() : nsSOAPEncoding(nsSOAPUtils::kSOAPEncURI,
nsnull,
nsnull)
{
PRUint16 version = nsISOAPMessage::VERSION_1_2;
PRBool result;
@ -243,9 +228,7 @@ nsDefaultSOAPEncoding_1_2::nsDefaultSOAPEncoding_1_2()
REGISTER_ENCODERS
}
//
// Default Encoders -- static helper functions intermixed
//
// Here is the implementation of the encoders.
// Getting the immediate supertype of any type
static nsresult GetSupertype(nsISOAPEncoding * aEncoding, nsISchemaType* aType, nsISchemaType** _retval)
@ -1053,23 +1036,17 @@ NS_IMETHODIMP
return rc;
// We still have to fake this one, because there is no any simple type in schema.
if (aName.IsEmpty() && !aSchemaType) {
return EncodeSimpleValue(aEncoding,
value,
nsSOAPUtils::kSOAPEncURI,
kAnySimpleTypeSchemaType,
aSchemaType,
aDestination,
return EncodeSimpleValue(aEncoding, value,
nsSOAPUtils::kSOAPEncURI, kAnySimpleTypeSchemaType, aSchemaType, aDestination,
aReturnValue);
}
return EncodeSimpleValue(aEncoding,
value,
aNamespaceURI,
aName,
aSchemaType,
aDestination,
return EncodeSimpleValue(aEncoding, value,
aNamespaceURI, aName, aSchemaType, aDestination,
aReturnValue);
}
#define MAX_ARRAY_DIMENSIONS 100
/**
* Recursive method used by array encoding which counts the sizes of the specified dimensions
* and does a very primitive determination whether all the members of the array are of a single

Просмотреть файл

@ -36,29 +36,19 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsDefaultSOAPEncoding_h__
#define nsDefaultSOAPEncoding_h__
#ifndef nsDefaultSOAPEncoder_h__
#define nsDefaultSOAPEncoder_h__
#include "nsSOAPEncoding.h"
class nsDefaultSOAPEncoding_1_1:public nsSOAPEncoding {
class nsDefaultSOAPEncoder_1_1:public nsSOAPEncoding {
public:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
nsDefaultSOAPEncoding_1_1();
virtual ~nsDefaultSOAPEncoding_1_1() {}
nsDefaultSOAPEncoder_1_1();
};
class nsDefaultSOAPEncoding_1_2:public nsSOAPEncoding {
class nsDefaultSOAPEncoder_1_2:public nsSOAPEncoding {
public:
NS_IMETHOD_(nsrefcnt) AddRef(void);
NS_IMETHOD_(nsrefcnt) Release(void);
nsDefaultSOAPEncoding_1_2();
virtual ~nsDefaultSOAPEncoding_1_2() {}
nsDefaultSOAPEncoder_1_2();
};
#endif

Просмотреть файл

@ -177,7 +177,7 @@ nsSOAPEncoding::nsSOAPEncoding() : mEncoders(),
{
mStyleURI.Assign(nsSOAPUtils::kSOAPEncURI11);
mRegistry = new nsSOAPEncodingRegistry(this);
mDefaultEncoding = do_GetService(NS_DEFAULTSOAPENCODING_1_1_CONTRACTID);
mDefaultEncoding = do_GetService(NS_DEFAULTSOAPENCODER_1_1_CONTRACTID);
}
nsSOAPEncoding::nsSOAPEncoding(const nsAString & aStyleURI,

Просмотреть файл

@ -36,8 +36,8 @@
*
* ***** END LICENSE BLOCK ***** */
#ifndef nsSOAPEncoding_h__
#define nsSOAPEncoding_h__
#ifndef nsSOAPEncodingRegistry_h__
#define nsSOAPEncodingRegistry_h__
#include "nsString.h"
#include "nsIDOMElement.h"
@ -47,6 +47,7 @@
#include "nsCOMPtr.h"
#include "nsHashtable.h"
#include "nsISchema.h"
#include "nsWeakReference.h"
// Notes regarding the ownership model between the nsSOAPEncoding (encoding)
// and the nsSOAPEncodingRegsitry (registry). To avoid cyclic referencing

Просмотреть файл

@ -43,6 +43,7 @@
#include "nsSOAPMessage.h"
#include "nsSOAPParameter.h"
#include "nsSOAPHeaderBlock.h"
#include "nsSOAPEncoding.h"
#include "nsSOAPException.h"
#include "nsIDOMDocument.h"
#include "nsIDOMAttr.h"