зеркало из https://github.com/mozilla/pjs.git
Try to determine and record SOAP version. [not part of build]
This commit is contained in:
Родитель
9bb2cceed3
Коммит
503756b9a6
|
@ -33,10 +33,15 @@ interface nsISOAPPortBinding : nsIWSDLBinding {
|
|||
const unsigned short STYLE_RPC = 1;
|
||||
const unsigned short STYLE_DOCUMENT = 2;
|
||||
|
||||
const unsigned short SOAP_VERSION_1_1 = 0;
|
||||
const unsigned short SOAP_VERSION_1_2 = 1;
|
||||
const unsigned short SOAP_VERSION_UNKNOWN = 32767;
|
||||
|
||||
readonly attribute AString name;
|
||||
readonly attribute AString address;
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString transport;
|
||||
readonly attribute unsigned short soapVersion;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac8-65de-11d5-9b42-00104bdf5339)]
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
#include "nsWSDLPrivate.h"
|
||||
#include "nsISOAPMessage.h"
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -155,7 +156,8 @@ nsWSDLPort::SetBinding(nsIWSDLBinding* aBinding)
|
|||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsSOAPPortBinding::nsSOAPPortBinding(const nsAReadableString& aName)
|
||||
: mName(aName), mStyle(STYLE_RPC)
|
||||
: mName(aName), mStyle(STYLE_RPC),
|
||||
mSoapVersion(nsISOAPPortBinding::SOAP_VERSION_UNKNOWN)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
@ -227,6 +229,14 @@ nsSOAPPortBinding::GetTransport(nsAWritableString & aTransport)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short soapVersion; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetSoapVersion(PRUint16 *aVersion)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aVersion);
|
||||
*aVersion = mSoapVersion;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
|
@ -260,6 +270,13 @@ nsSOAPPortBinding::SetTransport(const nsAReadableString& aTransport)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetSoapVersion(PRUint16 aVersion)
|
||||
{
|
||||
mSoapVersion = aVersion;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLOperation implementation
|
||||
|
|
|
@ -46,6 +46,12 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
||||
// XMLExtras includes
|
||||
#include "nsISOAPMessage.h"
|
||||
|
||||
#define SCHEMA_2001_NAMESPACE "http://www.w3.org/2001/XMLSchema"
|
||||
#define SCHEMA_1999_NAMESPACE "http://www.w3.org/1999/XMLSchema"
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLAtoms implementation
|
||||
|
@ -1404,6 +1410,10 @@ nsWSDLLoadRequest::ProcessBindingElement(nsIDOMElement* aElement)
|
|||
else if ((tagName == nsWSDLAtoms::sBinding_atom) &&
|
||||
IsElementOfNamespace(childElement,
|
||||
NS_LITERAL_STRING(NS_WSDL_SOAP_NAMESPACE))) {
|
||||
// XXX There should be different namespaces for newer versions
|
||||
// of SOAP.
|
||||
bindingInst->SetSoapVersion(nsISOAPPortBinding::SOAP_VERSION_1_1);
|
||||
|
||||
nsAutoString style, transport;
|
||||
childElement->GetAttribute(NS_LITERAL_STRING("style"), style);
|
||||
childElement->GetAttribute(NS_LITERAL_STRING("transport"), transport);
|
||||
|
|
|
@ -65,6 +65,7 @@ public:
|
|||
NS_IMETHOD SetAddress(const nsAReadableString& aAddress);
|
||||
NS_IMETHOD SetStyle(PRUint16 aStyle);
|
||||
NS_IMETHOD SetTransport(const nsAReadableString& aTransport);
|
||||
NS_IMETHOD SetSoapVersion(PRUint16 aSoapVersion);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
|
@ -72,6 +73,7 @@ protected:
|
|||
PRUint16 mStyle;
|
||||
nsString mTransport;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
PRUint16 mSoapVersion;
|
||||
};
|
||||
|
||||
class nsWSDLPort : public nsIWSDLPort {
|
||||
|
|
|
@ -33,10 +33,15 @@ interface nsISOAPPortBinding : nsIWSDLBinding {
|
|||
const unsigned short STYLE_RPC = 1;
|
||||
const unsigned short STYLE_DOCUMENT = 2;
|
||||
|
||||
const unsigned short SOAP_VERSION_1_1 = 0;
|
||||
const unsigned short SOAP_VERSION_1_2 = 1;
|
||||
const unsigned short SOAP_VERSION_UNKNOWN = 32767;
|
||||
|
||||
readonly attribute AString name;
|
||||
readonly attribute AString address;
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString transport;
|
||||
readonly attribute unsigned short soapVersion;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac8-65de-11d5-9b42-00104bdf5339)]
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
*/
|
||||
|
||||
#include "nsWSDLPrivate.h"
|
||||
#include "nsISOAPMessage.h"
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
@ -155,7 +156,8 @@ nsWSDLPort::SetBinding(nsIWSDLBinding* aBinding)
|
|||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsSOAPPortBinding::nsSOAPPortBinding(const nsAReadableString& aName)
|
||||
: mName(aName), mStyle(STYLE_RPC)
|
||||
: mName(aName), mStyle(STYLE_RPC),
|
||||
mSoapVersion(nsISOAPPortBinding::SOAP_VERSION_UNKNOWN)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
@ -227,6 +229,14 @@ nsSOAPPortBinding::GetTransport(nsAWritableString & aTransport)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short soapVersion; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetSoapVersion(PRUint16 *aVersion)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aVersion);
|
||||
*aVersion = mSoapVersion;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
|
@ -260,6 +270,13 @@ nsSOAPPortBinding::SetTransport(const nsAReadableString& aTransport)
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetSoapVersion(PRUint16 aVersion)
|
||||
{
|
||||
mSoapVersion = aVersion;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLOperation implementation
|
||||
|
|
|
@ -46,6 +46,12 @@
|
|||
#include "nsIServiceManager.h"
|
||||
#include "nsIComponentManager.h"
|
||||
|
||||
// XMLExtras includes
|
||||
#include "nsISOAPMessage.h"
|
||||
|
||||
#define SCHEMA_2001_NAMESPACE "http://www.w3.org/2001/XMLSchema"
|
||||
#define SCHEMA_1999_NAMESPACE "http://www.w3.org/1999/XMLSchema"
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLAtoms implementation
|
||||
|
@ -1404,6 +1410,10 @@ nsWSDLLoadRequest::ProcessBindingElement(nsIDOMElement* aElement)
|
|||
else if ((tagName == nsWSDLAtoms::sBinding_atom) &&
|
||||
IsElementOfNamespace(childElement,
|
||||
NS_LITERAL_STRING(NS_WSDL_SOAP_NAMESPACE))) {
|
||||
// XXX There should be different namespaces for newer versions
|
||||
// of SOAP.
|
||||
bindingInst->SetSoapVersion(nsISOAPPortBinding::SOAP_VERSION_1_1);
|
||||
|
||||
nsAutoString style, transport;
|
||||
childElement->GetAttribute(NS_LITERAL_STRING("style"), style);
|
||||
childElement->GetAttribute(NS_LITERAL_STRING("transport"), transport);
|
||||
|
|
|
@ -65,6 +65,7 @@ public:
|
|||
NS_IMETHOD SetAddress(const nsAReadableString& aAddress);
|
||||
NS_IMETHOD SetStyle(PRUint16 aStyle);
|
||||
NS_IMETHOD SetTransport(const nsAReadableString& aTransport);
|
||||
NS_IMETHOD SetSoapVersion(PRUint16 aSoapVersion);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
|
@ -72,6 +73,7 @@ protected:
|
|||
PRUint16 mStyle;
|
||||
nsString mTransport;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
PRUint16 mSoapVersion;
|
||||
};
|
||||
|
||||
class nsWSDLPort : public nsIWSDLPort {
|
||||
|
|
Загрузка…
Ссылка в новой задаче