Changes to use contractid's for construction wherever available. This means

that the JS binding will work correctly.  Also removed old security model.


SOAP is not a part of default build.
This commit is contained in:
rayw%netscape.com 2002-01-09 02:17:17 +00:00
parent cbd2fb8afd
commit 892ec82f97
35 changed files with 113 additions and 900 deletions

View File

@ -26,6 +26,7 @@ interface nsIDOMElement;
interface nsIVariant;
interface nsISOAPEncoding;
interface nsISchemaType;
interface nsISOAPAttachments;
/**
* This interface encapsulates an arbitrary block to be used
@ -49,6 +50,14 @@ interface nsISchemaType;
[scriptable, uuid(843afaa8-1dd2-11b2-8b0d-9b5d16fe64ea)]
interface nsISOAPBlock : nsISupports {
/**
* Initialize the block for additional decoding information.
*
* @param aAttachments Attachments in case this refers to them.
*
* @param aVersion SOAP version for decoding special header attributes.
*/
void init(in nsISOAPAttachments aAttachments, in unsigned short aVersion);
/**
* The namespace URI of the block. Ignored if name is null.

View File

@ -26,27 +26,31 @@
#include "nsSOAPUtils.h"
#include "nsIServiceManager.h"
#include "nsISOAPAttachments.h"
#include "nsISOAPMessage.h"
nsSOAPBlock::nsSOAPBlock()
{
NS_INIT_ISUPPORTS();
}
nsSOAPBlock::nsSOAPBlock(nsISOAPAttachments* aAttachments)
{
NS_INIT_ISUPPORTS();
mAttachments = aAttachments;
}
nsSOAPBlock::~nsSOAPBlock()
{
}
NS_IMPL_ISUPPORTS3(nsSOAPBlock,
NS_IMPL_ISUPPORTS2(nsSOAPBlock,
nsISOAPBlock,
nsISecurityCheckedComponent,
nsIJSNativeInitializer)
NS_IMETHODIMP nsSOAPBlock::Init(nsISOAPAttachments* aAttachments, PRUint16 aVersion) {
if (aVersion == nsISOAPMessage::VERSION_1_1
||aVersion == nsISOAPMessage::VERSION_1_2) {
mAttachments = aAttachments;
mVersion = aVersion;
return NS_OK;
}
return NS_ERROR_ILLEGAL_VALUE;
}
/* attribute AString namespaceURI; */
NS_IMETHODIMP nsSOAPBlock::GetNamespaceURI(nsAString & aNamespaceURI)
{
@ -201,49 +205,3 @@ nsSOAPBlock::Initialize(JSContext *cx, JSObject *obj,
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPBlock::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPBlock::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPBlock::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPBlock::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsIVariant.h"
#include "nsISOAPBlock.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIJSNativeInitializer.h"
#include "nsISOAPEncoding.h"
#include "nsISchema.h"
@ -35,12 +34,10 @@
#include "nsCOMPtr.h"
class nsSOAPBlock : public nsISOAPBlock,
public nsISecurityCheckedComponent,
public nsIJSNativeInitializer
{
public:
nsSOAPBlock();
nsSOAPBlock(nsISOAPAttachments* aAttachments);
virtual ~nsSOAPBlock();
NS_DECL_ISUPPORTS
@ -48,9 +45,6 @@ public:
// nsISOAPBlock
NS_DECL_NSISOAPBLOCK
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
// nsIJSNativeInitializer
NS_IMETHOD Initialize(JSContext *cx, JSObject *obj,
PRUint32 argc, jsval *argv);
@ -65,6 +59,7 @@ protected:
nsCOMPtr<nsIVariant> mValue;
nsresult mStatus;
PRBool mComputeValue;
PRBool mVersion;
};
#endif

View File

@ -105,9 +105,8 @@ NS_IMETHODIMP nsSOAPCall::Invoke(nsISOAPResponse **_retval)
rv = GetTransport(getter_AddRefs(transport));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsISOAPResponse> response;
response = new nsSOAPResponse();
if (!response) return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsISOAPResponse> response(do_CreateInstance(NS_SOAPRESPONSE_CONTRACTID, &rv));
if (NS_FAILED(rv)) return rv;
rv = response->SetEncoding(mEncoding);
if (NS_FAILED(rv)) return rv;
@ -138,58 +137,11 @@ NS_IMETHODIMP nsSOAPCall::AsyncInvoke(nsISOAPResponseListener *listener, nsISOAP
rv = GetTransport(getter_AddRefs(transport));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsISOAPResponse> response;
response = new nsSOAPResponse();
if (!response) return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsISOAPResponse> response(do_CreateInstance(NS_SOAPRESPONSE_CONTRACTID, &rv));
if (NS_FAILED(rv)) return rv;
rv = response->SetEncoding(mEncoding);
if (NS_FAILED(rv)) return rv;
rv = transport->AsyncCall(this, listener, response, aCompletion);
return rv;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPCall::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPCall))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPCall::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPCall))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPCall::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPCall))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPCall::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPCall))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsSOAPMessage.h"
#include "nsISOAPCall.h"
#include "nsISecurityCheckedComponent.h"
#include "nsISOAPTransport.h"
#include "nsISOAPResponseListener.h"
#include "nsCOMPtr.h"
@ -46,9 +45,6 @@ public:
// nsISOAPCall
NS_DECL_NSISOAPCALL
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
protected:
nsString mTransportURI;

View File

@ -69,8 +69,10 @@ nsresult nsSOAPEncodingRegistry::GetAssociatedEncoding(const nsAString& aStyleUR
encodingContractid.Append(NS_ConvertUCS2toUTF8(aStyleURI));
defaultEncoding = do_GetService(encodingContractid.get());
if (defaultEncoding || aCreateIf) {
*aEncoding = new nsSOAPEncoding(aStyleURI, this, defaultEncoding);
mEncodings->Put(&styleKey, *aEncoding);
nsCOMPtr<nsISOAPEncoding> encoding = do_CreateInstance(NS_SOAPENCODING_CONTRACTID);
*aEncoding = encoding;
NS_IF_ADDREF(*aEncoding);
mEncodings->Put(&styleKey, encoding);
}
}
return NS_OK;
@ -160,7 +162,7 @@ NS_IMETHODIMP nsSOAPEncodingRegistry::Decode(nsIDOMElement *aSource, nsISchemaTy
// Second, we create the encodings themselves.
NS_IMPL_ISUPPORTS2_CI(nsSOAPEncoding, nsISOAPEncoding, nsISecurityCheckedComponent)
NS_IMPL_ISUPPORTS1_CI(nsSOAPEncoding, nsISOAPEncoding)
nsSOAPEncoding::nsSOAPEncoding(): mEncoders(new nsSupportsHashtable),
mDecoders(new nsSupportsHashtable)
@ -354,49 +356,3 @@ NS_IMETHODIMP nsSOAPEncoding::SetDefaultDecoder(nsISOAPDecoder * aDefaultDecoder
mDefaultDecoder = aDefaultDecoder;
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPEncoding::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPEncoding))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPEncoding::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPEncoding))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPEncoding::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPEncoding))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPEncoding::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPEncoding))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -24,7 +24,6 @@
#define nsSOAPEncodingRegistry_h__
#include "nsString.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIDOMElement.h"
#include "nsISOAPEncoding.h"
#include "nsISOAPEncoder.h"
@ -49,17 +48,13 @@ protected:
nsCOMPtr<nsISchemaCollection> mSchemaCollection;
};
class nsSOAPEncoding : public nsISOAPEncoding,
public nsISecurityCheckedComponent
class nsSOAPEncoding : public nsISOAPEncoding
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISOAPENCODING
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
nsSOAPEncoding();
nsSOAPEncoding(PRUint16 aVersion);
nsSOAPEncoding(const nsAString& aStyleURI, nsSOAPEncodingRegistry * aRegistry, nsISOAPEncoding* aDefaultEncoding);

View File

@ -25,17 +25,16 @@
#include "nsIDOMNodeList.h"
#include "nsISOAPMessage.h"
nsSOAPFault::nsSOAPFault(nsIDOMElement* aElement)
nsSOAPFault::nsSOAPFault()
{
NS_INIT_ISUPPORTS();
mFaultElement = aElement;
}
nsSOAPFault::~nsSOAPFault()
{
}
NS_IMPL_ISUPPORTS2_CI(nsSOAPFault, nsISOAPFault, nsISecurityCheckedComponent)
NS_IMPL_ISUPPORTS1_CI(nsSOAPFault, nsISOAPFault)
/* attribute nsIDOMElement element; */
NS_IMETHODIMP nsSOAPFault::SetElement(nsIDOMElement *aElement)
@ -133,49 +132,3 @@ NS_IMETHODIMP nsSOAPFault::GetDetail(nsIDOMElement * *aDetail)
nsSOAPUtils::kFaultDetailTagName, aDetail);
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPFault::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPFault))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPFault::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPFault))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPFault::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPFault))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPFault::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPFault))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -25,15 +25,13 @@
#include "nsString.h"
#include "nsISOAPFault.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIDOMElement.h"
#include "nsCOMPtr.h"
class nsSOAPFault : public nsISOAPFault,
public nsISecurityCheckedComponent
class nsSOAPFault : public nsISOAPFault
{
public:
nsSOAPFault(nsIDOMElement* aElement);
nsSOAPFault();
virtual ~nsSOAPFault();
NS_DECL_ISUPPORTS
@ -41,9 +39,6 @@ public:
// nsISOAPFault
NS_DECL_NSISOAPFAULT
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
protected:
nsCOMPtr<nsIDOMElement> mFaultElement;
PRUint16 mVersion;

View File

@ -28,15 +28,11 @@
#include "nsISOAPAttachments.h"
#include "nsISOAPMessage.h"
nsSOAPHeaderBlock::nsSOAPHeaderBlock():mVersion(nsISOAPMessage::VERSION_UNKNOWN)
nsSOAPHeaderBlock::nsSOAPHeaderBlock()
{
NS_INIT_ISUPPORTS();
}
nsSOAPHeaderBlock::nsSOAPHeaderBlock(nsISOAPAttachments* aAttachments, PRUint16 aVersion): nsSOAPBlock(aAttachments), mVersion(aVersion)
{
}
NS_IMPL_CI_INTERFACE_GETTER2(nsSOAPHeaderBlock, nsISOAPBlock, nsISOAPHeaderBlock)
NS_IMPL_ADDREF_INHERITED(nsSOAPHeaderBlock, nsSOAPBlock)
NS_IMPL_RELEASE_INHERITED(nsSOAPHeaderBlock, nsSOAPBlock)
@ -98,49 +94,3 @@ NS_IMETHODIMP nsSOAPHeaderBlock::SetMustUnderstand(PRBool aMustUnderstand)
mMustUnderstand = aMustUnderstand;
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPHeaderBlock::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPHeaderBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPHeaderBlock::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPHeaderBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPHeaderBlock::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPHeaderBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPHeaderBlock::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPHeaderBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsIVariant.h"
#include "nsISOAPHeaderBlock.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIJSNativeInitializer.h"
#include "nsISOAPEncoding.h"
#include "nsISchema.h"
@ -40,7 +39,6 @@ class nsSOAPHeaderBlock : public nsSOAPBlock,
{
public:
nsSOAPHeaderBlock();
nsSOAPHeaderBlock(nsISOAPAttachments* aAttachments, PRUint16 aVersion);
virtual ~nsSOAPHeaderBlock();
NS_DECL_ISUPPORTS
@ -50,13 +48,9 @@ public:
// nsISOAPHeaderBlock
NS_DECL_NSISOAPHEADERBLOCK
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
protected:
nsString mActorURI;
PRBool mMustUnderstand;
PRBool mVersion;
};
#endif

View File

@ -49,9 +49,8 @@ nsSOAPMessage::~nsSOAPMessage()
{
}
NS_IMPL_ISUPPORTS2(nsSOAPMessage,
nsISOAPMessage,
nsISecurityCheckedComponent)
NS_IMPL_ISUPPORTS1(nsSOAPMessage,
nsISOAPMessage)
/* attribute nsIDOMDocument message; */
NS_IMETHODIMP nsSOAPMessage::GetMessage(nsIDOMDocument * *aMessage)
@ -498,8 +497,9 @@ NS_IMETHODIMP nsSOAPMessage::GetHeaderBlocks(PRUint32 *aCount, nsISOAPHeaderBloc
*aHeaderBlocks = (nsISOAPHeaderBlock* *)memory->Realloc(*aHeaderBlocks, length * sizeof(**aHeaderBlocks));
}
element = next;
header = new nsSOAPHeaderBlock(nsnull, version);// Header needs version to interpret actor, mustInclude
header = do_CreateInstance(NS_SOAPHEADERBLOCK_CONTRACTID);
if (!header) return NS_ERROR_OUT_OF_MEMORY;
header->Init(nsnull, version);
(*aHeaderBlocks)[(*aCount)] = header;
NS_ADDREF((*aHeaderBlocks)[(*aCount)]);
@ -546,7 +546,7 @@ NS_IMETHODIMP nsSOAPMessage::GetParameters(PRBool aDocumentStyle, PRUint32 *aCou
*aParameters = (nsISOAPParameter* *)memory->Realloc(*aParameters, length * sizeof(**aParameters));
}
element = next;
param = new nsSOAPParameter();
param = do_CreateInstance(NS_SOAPPARAMETER_CONTRACTID);
if (!param) return NS_ERROR_OUT_OF_MEMORY;
(*aParameters)[(*aCount)] = param;
@ -574,9 +574,11 @@ NS_IMETHODIMP nsSOAPMessage::GetEncoding(nsISOAPEncoding* * aEncoding)
nsresult rc = GetVersion(&version);
if (NS_FAILED(rc)) return rc;
if (version != nsISOAPMessage::VERSION_UNKNOWN) {
mEncoding = new nsSOAPEncoding(version);
if (!mEncoding)
nsCOMPtr<nsISOAPEncoding> encoding = do_CreateInstance(NS_SOAPENCODING_CONTRACTID);
if (!encoding)
return NS_ERROR_OUT_OF_MEMORY;
rc = encoding->GetAssociatedEncoding(*nsSOAPUtils::kSOAPEncURI[version], PR_FALSE, getter_AddRefs(mEncoding));
if (NS_FAILED(rc)) return rc;
}
}
*aEncoding = mEncoding;
@ -588,49 +590,3 @@ NS_IMETHODIMP nsSOAPMessage::SetEncoding(nsISOAPEncoding* aEncoding)
mEncoding = aEncoding;
return NS_OK;
}
static const char*kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPMessage::CanCreateWrapper(const nsIID * iid, char**_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPMessage))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPMessage::CanCallMethod(const nsIID * iid, const PRUnichar*methodName, char**_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPMessage))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPMessage::CanGetProperty(const nsIID * iid, const PRUnichar*propertyName, char**_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPMessage))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPMessage::CanSetProperty(const nsIID * iid, const PRUnichar*propertyName, char**_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPMessage))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,15 +26,13 @@
#include "nsString.h"
#include "nsISOAPEncoding.h"
#include "nsISOAPMessage.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
#include "nsISupportsArray.h"
#include "nsCOMPtr.h"
#include "nsIVariant.h"
class nsSOAPMessage : public nsISOAPMessage,
public nsISecurityCheckedComponent
class nsSOAPMessage : public nsISOAPMessage
{
public:
nsSOAPMessage();
@ -45,9 +43,6 @@ public:
// nsISOAPMessage
NS_DECL_NSISOAPMESSAGE
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
protected:
PRUint16 GetEnvelopeWithVersion(nsIDOMElement * *aEnvelope);

View File

@ -32,10 +32,6 @@ nsSOAPParameter::nsSOAPParameter()
NS_INIT_ISUPPORTS();
}
nsSOAPParameter::nsSOAPParameter(nsISOAPAttachments* aAttachments): nsSOAPBlock(aAttachments)
{
}
NS_IMPL_CI_INTERFACE_GETTER2(nsSOAPParameter, nsISOAPBlock, nsISOAPParameter)
NS_IMPL_ADDREF_INHERITED(nsSOAPParameter, nsSOAPBlock)
NS_IMPL_RELEASE_INHERITED(nsSOAPParameter, nsSOAPBlock)
@ -48,49 +44,3 @@ NS_INTERFACE_MAP_END_INHERITING(nsSOAPBlock)
nsSOAPParameter::~nsSOAPParameter()
{
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPParameter::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPParameter))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPParameter::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPParameter))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPParameter::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPParameter))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPParameter::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPParameter))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsIVariant.h"
#include "nsISOAPParameter.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIJSNativeInitializer.h"
#include "nsISOAPEncoding.h"
#include "nsISchema.h"
@ -40,7 +39,6 @@ class nsSOAPParameter : public nsSOAPBlock,
{
public:
nsSOAPParameter();
nsSOAPParameter(nsISOAPAttachments* aAttachments);
virtual ~nsSOAPParameter();
NS_DECL_ISUPPORTS
@ -49,9 +47,6 @@ public:
// nsISOAPParameter
NS_DECL_NSISOAPPARAMETER
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
};
#endif

View File

@ -23,7 +23,11 @@
#include "nsSOAPResponse.h"
#include "nsSOAPUtils.h"
#include "nsSOAPFault.h"
#include "nsISOAPFault.h"
#include "nsCOMPtr.h"
#include "nsISOAPParameter.h"
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
nsSOAPResponse::nsSOAPResponse()
{
@ -63,9 +67,12 @@ NS_IMETHODIMP nsSOAPResponse::GetFault(nsISOAPFault * *aFault)
*nsSOAPUtils::kSOAPEnvURI[version], nsSOAPUtils::kFaultTagName,
getter_AddRefs(fault));
if (fault) {
*aFault = new nsSOAPFault(fault);
if (!*aFault)
nsCOMPtr<nsISOAPFault> f = do_CreateInstance(NS_SOAPFAULT_CONTRACTID);
if (!f)
return NS_ERROR_OUT_OF_MEMORY;
rc = f->SetElement(fault);
if (NS_FAILED(rc)) return rc;
*aFault = f;
NS_ADDREF(*aFault);
}
}
@ -75,49 +82,3 @@ NS_IMETHODIMP nsSOAPResponse::GetFault(nsISOAPFault * *aFault)
}
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPResponse::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPResponse))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPResponse::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPResponse))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPResponse::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPResponse))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPResponse::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPResponse))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsSOAPCall.h"
#include "nsISOAPResponse.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"
#include "nsCOMPtr.h"
@ -43,9 +42,6 @@ public:
// nsISOAPResponse
NS_DECL_NSISOAPRESPONSE
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
nsSOAPResponse();
virtual ~nsSOAPResponse();

View File

@ -199,6 +199,7 @@ nsXMLHttpRequest::AddEventListener(const nsAReadableString& type,
else {
return NS_ERROR_INVALID_ARG;
}
GetCurrentContext(getter_AddRefs(mScriptContext));
return NS_OK;
}

View File

@ -26,6 +26,7 @@ interface nsIDOMElement;
interface nsIVariant;
interface nsISOAPEncoding;
interface nsISchemaType;
interface nsISOAPAttachments;
/**
* This interface encapsulates an arbitrary block to be used
@ -49,6 +50,14 @@ interface nsISchemaType;
[scriptable, uuid(843afaa8-1dd2-11b2-8b0d-9b5d16fe64ea)]
interface nsISOAPBlock : nsISupports {
/**
* Initialize the block for additional decoding information.
*
* @param aAttachments Attachments in case this refers to them.
*
* @param aVersion SOAP version for decoding special header attributes.
*/
void init(in nsISOAPAttachments aAttachments, in unsigned short aVersion);
/**
* The namespace URI of the block. Ignored if name is null.

View File

@ -26,27 +26,31 @@
#include "nsSOAPUtils.h"
#include "nsIServiceManager.h"
#include "nsISOAPAttachments.h"
#include "nsISOAPMessage.h"
nsSOAPBlock::nsSOAPBlock()
{
NS_INIT_ISUPPORTS();
}
nsSOAPBlock::nsSOAPBlock(nsISOAPAttachments* aAttachments)
{
NS_INIT_ISUPPORTS();
mAttachments = aAttachments;
}
nsSOAPBlock::~nsSOAPBlock()
{
}
NS_IMPL_ISUPPORTS3(nsSOAPBlock,
NS_IMPL_ISUPPORTS2(nsSOAPBlock,
nsISOAPBlock,
nsISecurityCheckedComponent,
nsIJSNativeInitializer)
NS_IMETHODIMP nsSOAPBlock::Init(nsISOAPAttachments* aAttachments, PRUint16 aVersion) {
if (aVersion == nsISOAPMessage::VERSION_1_1
||aVersion == nsISOAPMessage::VERSION_1_2) {
mAttachments = aAttachments;
mVersion = aVersion;
return NS_OK;
}
return NS_ERROR_ILLEGAL_VALUE;
}
/* attribute AString namespaceURI; */
NS_IMETHODIMP nsSOAPBlock::GetNamespaceURI(nsAString & aNamespaceURI)
{
@ -201,49 +205,3 @@ nsSOAPBlock::Initialize(JSContext *cx, JSObject *obj,
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPBlock::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPBlock::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPBlock::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPBlock::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsIVariant.h"
#include "nsISOAPBlock.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIJSNativeInitializer.h"
#include "nsISOAPEncoding.h"
#include "nsISchema.h"
@ -35,12 +34,10 @@
#include "nsCOMPtr.h"
class nsSOAPBlock : public nsISOAPBlock,
public nsISecurityCheckedComponent,
public nsIJSNativeInitializer
{
public:
nsSOAPBlock();
nsSOAPBlock(nsISOAPAttachments* aAttachments);
virtual ~nsSOAPBlock();
NS_DECL_ISUPPORTS
@ -48,9 +45,6 @@ public:
// nsISOAPBlock
NS_DECL_NSISOAPBLOCK
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
// nsIJSNativeInitializer
NS_IMETHOD Initialize(JSContext *cx, JSObject *obj,
PRUint32 argc, jsval *argv);
@ -65,6 +59,7 @@ protected:
nsCOMPtr<nsIVariant> mValue;
nsresult mStatus;
PRBool mComputeValue;
PRBool mVersion;
};
#endif

View File

@ -105,9 +105,8 @@ NS_IMETHODIMP nsSOAPCall::Invoke(nsISOAPResponse **_retval)
rv = GetTransport(getter_AddRefs(transport));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsISOAPResponse> response;
response = new nsSOAPResponse();
if (!response) return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsISOAPResponse> response(do_CreateInstance(NS_SOAPRESPONSE_CONTRACTID, &rv));
if (NS_FAILED(rv)) return rv;
rv = response->SetEncoding(mEncoding);
if (NS_FAILED(rv)) return rv;
@ -138,58 +137,11 @@ NS_IMETHODIMP nsSOAPCall::AsyncInvoke(nsISOAPResponseListener *listener, nsISOAP
rv = GetTransport(getter_AddRefs(transport));
if (NS_FAILED(rv)) return rv;
nsCOMPtr<nsISOAPResponse> response;
response = new nsSOAPResponse();
if (!response) return NS_ERROR_OUT_OF_MEMORY;
nsCOMPtr<nsISOAPResponse> response(do_CreateInstance(NS_SOAPRESPONSE_CONTRACTID, &rv));
if (NS_FAILED(rv)) return rv;
rv = response->SetEncoding(mEncoding);
if (NS_FAILED(rv)) return rv;
rv = transport->AsyncCall(this, listener, response, aCompletion);
return rv;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPCall::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPCall))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPCall::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPCall))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPCall::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPCall))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPCall::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPCall))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsSOAPMessage.h"
#include "nsISOAPCall.h"
#include "nsISecurityCheckedComponent.h"
#include "nsISOAPTransport.h"
#include "nsISOAPResponseListener.h"
#include "nsCOMPtr.h"
@ -46,9 +45,6 @@ public:
// nsISOAPCall
NS_DECL_NSISOAPCALL
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
protected:
nsString mTransportURI;

View File

@ -69,8 +69,10 @@ nsresult nsSOAPEncodingRegistry::GetAssociatedEncoding(const nsAString& aStyleUR
encodingContractid.Append(NS_ConvertUCS2toUTF8(aStyleURI));
defaultEncoding = do_GetService(encodingContractid.get());
if (defaultEncoding || aCreateIf) {
*aEncoding = new nsSOAPEncoding(aStyleURI, this, defaultEncoding);
mEncodings->Put(&styleKey, *aEncoding);
nsCOMPtr<nsISOAPEncoding> encoding = do_CreateInstance(NS_SOAPENCODING_CONTRACTID);
*aEncoding = encoding;
NS_IF_ADDREF(*aEncoding);
mEncodings->Put(&styleKey, encoding);
}
}
return NS_OK;
@ -160,7 +162,7 @@ NS_IMETHODIMP nsSOAPEncodingRegistry::Decode(nsIDOMElement *aSource, nsISchemaTy
// Second, we create the encodings themselves.
NS_IMPL_ISUPPORTS2_CI(nsSOAPEncoding, nsISOAPEncoding, nsISecurityCheckedComponent)
NS_IMPL_ISUPPORTS1_CI(nsSOAPEncoding, nsISOAPEncoding)
nsSOAPEncoding::nsSOAPEncoding(): mEncoders(new nsSupportsHashtable),
mDecoders(new nsSupportsHashtable)
@ -354,49 +356,3 @@ NS_IMETHODIMP nsSOAPEncoding::SetDefaultDecoder(nsISOAPDecoder * aDefaultDecoder
mDefaultDecoder = aDefaultDecoder;
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPEncoding::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPEncoding))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPEncoding::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPEncoding))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPEncoding::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPEncoding))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPEncoding::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPEncoding))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -24,7 +24,6 @@
#define nsSOAPEncodingRegistry_h__
#include "nsString.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIDOMElement.h"
#include "nsISOAPEncoding.h"
#include "nsISOAPEncoder.h"
@ -49,17 +48,13 @@ protected:
nsCOMPtr<nsISchemaCollection> mSchemaCollection;
};
class nsSOAPEncoding : public nsISOAPEncoding,
public nsISecurityCheckedComponent
class nsSOAPEncoding : public nsISOAPEncoding
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISOAPENCODING
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
nsSOAPEncoding();
nsSOAPEncoding(PRUint16 aVersion);
nsSOAPEncoding(const nsAString& aStyleURI, nsSOAPEncodingRegistry * aRegistry, nsISOAPEncoding* aDefaultEncoding);

View File

@ -25,17 +25,16 @@
#include "nsIDOMNodeList.h"
#include "nsISOAPMessage.h"
nsSOAPFault::nsSOAPFault(nsIDOMElement* aElement)
nsSOAPFault::nsSOAPFault()
{
NS_INIT_ISUPPORTS();
mFaultElement = aElement;
}
nsSOAPFault::~nsSOAPFault()
{
}
NS_IMPL_ISUPPORTS2_CI(nsSOAPFault, nsISOAPFault, nsISecurityCheckedComponent)
NS_IMPL_ISUPPORTS1_CI(nsSOAPFault, nsISOAPFault)
/* attribute nsIDOMElement element; */
NS_IMETHODIMP nsSOAPFault::SetElement(nsIDOMElement *aElement)
@ -133,49 +132,3 @@ NS_IMETHODIMP nsSOAPFault::GetDetail(nsIDOMElement * *aDetail)
nsSOAPUtils::kFaultDetailTagName, aDetail);
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPFault::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPFault))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPFault::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPFault))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPFault::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPFault))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPFault::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPFault))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -25,15 +25,13 @@
#include "nsString.h"
#include "nsISOAPFault.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIDOMElement.h"
#include "nsCOMPtr.h"
class nsSOAPFault : public nsISOAPFault,
public nsISecurityCheckedComponent
class nsSOAPFault : public nsISOAPFault
{
public:
nsSOAPFault(nsIDOMElement* aElement);
nsSOAPFault();
virtual ~nsSOAPFault();
NS_DECL_ISUPPORTS
@ -41,9 +39,6 @@ public:
// nsISOAPFault
NS_DECL_NSISOAPFAULT
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
protected:
nsCOMPtr<nsIDOMElement> mFaultElement;
PRUint16 mVersion;

View File

@ -28,15 +28,11 @@
#include "nsISOAPAttachments.h"
#include "nsISOAPMessage.h"
nsSOAPHeaderBlock::nsSOAPHeaderBlock():mVersion(nsISOAPMessage::VERSION_UNKNOWN)
nsSOAPHeaderBlock::nsSOAPHeaderBlock()
{
NS_INIT_ISUPPORTS();
}
nsSOAPHeaderBlock::nsSOAPHeaderBlock(nsISOAPAttachments* aAttachments, PRUint16 aVersion): nsSOAPBlock(aAttachments), mVersion(aVersion)
{
}
NS_IMPL_CI_INTERFACE_GETTER2(nsSOAPHeaderBlock, nsISOAPBlock, nsISOAPHeaderBlock)
NS_IMPL_ADDREF_INHERITED(nsSOAPHeaderBlock, nsSOAPBlock)
NS_IMPL_RELEASE_INHERITED(nsSOAPHeaderBlock, nsSOAPBlock)
@ -98,49 +94,3 @@ NS_IMETHODIMP nsSOAPHeaderBlock::SetMustUnderstand(PRBool aMustUnderstand)
mMustUnderstand = aMustUnderstand;
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPHeaderBlock::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPHeaderBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPHeaderBlock::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPHeaderBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPHeaderBlock::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPHeaderBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPHeaderBlock::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPHeaderBlock))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsIVariant.h"
#include "nsISOAPHeaderBlock.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIJSNativeInitializer.h"
#include "nsISOAPEncoding.h"
#include "nsISchema.h"
@ -40,7 +39,6 @@ class nsSOAPHeaderBlock : public nsSOAPBlock,
{
public:
nsSOAPHeaderBlock();
nsSOAPHeaderBlock(nsISOAPAttachments* aAttachments, PRUint16 aVersion);
virtual ~nsSOAPHeaderBlock();
NS_DECL_ISUPPORTS
@ -50,13 +48,9 @@ public:
// nsISOAPHeaderBlock
NS_DECL_NSISOAPHEADERBLOCK
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
protected:
nsString mActorURI;
PRBool mMustUnderstand;
PRBool mVersion;
};
#endif

View File

@ -49,9 +49,8 @@ nsSOAPMessage::~nsSOAPMessage()
{
}
NS_IMPL_ISUPPORTS2(nsSOAPMessage,
nsISOAPMessage,
nsISecurityCheckedComponent)
NS_IMPL_ISUPPORTS1(nsSOAPMessage,
nsISOAPMessage)
/* attribute nsIDOMDocument message; */
NS_IMETHODIMP nsSOAPMessage::GetMessage(nsIDOMDocument * *aMessage)
@ -498,8 +497,9 @@ NS_IMETHODIMP nsSOAPMessage::GetHeaderBlocks(PRUint32 *aCount, nsISOAPHeaderBloc
*aHeaderBlocks = (nsISOAPHeaderBlock* *)memory->Realloc(*aHeaderBlocks, length * sizeof(**aHeaderBlocks));
}
element = next;
header = new nsSOAPHeaderBlock(nsnull, version);// Header needs version to interpret actor, mustInclude
header = do_CreateInstance(NS_SOAPHEADERBLOCK_CONTRACTID);
if (!header) return NS_ERROR_OUT_OF_MEMORY;
header->Init(nsnull, version);
(*aHeaderBlocks)[(*aCount)] = header;
NS_ADDREF((*aHeaderBlocks)[(*aCount)]);
@ -546,7 +546,7 @@ NS_IMETHODIMP nsSOAPMessage::GetParameters(PRBool aDocumentStyle, PRUint32 *aCou
*aParameters = (nsISOAPParameter* *)memory->Realloc(*aParameters, length * sizeof(**aParameters));
}
element = next;
param = new nsSOAPParameter();
param = do_CreateInstance(NS_SOAPPARAMETER_CONTRACTID);
if (!param) return NS_ERROR_OUT_OF_MEMORY;
(*aParameters)[(*aCount)] = param;
@ -574,9 +574,11 @@ NS_IMETHODIMP nsSOAPMessage::GetEncoding(nsISOAPEncoding* * aEncoding)
nsresult rc = GetVersion(&version);
if (NS_FAILED(rc)) return rc;
if (version != nsISOAPMessage::VERSION_UNKNOWN) {
mEncoding = new nsSOAPEncoding(version);
if (!mEncoding)
nsCOMPtr<nsISOAPEncoding> encoding = do_CreateInstance(NS_SOAPENCODING_CONTRACTID);
if (!encoding)
return NS_ERROR_OUT_OF_MEMORY;
rc = encoding->GetAssociatedEncoding(*nsSOAPUtils::kSOAPEncURI[version], PR_FALSE, getter_AddRefs(mEncoding));
if (NS_FAILED(rc)) return rc;
}
}
*aEncoding = mEncoding;
@ -588,49 +590,3 @@ NS_IMETHODIMP nsSOAPMessage::SetEncoding(nsISOAPEncoding* aEncoding)
mEncoding = aEncoding;
return NS_OK;
}
static const char*kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPMessage::CanCreateWrapper(const nsIID * iid, char**_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPMessage))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPMessage::CanCallMethod(const nsIID * iid, const PRUnichar*methodName, char**_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPMessage))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPMessage::CanGetProperty(const nsIID * iid, const PRUnichar*propertyName, char**_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPMessage))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPMessage::CanSetProperty(const nsIID * iid, const PRUnichar*propertyName, char**_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPMessage))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,15 +26,13 @@
#include "nsString.h"
#include "nsISOAPEncoding.h"
#include "nsISOAPMessage.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIDOMElement.h"
#include "nsIDOMDocument.h"
#include "nsISupportsArray.h"
#include "nsCOMPtr.h"
#include "nsIVariant.h"
class nsSOAPMessage : public nsISOAPMessage,
public nsISecurityCheckedComponent
class nsSOAPMessage : public nsISOAPMessage
{
public:
nsSOAPMessage();
@ -45,9 +43,6 @@ public:
// nsISOAPMessage
NS_DECL_NSISOAPMESSAGE
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
protected:
PRUint16 GetEnvelopeWithVersion(nsIDOMElement * *aEnvelope);

View File

@ -32,10 +32,6 @@ nsSOAPParameter::nsSOAPParameter()
NS_INIT_ISUPPORTS();
}
nsSOAPParameter::nsSOAPParameter(nsISOAPAttachments* aAttachments): nsSOAPBlock(aAttachments)
{
}
NS_IMPL_CI_INTERFACE_GETTER2(nsSOAPParameter, nsISOAPBlock, nsISOAPParameter)
NS_IMPL_ADDREF_INHERITED(nsSOAPParameter, nsSOAPBlock)
NS_IMPL_RELEASE_INHERITED(nsSOAPParameter, nsSOAPBlock)
@ -48,49 +44,3 @@ NS_INTERFACE_MAP_END_INHERITING(nsSOAPBlock)
nsSOAPParameter::~nsSOAPParameter()
{
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPParameter::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPParameter))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPParameter::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPParameter))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPParameter::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPParameter))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPParameter::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPParameter))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsIVariant.h"
#include "nsISOAPParameter.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIJSNativeInitializer.h"
#include "nsISOAPEncoding.h"
#include "nsISchema.h"
@ -40,7 +39,6 @@ class nsSOAPParameter : public nsSOAPBlock,
{
public:
nsSOAPParameter();
nsSOAPParameter(nsISOAPAttachments* aAttachments);
virtual ~nsSOAPParameter();
NS_DECL_ISUPPORTS
@ -49,9 +47,6 @@ public:
// nsISOAPParameter
NS_DECL_NSISOAPPARAMETER
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
};
#endif

