зеркало из https://github.com/mozilla/pjs.git
Gave more SOAP objects xpconnect behaviors.
This commit is contained in:
Родитель
30b1f8ceb4
Коммит
9282b8e318
|
@ -40,7 +40,7 @@ nsHTTPSOAPTransport::~nsHTTPSOAPTransport()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsHTTPSOAPTransport, nsISOAPTransport)
|
||||
NS_IMPL_ISUPPORTS1(nsHTTPSOAPTransport, nsISOAPTransport)
|
||||
|
||||
/* void syncCall (in nsISOAPCall aCall, in nsISOAPResponse aResponse); */
|
||||
NS_IMETHODIMP nsHTTPSOAPTransport::SyncCall(nsISOAPCall *aCall, nsISOAPResponse *aResponse)
|
||||
|
|
|
@ -114,6 +114,14 @@ NS_IMETHODIMP nsSOAPCall::Invoke(nsISOAPResponse **_retval)
|
|||
rv = transport->SyncCall(this, response);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> document;
|
||||
rv = response->GetMessage(getter_AddRefs(document)); // No XML response.
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (!document) {
|
||||
*_retval = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return response->QueryInterface(NS_GET_IID(nsISOAPResponse), (void**)_retval);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ nsSOAPFault::~nsSOAPFault()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSOAPFault, nsISOAPFault, nsISecurityCheckedComponent)
|
||||
NS_IMPL_ISUPPORTS2_CI(nsSOAPFault, nsISOAPFault, nsISecurityCheckedComponent)
|
||||
|
||||
/* attribute nsIDOMElement element; */
|
||||
NS_IMETHODIMP nsSOAPFault::SetElement(nsIDOMElement *aElement)
|
||||
|
|
|
@ -48,4 +48,9 @@ protected:
|
|||
nsCOMPtr<nsIDOMElement> mFaultElement;
|
||||
};
|
||||
|
||||
#define NS_SOAPFAULT_CID \
|
||||
{ /* cb8cd1ae-1dd1-11b2-9954-e393ae604c08 */ \
|
||||
0xcb8cd1ae, 0x1dd2, 0x11b2, \
|
||||
{0x99, 0x54, 0xe3, 0x93, 0xae, 0x60, 0x4c, 0x08} }
|
||||
#define NS_SOAPFAULT_CONTRACTID "@mozilla.org/xmlextras/soap/fault;1"
|
||||
#endif
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include "nsSOAPCall.h"
|
||||
#include "nsSOAPResponse.h"
|
||||
#include "nsSOAPEncoding.h"
|
||||
#include "nsSOAPFault.h"
|
||||
#include "nsDefaultSOAPEncoder.h"
|
||||
#include "nsHTTPSOAPTransport.h"
|
||||
#include "nsSchemaLoader.h"
|
||||
|
@ -88,6 +89,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTTPSOAPTransport)
|
|||
NS_DECL_CLASSINFO(nsSOAPCall)
|
||||
NS_DECL_CLASSINFO(nsSOAPResponse)
|
||||
NS_DECL_CLASSINFO(nsSOAPEncoding)
|
||||
NS_DECL_CLASSINFO(nsSOAPFault)
|
||||
NS_DECL_CLASSINFO(nsSOAPHeaderBlock)
|
||||
NS_DECL_CLASSINFO(nsSOAPParameter)
|
||||
NS_DECL_CLASSINFO(nsHTTPSOAPTransport)
|
||||
|
@ -298,6 +300,11 @@ static nsModuleComponentInfo components[] = {
|
|||
NS_CI_INTERFACE_GETTER_NAME(nsSOAPEncoding),
|
||||
nsnull, &NS_CLASSINFO_NAME(nsSOAPEncoding),
|
||||
nsIClassInfo::DOM_OBJECT },
|
||||
{ "SOAP Fault", NS_SOAPFAULT_CID, NS_SOAPFAULT_CONTRACTID,
|
||||
nsnull, nsnull, nsnull, nsnull,
|
||||
NS_CI_INTERFACE_GETTER_NAME(nsSOAPFault),
|
||||
nsnull, &NS_CLASSINFO_NAME(nsSOAPFault),
|
||||
nsIClassInfo::DOM_OBJECT },
|
||||
{ "SOAP Header Block", NS_SOAPHEADERBLOCK_CID, NS_SOAPHEADERBLOCK_CONTRACTID,
|
||||
nsSOAPHeaderBlockConstructor, nsnull, nsnull, nsnull,
|
||||
NS_CI_INTERFACE_GETTER_NAME(nsSOAPHeaderBlock),
|
||||
|
@ -313,10 +320,7 @@ static nsModuleComponentInfo components[] = {
|
|||
nsDefaultSOAPEncoderConstructor },
|
||||
{ "HTTP SOAP Transport", NS_HTTPSOAPTRANSPORT_CID,
|
||||
NS_HTTPSOAPTRANSPORT_CONTRACTID,
|
||||
nsHTTPSOAPTransportConstructor, nsnull, nsnull, nsnull,
|
||||
NS_CI_INTERFACE_GETTER_NAME(nsHTTPSOAPTransport),
|
||||
nsnull, &NS_CLASSINFO_NAME(nsHTTPSOAPTransport),
|
||||
nsIClassInfo::DOM_OBJECT },
|
||||
nsHTTPSOAPTransportConstructor },
|
||||
{ "HTTP SOAP Transport Completion", NS_HTTPSOAPTRANSPORTCOMPLETION_CID,
|
||||
NS_HTTPSOAPTRANSPORTCOMPLETION_CONTRACTID,
|
||||
nsnull, nsnull, nsnull, nsnull,
|
||||
|
|
|
@ -40,7 +40,7 @@ nsHTTPSOAPTransport::~nsHTTPSOAPTransport()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsHTTPSOAPTransport, nsISOAPTransport)
|
||||
NS_IMPL_ISUPPORTS1(nsHTTPSOAPTransport, nsISOAPTransport)
|
||||
|
||||
/* void syncCall (in nsISOAPCall aCall, in nsISOAPResponse aResponse); */
|
||||
NS_IMETHODIMP nsHTTPSOAPTransport::SyncCall(nsISOAPCall *aCall, nsISOAPResponse *aResponse)
|
||||
|
|
|
@ -114,6 +114,14 @@ NS_IMETHODIMP nsSOAPCall::Invoke(nsISOAPResponse **_retval)
|
|||
rv = transport->SyncCall(this, response);
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIDOMDocument> document;
|
||||
rv = response->GetMessage(getter_AddRefs(document)); // No XML response.
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
if (!document) {
|
||||
*_retval = nsnull;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return response->QueryInterface(NS_GET_IID(nsISOAPResponse), (void**)_retval);
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ nsSOAPFault::~nsSOAPFault()
|
|||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsSOAPFault, nsISOAPFault, nsISecurityCheckedComponent)
|
||||
NS_IMPL_ISUPPORTS2_CI(nsSOAPFault, nsISOAPFault, nsISecurityCheckedComponent)
|
||||
|
||||
/* attribute nsIDOMElement element; */
|
||||
NS_IMETHODIMP nsSOAPFault::SetElement(nsIDOMElement *aElement)
|
||||
|
|
|
@ -48,4 +48,9 @@ protected:
|
|||
nsCOMPtr<nsIDOMElement> mFaultElement;
|
||||
};
|
||||
|
||||
#define NS_SOAPFAULT_CID \
|
||||
{ /* cb8cd1ae-1dd1-11b2-9954-e393ae604c08 */ \
|
||||
0xcb8cd1ae, 0x1dd2, 0x11b2, \
|
||||
{0x99, 0x54, 0xe3, 0x93, 0xae, 0x60, 0x4c, 0x08} }
|
||||
#define NS_SOAPFAULT_CONTRACTID "@mozilla.org/xmlextras/soap/fault;1"
|
||||
#endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче