From 6b895fc9e3106434a60942323d0724de1c9d85c7 Mon Sep 17 00:00:00 2001 From: "rayw%netscape.com" Date: Fri, 18 Jan 2002 20:09:06 +0000 Subject: [PATCH] Added an error check and a test case that does not work, yet, because xpconnect is saying that an array is an interface, I think. SOAP not part of default build. --- .../soap/src/nsDefaultSOAPEncoder.cpp | 6 +- .../soap/tests/soapheadlinenews.html | 2 +- .../soap/tests/soapstatistics.html | 65 +++++++++++++++++++ .../soap/src/nsDefaultSOAPEncoder.cpp | 6 +- .../xmlextras/tests/soapheadlinenews.html | 2 +- .../xmlextras/tests/soapstatistics.html | 65 +++++++++++++++++++ 6 files changed, 140 insertions(+), 6 deletions(-) create mode 100644 extensions/webservices/soap/tests/soapstatistics.html create mode 100644 extensions/xmlextras/tests/soapstatistics.html diff --git a/extensions/webservices/soap/src/nsDefaultSOAPEncoder.cpp b/extensions/webservices/soap/src/nsDefaultSOAPEncoder.cpp index 5c67e82002df..dc78e58abb7c 100644 --- a/extensions/webservices/soap/src/nsDefaultSOAPEncoder.cpp +++ b/extensions/webservices/soap/src/nsDefaultSOAPEncoder.cpp @@ -351,7 +351,9 @@ NS_IMETHODIMP } PRUint16 typevalue; nativeSchemaURI.Assign(*nsSOAPUtils::kXSURI[mSchemaVersion]); - aSource->GetDataType(&typevalue); + nsresult rc = aSource->GetDataType(&typevalue); + if (NS_FAILED(rc)) + return rc; switch (typevalue) { case nsIDataType::VTYPE_INT8: if (mustBeComplex) @@ -488,7 +490,7 @@ NS_IMETHODIMP nsIID* iid; nsCOMPtr ptr; - nsresult rc = aSource->GetAsInterface(&iid, getter_AddRefs(ptr)); + rc = aSource->GetAsInterface(&iid, getter_AddRefs(ptr)); if (NS_FAILED(rc)) return rc; if (iid->Equals(NS_GET_IID(nsIPropertyBag))) { // Only do explicit property bags for now. diff --git a/extensions/webservices/soap/tests/soapheadlinenews.html b/extensions/webservices/soap/tests/soapheadlinenews.html index 3a406e83883d..7fcd611f23d0 100644 --- a/extensions/webservices/soap/tests/soapheadlinenews.html +++ b/extensions/webservices/soap/tests/soapheadlinenews.html @@ -33,7 +33,7 @@ function oncompletion(resp, call, status) { } else { var ret = resp.getParameters(false, {}); - nw = window.open(); + nw = window.open(null,null,"status=no,toolbar=no,menubar=no,location=no"); nw.document.open(); nw.document.write(ret[0].value); nw.document.close(); diff --git a/extensions/webservices/soap/tests/soapstatistics.html b/extensions/webservices/soap/tests/soapstatistics.html new file mode 100644 index 000000000000..eafdb9d628c3 --- /dev/null +++ b/extensions/webservices/soap/tests/soapstatistics.html @@ -0,0 +1,65 @@ + + + + +

SOAP Test: Statistics

+This passes an array to request the average and standard deviation. +

This works by calling a SOAP service listed on +X Methods Website. View the source of this +page for details on how it was called. If you compile mozilla DEBUG (you also need +MOZ_SOAP), the message sent and received will be logged to the console. +

Experimenters may wish to add other tests which exercize services, with specific +user interfaces such as the one in this test. + +

+

+ + + diff --git a/extensions/xmlextras/soap/src/nsDefaultSOAPEncoder.cpp b/extensions/xmlextras/soap/src/nsDefaultSOAPEncoder.cpp index 5c67e82002df..dc78e58abb7c 100644 --- a/extensions/xmlextras/soap/src/nsDefaultSOAPEncoder.cpp +++ b/extensions/xmlextras/soap/src/nsDefaultSOAPEncoder.cpp @@ -351,7 +351,9 @@ NS_IMETHODIMP } PRUint16 typevalue; nativeSchemaURI.Assign(*nsSOAPUtils::kXSURI[mSchemaVersion]); - aSource->GetDataType(&typevalue); + nsresult rc = aSource->GetDataType(&typevalue); + if (NS_FAILED(rc)) + return rc; switch (typevalue) { case nsIDataType::VTYPE_INT8: if (mustBeComplex) @@ -488,7 +490,7 @@ NS_IMETHODIMP nsIID* iid; nsCOMPtr ptr; - nsresult rc = aSource->GetAsInterface(&iid, getter_AddRefs(ptr)); + rc = aSource->GetAsInterface(&iid, getter_AddRefs(ptr)); if (NS_FAILED(rc)) return rc; if (iid->Equals(NS_GET_IID(nsIPropertyBag))) { // Only do explicit property bags for now. diff --git a/extensions/xmlextras/tests/soapheadlinenews.html b/extensions/xmlextras/tests/soapheadlinenews.html index 3a406e83883d..7fcd611f23d0 100644 --- a/extensions/xmlextras/tests/soapheadlinenews.html +++ b/extensions/xmlextras/tests/soapheadlinenews.html @@ -33,7 +33,7 @@ function oncompletion(resp, call, status) { } else { var ret = resp.getParameters(false, {}); - nw = window.open(); + nw = window.open(null,null,"status=no,toolbar=no,menubar=no,location=no"); nw.document.open(); nw.document.write(ret[0].value); nw.document.close(); diff --git a/extensions/xmlextras/tests/soapstatistics.html b/extensions/xmlextras/tests/soapstatistics.html new file mode 100644 index 000000000000..eafdb9d628c3 --- /dev/null +++ b/extensions/xmlextras/tests/soapstatistics.html @@ -0,0 +1,65 @@ + + + + +

SOAP Test: Statistics

+This passes an array to request the average and standard deviation. +

This works by calling a SOAP service listed on +X Methods Website. View the source of this +page for details on how it was called. If you compile mozilla DEBUG (you also need +MOZ_SOAP), the message sent and received will be logged to the console. +

Experimenters may wish to add other tests which exercize services, with specific +user interfaces such as the one in this test. + +

+ + + +