View File

@ -23,7 +23,11 @@
#include "nsSOAPResponse.h"
#include "nsSOAPUtils.h"
#include "nsSOAPFault.h"
#include "nsISOAPFault.h"
#include "nsCOMPtr.h"
#include "nsISOAPParameter.h"
#include "nsIServiceManager.h"
#include "nsIComponentManager.h"
nsSOAPResponse::nsSOAPResponse()
{
@ -63,9 +67,12 @@ NS_IMETHODIMP nsSOAPResponse::GetFault(nsISOAPFault * *aFault)
*nsSOAPUtils::kSOAPEnvURI[version], nsSOAPUtils::kFaultTagName,
getter_AddRefs(fault));
if (fault) {
*aFault = new nsSOAPFault(fault);
if (!*aFault)
nsCOMPtr<nsISOAPFault> f = do_CreateInstance(NS_SOAPFAULT_CONTRACTID);
if (!f)
return NS_ERROR_OUT_OF_MEMORY;
rc = f->SetElement(fault);
if (NS_FAILED(rc)) return rc;
*aFault = f;
NS_ADDREF(*aFault);
}
}
@ -75,49 +82,3 @@ NS_IMETHODIMP nsSOAPResponse::GetFault(nsISOAPFault * *aFault)
}
return NS_OK;
}
static const char* kAllAccess = "AllAccess";
/* string canCreateWrapper (in nsIIDPtr iid); */
NS_IMETHODIMP
nsSOAPResponse::CanCreateWrapper(const nsIID * iid, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPResponse))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canCallMethod (in nsIIDPtr iid, in wstring methodName); */
NS_IMETHODIMP
nsSOAPResponse::CanCallMethod(const nsIID * iid, const PRUnichar *methodName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPResponse))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canGetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPResponse::CanGetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPResponse))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}
/* string canSetProperty (in nsIIDPtr iid, in wstring propertyName); */
NS_IMETHODIMP
nsSOAPResponse::CanSetProperty(const nsIID * iid, const PRUnichar *propertyName, char **_retval)
{
if (iid->Equals(NS_GET_IID(nsISOAPResponse))) {
*_retval = nsCRT::strdup(kAllAccess);
}
return NS_OK;
}

View File

@ -26,7 +26,6 @@
#include "nsString.h"
#include "nsSOAPCall.h"
#include "nsISOAPResponse.h"
#include "nsISecurityCheckedComponent.h"
#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"
#include "nsCOMPtr.h"
@ -43,9 +42,6 @@ public:
// nsISOAPResponse
NS_DECL_NSISOAPRESPONSE
// nsISecurityCheckedComponent
NS_DECL_NSISECURITYCHECKEDCOMPONENT
nsSOAPResponse();
virtual ~nsSOAPResponse();