зеркало из https://github.com/mozilla/gecko-dev.git
Added new WSDL loading mechanism. This is not (as yet) part of the build
This commit is contained in:
Родитель
272eb7f450
Коммит
efc352b9dd
|
@ -22,42 +22,29 @@
|
|||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsISchema.idl"
|
||||
|
||||
%{ C++
|
||||
#include "nsAWritableString.h"
|
||||
%}
|
||||
|
||||
interface nsIWSDLService;
|
||||
interface nsIWSDLBinding;
|
||||
interface nsIWSDLPort;
|
||||
interface nsIWSDLOperation;
|
||||
interface nsIWSDLMessage;
|
||||
interface nsIWSDLPart;
|
||||
interface nsIDOMElement;
|
||||
interface nsISchemaComponent;
|
||||
interface nsISchema;
|
||||
|
||||
[scriptable, uuid(0458dac0-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLService : nsISupports {
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
readonly attribute PRUint32 portCount;
|
||||
nsIWSDLPort getPort(in PRUint32 index);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac1-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLPort : nsISupports {
|
||||
const unsigned short STYLE_RPC = 1;
|
||||
const unsigned short STYLE_DOCUMENT = 2;
|
||||
|
||||
interface nsIWSDLPort : nsISupports {
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute AString bindingName;
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString transport;
|
||||
readonly attribute nsIWSDLBinding binding;
|
||||
|
||||
readonly attribute PRUint32 operationCount;
|
||||
nsIWSDLOperation getOperation(in PRUint32 index);
|
||||
nsIWSDLOperation getOperationByName(in AString name);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac2-65de-11d5-9b42-00104bdf5339)]
|
||||
|
@ -65,38 +52,32 @@ interface nsIWSDLOperation : nsISupports {
|
|||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString soapAction;
|
||||
readonly attribute nsIWSDLBinding binding;
|
||||
|
||||
readonly attribute nsIWSDLMessage input;
|
||||
readonly attribute nsIWSDLMessage output;
|
||||
readonly attribute nsIWSDLMessage fault;
|
||||
readonly attribute PRUint32 faultCount;
|
||||
nsIWSDLMessage getFault(in PRUint32 index);
|
||||
|
||||
readonly attribute PRUint32 parameterCount;
|
||||
AString getParameter(in PRUint32 index);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac3-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLMessage : nsISupports {
|
||||
const unsigned short LOCATION_SOAP_BODY = 1;
|
||||
const unsigned short LOCATION_SOAP_HEADER = 2;
|
||||
const unsigned short LOCATION_SOAP_FAULT = 3;
|
||||
|
||||
const unsigned short USE_LITERAL = 1;
|
||||
const unsigned short USE_ENCODED = 2;
|
||||
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute unsigned short location;
|
||||
readonly attribute unsigned short use;
|
||||
readonly attribute AString encodingStyle;
|
||||
readonly attribute AString namespace;
|
||||
|
||||
readonly attribute PRUint32 partCount;
|
||||
nsIWSDLPart getPart(in PRUint32 index);
|
||||
nsIWSDLPart getPartByName(in AString name);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac4-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLPart : nsISupports {
|
||||
readonly attribute AString name;
|
||||
|
||||
readonly attribute nsIWSDLBinding binding;
|
||||
|
||||
readonly attribute AString type;
|
||||
readonly attribute AString elementName;
|
||||
|
@ -107,9 +88,11 @@ interface nsIWSDLPart : nsISupports {
|
|||
* elementName attribute is used, it is a nsISchemaElement.
|
||||
*/
|
||||
readonly attribute nsISchemaComponent schemaComponent;
|
||||
|
||||
/**
|
||||
* The containing schema for the schemaComponent
|
||||
*/
|
||||
readonly attribute nsISchema schema;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac0-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLBinding : nsISupports {
|
||||
readonly attribute AString protocol;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
};
|
||||
|
||||
|
|
|
@ -27,21 +27,37 @@
|
|||
#include "nsAWritableString.h"
|
||||
%}
|
||||
|
||||
interface nsIWSDLService;
|
||||
interface nsIURI;
|
||||
interface nsIWSDLLoaderListener;
|
||||
interface nsIWSDLPort;
|
||||
interface nsIWSDLLoadListener;
|
||||
|
||||
[scriptable, uuid(0458dac5-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLLoader : nsISupports {
|
||||
nsIWSDLService load(in nsIURI wsdlURI);
|
||||
void loadAsync(in nsIURI wsdlURI, in nsIWSDLLoaderListener listener);
|
||||
nsISupports createServiceProxy(in nsIWSDLService service,
|
||||
in AString nameSpace);
|
||||
nsIWSDLPort load(in AString wsdlURI, in AString portName);
|
||||
void loadAsync(in AString wsdlURI, in AString portName,
|
||||
in nsIWSDLLoadListener listener);
|
||||
nsISupports createPortProxy(in nsIWSDLPort service,
|
||||
in AString nameSpace);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac6-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLLoaderListener : nsISupports {
|
||||
[scriptable, function, uuid(0458dac6-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLLoadListener : nsISupports {
|
||||
void onLoad(in nsIWSDLPort service);
|
||||
void onError(in PRInt32 status,
|
||||
in AString statusMessage);
|
||||
void onComplete(in nsIWSDLService service);
|
||||
};
|
||||
|
||||
%{ C++
|
||||
#define NS_WSDLLOADER_CID \
|
||||
{ /* 0a5af577-a61e-4492-ba0e-dd3c7b657e18 */ \
|
||||
0x0a5af577, 0xa61e, 0x4492, \
|
||||
{0xba, 0x0e, 0xdd, 0x3c, 0x7b, 0x65, 0x7e, 0x18}}
|
||||
|
||||
#define NS_WSDLLOADER_CONTRACTID "@mozilla.org/xmlextras/wsdl/wsdlloader;1"
|
||||
|
||||
#define NS_ERROR_WSDL_NOT_WSDL_ELEMENT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 1)
|
||||
#define NS_ERROR_WSDL_SCHEMA_PROCESSING_ERROR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 2)
|
||||
#define NS_ERROR_WSDL_BINDING_NOT_FOUND NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 3)
|
||||
#define NS_ERROR_WSDL_UNKNOWN_SCHEMA_COMPONENT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 4)
|
||||
#define NS_ERROR_WSDL_UNKNOWN_WSDL_COMPONENT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 5)
|
||||
#define NS_ERROR_WSDL_LOADING_ERROR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 6)
|
||||
%}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications. Portions created by Netscape Communications are
|
||||
* Copyright (C) 2001 by Netscape Communications. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vidur Apparao <vidur@netscape.com> (original author)
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIWSDL.idl"
|
||||
|
||||
%{ C++
|
||||
#include "nsAWritableString.h"
|
||||
%}
|
||||
|
||||
[scriptable, uuid(0458dac7-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPPortBinding : nsIWSDLBinding {
|
||||
const unsigned short STYLE_RPC = 1;
|
||||
const unsigned short STYLE_DOCUMENT = 2;
|
||||
|
||||
readonly attribute AString name;
|
||||
readonly attribute AString address;
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString transport;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac8-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPOperationBinding : nsIWSDLBinding {
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString soapAction;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac9-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPPartBinding : nsIWSDLBinding {
|
||||
const unsigned short LOCATION_BODY = 1;
|
||||
const unsigned short LOCATION_HEADER = 2;
|
||||
const unsigned short LOCATION_FAULT = 3;
|
||||
|
||||
const unsigned short USE_LITERAL = 1;
|
||||
const unsigned short USE_ENCODED = 2;
|
||||
|
||||
readonly attribute unsigned short location;
|
||||
readonly attribute unsigned short use;
|
||||
readonly attribute AString encodingStyle;
|
||||
readonly attribute AString namespace;
|
||||
};
|
|
@ -31,7 +31,8 @@ LIBRARY_NAME = xmlextraswsdl_s
|
|||
REQUIRES = xpcom string dom caps necko xpconnect
|
||||
|
||||
CPPSRCS = \
|
||||
nsWSDLLoader.cpp \
|
||||
nsWSDLLoader.cpp \
|
||||
nsWSDLDefinitions.cpp \
|
||||
$(NULL)
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a
|
||||
|
@ -39,3 +40,7 @@ CPPSRCS = \
|
|||
FORCE_STATIC_LIB = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
INCLUDES += \
|
||||
-I$(srcdir)/../../schema/src \
|
||||
$(NULL)
|
||||
|
|
|
@ -0,0 +1,785 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications. Portions created by Netscape Communications are
|
||||
* Copyright (C) 2001 by Netscape Communications. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vidur Apparao <vidur@netscape.com> (original author)
|
||||
*/
|
||||
|
||||
#include "nsWSDLPrivate.h"
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLPort implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsWSDLPort::nsWSDLPort(const nsAReadableString& aName)
|
||||
: mName(aName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWSDLPort::~nsWSDLPort()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsWSDLPort, nsIWSDLPort)
|
||||
|
||||
/* readonly attribute AString name; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetName(nsAWritableString & aName)
|
||||
{
|
||||
aName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute PRUint32 operationCount; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetOperationCount(PRUint32 *aOperationCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aOperationCount);
|
||||
|
||||
return mOperations.Count(aOperationCount);
|
||||
}
|
||||
|
||||
/* nsIWSDLOperation getOperation (in PRUint32 index); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetOperation(PRUint32 index, nsIWSDLOperation **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
return mOperations.QueryElementAt(index, NS_GET_IID(nsIWSDLOperation),
|
||||
(void**)_retval);
|
||||
}
|
||||
|
||||
/* nsIWSDLOperation getOperationByName(in AString name); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetOperationByName(const nsAReadableString& aName,
|
||||
nsIWSDLOperation** aOperation)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
*aOperation = nsnull;
|
||||
|
||||
// XXX Do a linear search for now. If more efficiency is needed
|
||||
// we can store the opeartions in a hash as well.
|
||||
PRUint32 index, count;
|
||||
mOperations.Count(&count);
|
||||
|
||||
for (index = 0; index < count; index++) {
|
||||
nsCOMPtr<nsIWSDLOperation> operation;
|
||||
|
||||
rv = mOperations.QueryElementAt(index, NS_GET_IID(nsIWSDLOperation),
|
||||
getter_AddRefs(operation));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAutoString name;
|
||||
operation->GetName(name);
|
||||
|
||||
if (name.Equals(aName)) {
|
||||
*aOperation = operation;
|
||||
NS_ADDREF(*aOperation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetBinding(nsIWSDLBinding** aBinding)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aBinding);
|
||||
|
||||
*aBinding = mBinding;
|
||||
NS_IF_ADDREF(*aBinding);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::AddOperation(nsIWSDLOperation* aOperation)
|
||||
{
|
||||
NS_ENSURE_ARG(aOperation);
|
||||
|
||||
return mOperations.AppendElement(aOperation);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::SetBinding(nsIWSDLBinding* aBinding)
|
||||
{
|
||||
mBinding = aBinding;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsSOAPPortBinding implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsSOAPPortBinding::nsSOAPPortBinding(const nsAReadableString& aName)
|
||||
: mName(aName), mStyle(STYLE_RPC)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsSOAPPortBinding::~nsSOAPPortBinding()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2_CI(nsSOAPPortBinding,
|
||||
nsIWSDLBinding,
|
||||
nsISOAPPortBinding)
|
||||
|
||||
/* readonly attribute AString protocol; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetProtocol(nsAWritableString& aProtocol)
|
||||
{
|
||||
aProtocol.Assign(NS_LITERAL_STRING("soap"));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString bindingName; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetName(nsAWritableString & aBindingName)
|
||||
{
|
||||
aBindingName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString address; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetAddress(nsAWritableString & aAddress)
|
||||
{
|
||||
aAddress.Assign(mAddress);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short style; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetStyle(PRUint16 *aStyle)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aStyle);
|
||||
|
||||
*aStyle = mStyle;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString transport; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetTransport(nsAWritableString & aTransport)
|
||||
{
|
||||
aTransport.Assign(mTransport);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetAddress(const nsAReadableString& aAddress)
|
||||
{
|
||||
mAddress.Assign(aAddress);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetStyle(PRUint16 aStyle)
|
||||
{
|
||||
mStyle = aStyle;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetTransport(const nsAReadableString& aTransport)
|
||||
{
|
||||
mTransport.Assign(aTransport);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLOperation implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsWSDLOperation::nsWSDLOperation(const nsAReadableString &aName)
|
||||
: mName(aName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWSDLOperation::~nsWSDLOperation()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsWSDLOperation, nsIWSDLOperation)
|
||||
|
||||
/* readonly attribute AString name; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetName(nsAWritableString & aName)
|
||||
{
|
||||
aName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIWSDLMessage input; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetInput(nsIWSDLMessage * *aInput)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aInput);
|
||||
|
||||
*aInput = mInputMessage;
|
||||
NS_IF_ADDREF(*aInput);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIWSDLMessage output; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetOutput(nsIWSDLMessage * *aOutput)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aOutput);
|
||||
|
||||
*aOutput = mOutputMessage;
|
||||
NS_IF_ADDREF(*aOutput);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute PRUint32 faultCount; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetFaultCount(PRUint32* aCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCount);
|
||||
|
||||
return mFaultMessages.Count(aCount);
|
||||
}
|
||||
|
||||
/* nsIWSDLMessage getFault(in PRUint32 index); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetFault(PRUint32 aIndex, nsIWSDLMessage * *aFault)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aFault);
|
||||
|
||||
return mFaultMessages.QueryElementAt(aIndex, NS_GET_IID(nsIWSDLMessage),
|
||||
(void**)aFault);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetBinding(nsIWSDLBinding** aBinding)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aBinding);
|
||||
|
||||
*aBinding = mBinding;
|
||||
NS_IF_ADDREF(*aBinding);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute PRUint32 parameterCount; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetParameterCount(PRUint32 *aParameterCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParameterCount);
|
||||
|
||||
*aParameterCount = (PRUint32)mParameters.Count();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* AString getParameter (in PRUint32 index); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetParameter(PRUint32 index, nsAWritableString & _retval)
|
||||
{
|
||||
nsString* str = mParameters.StringAt((PRInt32)index);
|
||||
if (!str) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
_retval.Assign(*str);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::SetInput(nsIWSDLMessage* aInputMessage)
|
||||
{
|
||||
mInputMessage = aInputMessage;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::SetOutput(nsIWSDLMessage* aOutputMessage)
|
||||
{
|
||||
mOutputMessage = aOutputMessage;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::AddFault(nsIWSDLMessage* aFaultMessage)
|
||||
{
|
||||
NS_ENSURE_ARG(aFaultMessage);
|
||||
|
||||
return mFaultMessages.AppendElement(aFaultMessage);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::SetBinding(nsIWSDLBinding* aBinding)
|
||||
{
|
||||
mBinding = aBinding;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::AddParameter(const nsAReadableString& aParameter)
|
||||
{
|
||||
mParameters.AppendString(aParameter);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsSOAPOperationBinding implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsSOAPOperationBinding::nsSOAPOperationBinding()
|
||||
: mStyle(nsISOAPPortBinding::STYLE_RPC)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsSOAPOperationBinding::~nsSOAPOperationBinding()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2_CI(nsSOAPOperationBinding,
|
||||
nsIWSDLBinding,
|
||||
nsISOAPOperationBinding)
|
||||
|
||||
/* readonly attribute AString protocol; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::GetProtocol(nsAWritableString& aProtocol)
|
||||
{
|
||||
aProtocol.Assign(NS_LITERAL_STRING("soap"));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short style; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::GetStyle(PRUint16 *aStyle)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aStyle);
|
||||
|
||||
*aStyle = mStyle;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString soapAction; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::GetSoapAction(nsAWritableString & aSoapAction)
|
||||
{
|
||||
aSoapAction.Assign(mSoapAction);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::SetStyle(PRUint16 aStyle)
|
||||
{
|
||||
mStyle = aStyle;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::SetSoapAction(const nsAReadableString& aAction)
|
||||
{
|
||||
mSoapAction.Assign(aAction);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLMessage implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsWSDLMessage::nsWSDLMessage(const nsAReadableString& aName)
|
||||
: mName(aName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWSDLMessage::~nsWSDLMessage()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsWSDLMessage, nsIWSDLMessage)
|
||||
|
||||
/* readonly attribute AString name; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetName(nsAWritableString & aName)
|
||||
{
|
||||
aName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute PRUint32 partCount; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetPartCount(PRUint32 *aPartCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPartCount);
|
||||
|
||||
return mParts.Count(aPartCount);
|
||||
}
|
||||
|
||||
/* nsIWSDLPart getPart (in PRUint32 index); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetPart(PRUint32 index, nsIWSDLPart **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
return mParts.QueryElementAt(index, NS_GET_IID(nsIWSDLPart),
|
||||
(void**)_retval);
|
||||
|
||||
}
|
||||
|
||||
/* nsIWSDLPart getPartByName(in AString name); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetPartByName(const nsAReadableString& aName,
|
||||
nsIWSDLPart** aPart)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
*aPart = nsnull;
|
||||
// XXX Do a linear search for now. If more efficiency is needed
|
||||
// we can store the part in a hash as well.
|
||||
PRUint32 index, count;
|
||||
mParts.Count(&count);
|
||||
|
||||
for (index = 0; index < count; index++) {
|
||||
nsCOMPtr<nsIWSDLPart> part;
|
||||
|
||||
rv = mParts.QueryElementAt(index, NS_GET_IID(nsIWSDLPart),
|
||||
getter_AddRefs(part));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAutoString name;
|
||||
part->GetName(name);
|
||||
|
||||
if (name.Equals(aName)) {
|
||||
*aPart = part;
|
||||
NS_ADDREF(*aPart);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::AddPart(nsIWSDLPart* aPart)
|
||||
{
|
||||
NS_ENSURE_ARG(aPart);
|
||||
|
||||
return mParts.AppendElement(aPart);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLPart implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsWSDLPart::nsWSDLPart(const nsAReadableString& aName)
|
||||
: mName(aName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWSDLPart::~nsWSDLPart()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsWSDLPart, nsIWSDLPart)
|
||||
|
||||
/* readonly attribute AString name; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetName(nsAWritableString & aName)
|
||||
{
|
||||
aName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString type; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetType(nsAWritableString & aType)
|
||||
{
|
||||
aType.Assign(mType);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString elementName; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetElementName(nsAWritableString & aElementName)
|
||||
{
|
||||
aElementName.Assign(mElementName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsISchemaComponent schemaComponent; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetSchemaComponent(nsISchemaComponent * *aSchemaComponent)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSchemaComponent);
|
||||
|
||||
*aSchemaComponent = mSchemaComponent;
|
||||
NS_IF_ADDREF(*aSchemaComponent);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetBinding(nsIWSDLBinding** aBinding)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aBinding);
|
||||
|
||||
*aBinding = mBinding;
|
||||
NS_IF_ADDREF(*aBinding);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::SetTypeInfo(const nsAReadableString& aType,
|
||||
const nsAReadableString& aElementName,
|
||||
nsISchemaComponent* aSchemaComponent)
|
||||
{
|
||||
mType.Assign(aType);
|
||||
mElementName.Assign(aElementName);
|
||||
mSchemaComponent = aSchemaComponent;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::SetBinding(nsIWSDLBinding* aBinding)
|
||||
{
|
||||
mBinding = aBinding;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsSOAPPartBinding implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsSOAPPartBinding::nsSOAPPartBinding(PRUint16 aLocation, PRUint16 aUse,
|
||||
const nsAReadableString& aEncodingStyle,
|
||||
const nsAReadableString& aNamespace)
|
||||
: mLocation(aLocation), mUse(aUse),
|
||||
mEncodingStyle(aEncodingStyle), mNamespace(aNamespace)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsSOAPPartBinding::~nsSOAPPartBinding()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2_CI(nsSOAPPartBinding,
|
||||
nsIWSDLBinding,
|
||||
nsISOAPPartBinding)
|
||||
|
||||
/* readonly attribute AString protocol; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetProtocol(nsAWritableString& aProtocol)
|
||||
{
|
||||
aProtocol.Assign(NS_LITERAL_STRING("soap"));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = nsnull;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short location; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetLocation(PRUint16 *aLocation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aLocation);
|
||||
|
||||
*aLocation = mLocation;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short use; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetUse(PRUint16 *aUse)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aUse);
|
||||
|
||||
*aUse = mUse;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString encodingStyle; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetEncodingStyle(nsAWritableString & aEncodingStyle)
|
||||
{
|
||||
aEncodingStyle.Assign(mEncodingStyle);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString namespace; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetNamespace(nsAWritableString & aNamespace)
|
||||
{
|
||||
aNamespace.Assign(mNamespace);
|
||||
|
||||
return NS_OK;
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,211 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications. Portions created by Netscape Communications are
|
||||
* Copyright (C) 2001 by Netscape Communications. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vidur Apparao <vidur@netscape.com> (original author)
|
||||
*/
|
||||
|
||||
#ifndef __nsWSDLLoader_h__
|
||||
#define __nsWSDLLoader_h__
|
||||
|
||||
#include "nsIWSDLLoader.h"
|
||||
#include "nsWSDLPrivate.h"
|
||||
|
||||
#include "nsDOMUtils.h"
|
||||
|
||||
// XPCOM Includes
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsError.h"
|
||||
|
||||
// Loading includes
|
||||
#include "nsIURI.h"
|
||||
#include "nsIXMLHTTPRequest.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
|
||||
// schema includes
|
||||
#include "nsISchemaLoader.h"
|
||||
|
||||
// DOM includes
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
#define NS_ERROR_WSDL_LOADPENDING NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 1)
|
||||
|
||||
class nsWSDLAtoms {
|
||||
public:
|
||||
static void CreateWSDLAtoms();
|
||||
static void DestroyWSDLAtoms();
|
||||
|
||||
static nsIAtom* sDefinitions_atom;
|
||||
static nsIAtom* sTypes_atom;
|
||||
static nsIAtom* sMessage_atom;
|
||||
static nsIAtom* sPortType_atom;
|
||||
static nsIAtom* sBinding_atom;
|
||||
static nsIAtom* sService_atom;
|
||||
static nsIAtom* sPort_atom;
|
||||
static nsIAtom* sOperation_atom;
|
||||
static nsIAtom* sPart_atom;
|
||||
static nsIAtom* sDocumentation_atom;
|
||||
static nsIAtom* sImport_atom;
|
||||
static nsIAtom* sInput_atom;
|
||||
static nsIAtom* sOutput_atom;
|
||||
static nsIAtom* sFault_atom;
|
||||
|
||||
static nsIAtom* sBody_atom;
|
||||
static nsIAtom* sHeader_atom;
|
||||
static nsIAtom* sHeaderFault_atom;
|
||||
static nsIAtom* sAddress_atom;
|
||||
};
|
||||
|
||||
class nsWSDLLoader : public nsIWSDLLoader {
|
||||
public:
|
||||
nsWSDLLoader();
|
||||
virtual ~nsWSDLLoader();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLLOADER
|
||||
|
||||
protected:
|
||||
nsresult GetResolvedURI(const nsAReadableString& aSchemaURI,
|
||||
const char* aMethod,
|
||||
nsIURI** aURI);
|
||||
|
||||
protected:
|
||||
nsWSDLPort* mPort;
|
||||
};
|
||||
|
||||
|
||||
class nsWSDLLoadingContext {
|
||||
public:
|
||||
nsWSDLLoadingContext(nsIDOMDocument* aDocument,
|
||||
const nsAReadableString& aLocation) :
|
||||
mDocument(aDocument), mChildIndex(0), mDocumentLocation(aLocation) {
|
||||
}
|
||||
~nsWSDLLoadingContext() {
|
||||
}
|
||||
|
||||
void GetRootElement(nsIDOMElement** aElement) {
|
||||
mDocument->GetDocumentElement(aElement);
|
||||
}
|
||||
|
||||
PRUint32 GetChildIndex() { return mChildIndex; }
|
||||
void SetChildIndex(PRUint32 aChildIndex) { mChildIndex = aChildIndex; }
|
||||
|
||||
void GetTargetNamespace(nsAWritableString& aNamespace) {
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
GetRootElement(getter_AddRefs(element));
|
||||
if (element) {
|
||||
element->GetAttribute(NS_LITERAL_STRING("targetNamespace"),
|
||||
aNamespace);
|
||||
}
|
||||
else {
|
||||
aNamespace.Truncate();
|
||||
}
|
||||
}
|
||||
|
||||
void GetDocumentLocation(nsAWritableString& aLocation) {
|
||||
aLocation.Assign(mDocumentLocation);
|
||||
}
|
||||
|
||||
protected:
|
||||
// XXX hold onto the document till issues related to dangling
|
||||
// document pointers in content are fixed. After that, just
|
||||
// hold onto the root element.
|
||||
nsCOMPtr<nsIDOMDocument> mDocument;
|
||||
PRUint32 mChildIndex;
|
||||
nsString mDocumentLocation;
|
||||
};
|
||||
|
||||
class nsWSDLLoadRequest : public nsIDOMEventListener
|
||||
{
|
||||
public:
|
||||
nsWSDLLoadRequest(PRBool aIsSync,
|
||||
nsIWSDLLoadListener* aListener,
|
||||
const nsAReadableString& aPortName);
|
||||
virtual ~nsWSDLLoadRequest();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMEVENTLISTENER
|
||||
|
||||
nsresult LoadDefinition(const nsAReadableString& aURI);
|
||||
nsresult ResumeProcessing();
|
||||
nsresult ContineProcessingTillDone();
|
||||
nsresult GetPort(nsIWSDLPort** aPort);
|
||||
|
||||
nsresult PushContext(nsIDOMDocument* aDocument,
|
||||
const nsAReadableString& aLocation);
|
||||
nsWSDLLoadingContext* GetCurrentContext();
|
||||
void PopContext();
|
||||
|
||||
nsresult GetSchemaElement(const nsAReadableString& aName,
|
||||
const nsAReadableString& aNamespace,
|
||||
nsISchemaElement** aSchemaComponent);
|
||||
nsresult GetSchemaType(const nsAReadableString& aName,
|
||||
const nsAReadableString& aNamespace,
|
||||
nsISchemaType** aSchemaComponent);
|
||||
nsresult GetMessage(const nsAReadableString& aName,
|
||||
const nsAReadableString& aNamespace,
|
||||
nsIWSDLMessage** aMessage);
|
||||
nsresult GetPortType(const nsAReadableString& aName,
|
||||
const nsAReadableString& aNamespace,
|
||||
nsIWSDLPort** aPort);
|
||||
|
||||
nsresult ProcessImportElement(nsIDOMElement* aElement,
|
||||
PRUint32 aIndex);
|
||||
nsresult ProcessTypesElement(nsIDOMElement* aElement);
|
||||
nsresult ProcessMessageElement(nsIDOMElement* aElement);
|
||||
nsresult ProcessAbstractPartElement(nsIDOMElement* aElement,
|
||||
nsWSDLMessage* aMessage);
|
||||
nsresult ProcessPortTypeElement(nsIDOMElement* aElement);
|
||||
nsresult ProcessAbstractOperation(nsIDOMElement* aElement,
|
||||
nsWSDLPort* aPort);
|
||||
nsresult ProcessOperationComponent(nsIDOMElement* aElement,
|
||||
nsIWSDLMessage** aMessage);
|
||||
nsresult ProcessMessageBinding(nsIDOMElement* aElement,
|
||||
nsIWSDLMessage* aMessage);
|
||||
nsresult ProcessOperationBinding(nsIDOMElement* aElement,
|
||||
nsIWSDLPort* aPort);
|
||||
nsresult ProcessBindingElement(nsIDOMElement* aElement);
|
||||
nsresult ProcessPortBinding(nsIDOMElement* aElement);
|
||||
nsresult ProcessServiceElement(nsIDOMElement* aElement);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIWSDLLoadListener> mListener;
|
||||
nsCOMPtr<nsIXMLHttpRequest> mRequest;
|
||||
nsCOMPtr<nsISchemaLoader> mSchemaLoader;
|
||||
|
||||
PRBool mIsSync;
|
||||
|
||||
nsCOMPtr<nsIWSDLPort> mPort;
|
||||
nsString mPortName;
|
||||
nsString mBindingName;
|
||||
nsString mBindingNamespace;
|
||||
nsString mAddress;
|
||||
|
||||
nsVoidArray mContextStack;
|
||||
|
||||
nsSupportsHashtable mTypes;
|
||||
nsSupportsHashtable mMessages;
|
||||
nsSupportsHashtable mPortTypes;
|
||||
};
|
||||
|
||||
#endif // __nsWSDLLoader_h__
|
|
@ -25,138 +25,220 @@
|
|||
#define __nsWSDLPrivate_h__
|
||||
|
||||
#include "nsIWSDL.h"
|
||||
#include "nsIWSDLLoader.h"
|
||||
#include "nsIWSDLSOAPBinding.h"
|
||||
|
||||
// DOM Includes
|
||||
#include "nsIDOMElement.h"
|
||||
|
||||
// Schema includes
|
||||
#include "nsISchema.h"
|
||||
|
||||
// XPCOM Includes
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsWSDLLoader : public nsIWSDLLoader {
|
||||
#define NS_WSDL_SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema"
|
||||
#define NS_WSDL_NAMESPACE "http://schemas.xmlsoap.org/wsdl/"
|
||||
#define NS_WSDL_SOAP_NAMESPACE "http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
|
||||
class nsSOAPPortBinding : public nsISOAPPortBinding {
|
||||
public:
|
||||
nsWSDLLoader();
|
||||
virtual ~nsWSDLLoader();
|
||||
|
||||
nsSOAPPortBinding(const nsAReadableString& aName);
|
||||
virtual ~nsSOAPPortBinding();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLLOADER
|
||||
};
|
||||
NS_DECL_NSIWSDLBINDING
|
||||
NS_DECL_NSISOAPPORTBINDING
|
||||
|
||||
class nsWSDLService : public nsIWSDLService {
|
||||
public:
|
||||
nsWSDLService();
|
||||
virtual ~nsWSDLService();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLSERVICE
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD AddPort(nsIWSDLPort* aPort);
|
||||
NS_IMETHOD SetAddress(const nsAReadableString& aAddress);
|
||||
NS_IMETHOD SetStyle(PRUint16 aStyle);
|
||||
NS_IMETHOD SetTransport(const nsAReadableString& aTransport);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsString mAddress;
|
||||
PRUint16 mStyle;
|
||||
nsString mTransport;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
nsSupportsArray mPorts;
|
||||
};
|
||||
|
||||
class nsWSDLPort : public nsIWSDLPort {
|
||||
public:
|
||||
nsWSDLPort();
|
||||
nsWSDLPort(const nsAReadableString &aName);
|
||||
virtual ~nsWSDLPort();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLPORT
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD SetBindingInfo(const nsAReadableString& aBindingName,
|
||||
PRUint16 aStyle,
|
||||
const nsAReadableString& aTransport);
|
||||
NS_IMETHOD AddOperation(nsIWSDLOperation* aOperation);
|
||||
NS_IMETHOD SetBinding(nsIWSDLBinding* aBinding);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
nsString mBindingName;
|
||||
PRUint16 mStyle;
|
||||
nsString mTransport;
|
||||
nsSupportsArray mOperations;
|
||||
nsCOMPtr<nsIWSDLBinding> mBinding;
|
||||
};
|
||||
|
||||
class nsSOAPOperationBinding : public nsISOAPOperationBinding {
|
||||
public:
|
||||
nsSOAPOperationBinding();
|
||||
virtual ~nsSOAPOperationBinding();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLBINDING
|
||||
NS_DECL_NSISOAPOPERATIONBINDING
|
||||
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD SetStyle(PRUint16 aStyle);
|
||||
NS_IMETHOD SetSoapAction(const nsAReadableString& aAction);
|
||||
|
||||
protected:
|
||||
PRUint16 mStyle;
|
||||
nsString mSoapAction;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
};
|
||||
|
||||
class nsWSDLOperation : public nsIWSDLOperation {
|
||||
public:
|
||||
nsWSDLOperation();
|
||||
nsWSDLOperation(const nsAReadableString &aName);
|
||||
virtual ~nsWSDLOperation();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLOPERATION
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD SetBindingInfo(PRUint16 aStyle,
|
||||
const nsAReadableString& aSoapAction);
|
||||
NS_IMETHOD SetInputMessage(nsIWSDLMessage* aInputMessage);
|
||||
NS_IMETHOD SetOutputMessage(nsIWSDLMessage* aOutputMessage);
|
||||
NS_IMETHOD SetFaultMessage(nsIWSDLMessage* aFaultMessage);
|
||||
NS_IMETHOD SetInput(nsIWSDLMessage* aInputMessage);
|
||||
NS_IMETHOD SetOutput(nsIWSDLMessage* aOutputMessage);
|
||||
NS_IMETHOD AddFault(nsIWSDLMessage* aFaultMessage);
|
||||
NS_IMETHOD AddParameter(const nsAReadableString& aParameter);
|
||||
NS_IMETHOD SetBinding(nsIWSDLBinding* aBinding);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
PRUint16 mStyle;
|
||||
nsString mSoapAction;
|
||||
nsCOMPtr<nsIWSDLMessage> mInputMessage;
|
||||
nsCOMPtr<nsIWSDLMessage> mOutputMessage;
|
||||
nsCOMPtr<nsIWSDLMessage> mFaultMessage;
|
||||
nsSupportsArray mFaultMessages;
|
||||
nsStringArray mParameters;
|
||||
nsCOMPtr<nsIWSDLBinding> mBinding;
|
||||
};
|
||||
|
||||
class nsWSDLMessage : public nsIWSDLMessage {
|
||||
public:
|
||||
nsWSDLMessage();
|
||||
nsWSDLMessage(const nsAReadableString& aName);
|
||||
virtual ~nsWSDLMessage();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLMESSAGE
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD SetBindingInfo(PRUint16 aLocation, PRUint16 aUse,
|
||||
const nsAReadableString& aEncodingStyle,
|
||||
const nsAReadableString& aNamespace);
|
||||
NS_IMETHOD AddPart(nsIWSDLPart* aPart);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
nsSupportsArray mParts;
|
||||
};
|
||||
|
||||
class nsSOAPPartBinding : public nsISOAPPartBinding {
|
||||
public:
|
||||
nsSOAPPartBinding(PRUint16 aLocation, PRUint16 aUse,
|
||||
const nsAReadableString& aEncodingStyle,
|
||||
const nsAReadableString& aNamespace);
|
||||
virtual ~nsSOAPPartBinding();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLBINDING
|
||||
NS_DECL_NSISOAPPARTBINDING
|
||||
|
||||
protected:
|
||||
PRUint16 mLocation;
|
||||
PRUint16 mUse;
|
||||
nsString mEncodingStyle;
|
||||
nsString mNamespace;
|
||||
nsSupportsArray mParts;
|
||||
nsString mNamespace;
|
||||
};
|
||||
|
||||
class nsWSDLPart : public nsIWSDLPart {
|
||||
public:
|
||||
nsWSDLPart();
|
||||
nsWSDLPart(const nsAReadableString& aName);
|
||||
virtual ~nsWSDLPart();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLPART
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetTypeInfo(const nsAReadableString& aType,
|
||||
const nsAReadableString& aElementName,
|
||||
nsIDOMElement* aSchema,
|
||||
nsIDOMElement* aSchemaRoot);
|
||||
nsISchemaComponent* aSchemaComponent);
|
||||
NS_IMETHOD SetBinding(nsIWSDLBinding* aBinding);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsString mType;
|
||||
nsString mElementName;
|
||||
nsCOMPtr<nsIDOMElement> mSchema;
|
||||
nsCOMPtr<nsIDOMElement> mSchemaRoot;
|
||||
nsCOMPtr<nsISchemaComponent> mSchemaComponent;
|
||||
nsCOMPtr<nsIWSDLBinding> mBinding;
|
||||
};
|
||||
|
||||
|
||||
#define NS_WSDLPORT_CID \
|
||||
{ /* c1dfb250-0c19-4339-8211-24eabc0103e5 */ \
|
||||
0xc1dfb250, 0x0c19, 0x4339, \
|
||||
{0x82, 0x11, 0x24, 0xea, 0xbc, 0x01, 0x03, 0xe5}}
|
||||
|
||||
#define NS_WSDLPORT_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/wsdlport;1"
|
||||
|
||||
#define NS_WSDLOPERATION_CID \
|
||||
{ /* cf54bdf5-20de-45ef-b6c8-aa535007549a */ \
|
||||
0xcf54bdf5, 0x20de, 0x45ef, \
|
||||
{0xb6, 0xc8, 0xaa, 0x53, 0x50, 0x07, 0x54, 0x9a}}
|
||||
|
||||
#define NS_WSDLOPERATION_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/wsdloperation;1"
|
||||
|
||||
#define NS_WSDLMESSAGE_CID \
|
||||
{ /* 36b26cab-3eed-4c7c-81ad-94c8b1eb9ebe */ \
|
||||
0x36b26cab, 0x3eed, 0x4c7c, \
|
||||
{0x81, 0xad, 0x94, 0xc8, 0xb1, 0xeb, 0x9e, 0xbe}}
|
||||
|
||||
#define NS_WSDLMESSAGE_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/wsdlmessage;1"
|
||||
|
||||
#define NS_WSDLPART_CID \
|
||||
{ /* 1841ebe8-5bdc-4e79-bcf4-329785318491 */ \
|
||||
0x1841ebe8, 0x5bdc, 0x4e79, \
|
||||
{0xbc, 0xf4, 0x32, 0x97, 0x85, 0x31, 0x84, 0x91}}
|
||||
|
||||
#define NS_WSDLPART_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/wsdlpart;1"
|
||||
|
||||
#define NS_SOAPPORTBINDING_CID \
|
||||
{ /* a9155950-e49d-4123-93b7-e263a3af2b32 */ \
|
||||
0xa9155950, 0xe49d, 0x4123, \
|
||||
{0x93, 0xb7, 0xe2, 0x63, 0xa3, 0xaf, 0x2b, 0x32}}
|
||||
|
||||
#define NS_SOAPPORTBINDING_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/soapportbinding;1"
|
||||
|
||||
#define NS_SOAPOPERATIONBINDING_CID \
|
||||
{ /* f5230937-4af6-43fb-9766-1890896632b2 */ \
|
||||
0xf5230937, 0x4af6, 0x43fb, \
|
||||
{0x97, 0x66, 0x18, 0x90, 0x89, 0x66, 0x32, 0xb2}}
|
||||
|
||||
#define NS_SOAPOPERATIONBINDING_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/soapoperationbinding;1"
|
||||
|
||||
#define NS_SOAPPARTBINDING_CID \
|
||||
{ /* b7698d5c-06cc-45fe-b6bc-88e32a9f970e */ \
|
||||
0xb7698d5c, 0x06cc, 0x45fe, \
|
||||
{0xb6, 0xbc, 0x88, 0xe3, 0x2a, 0x9f, 0x97, 0x0e}}
|
||||
|
||||
#define NS_SOAPPARTBINDING_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/soappartbinding;1"
|
||||
|
||||
#endif // __nsWSDLPrivate_h__
|
||||
|
|
|
@ -27,10 +27,12 @@ VPATH = @srcdir@
|
|||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MODULE = xmlextras
|
||||
XPIDL_MODULE = wsdl
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\nsIWSDL.idl \
|
||||
.\nsIWSDLLoader.idl \
|
||||
nsIWSDL.idl \
|
||||
nsIWSDLSOAPBinding.idl \
|
||||
nsIWSDLLoader.idl \
|
||||
$(NULL)
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -22,9 +22,11 @@
|
|||
DEPTH=..\..\..\..
|
||||
|
||||
XPIDLSRCS = .\nsIWSDL.idl \
|
||||
.\nsIWSDLSOAPBinding.idl \
|
||||
.\nsIWSDLLoader.idl \
|
||||
$(NULL)
|
||||
|
||||
MODULE=xmlextras
|
||||
XPIDL_MODULE=wsdl
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
|
|
@ -22,42 +22,29 @@
|
|||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsISchema.idl"
|
||||
|
||||
%{ C++
|
||||
#include "nsAWritableString.h"
|
||||
%}
|
||||
|
||||
interface nsIWSDLService;
|
||||
interface nsIWSDLBinding;
|
||||
interface nsIWSDLPort;
|
||||
interface nsIWSDLOperation;
|
||||
interface nsIWSDLMessage;
|
||||
interface nsIWSDLPart;
|
||||
interface nsIDOMElement;
|
||||
interface nsISchemaComponent;
|
||||
interface nsISchema;
|
||||
|
||||
[scriptable, uuid(0458dac0-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLService : nsISupports {
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
readonly attribute PRUint32 portCount;
|
||||
nsIWSDLPort getPort(in PRUint32 index);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac1-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLPort : nsISupports {
|
||||
const unsigned short STYLE_RPC = 1;
|
||||
const unsigned short STYLE_DOCUMENT = 2;
|
||||
|
||||
interface nsIWSDLPort : nsISupports {
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute AString bindingName;
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString transport;
|
||||
readonly attribute nsIWSDLBinding binding;
|
||||
|
||||
readonly attribute PRUint32 operationCount;
|
||||
nsIWSDLOperation getOperation(in PRUint32 index);
|
||||
nsIWSDLOperation getOperationByName(in AString name);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac2-65de-11d5-9b42-00104bdf5339)]
|
||||
|
@ -65,38 +52,32 @@ interface nsIWSDLOperation : nsISupports {
|
|||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString soapAction;
|
||||
readonly attribute nsIWSDLBinding binding;
|
||||
|
||||
readonly attribute nsIWSDLMessage input;
|
||||
readonly attribute nsIWSDLMessage output;
|
||||
readonly attribute nsIWSDLMessage fault;
|
||||
readonly attribute PRUint32 faultCount;
|
||||
nsIWSDLMessage getFault(in PRUint32 index);
|
||||
|
||||
readonly attribute PRUint32 parameterCount;
|
||||
AString getParameter(in PRUint32 index);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac3-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLMessage : nsISupports {
|
||||
const unsigned short LOCATION_SOAP_BODY = 1;
|
||||
const unsigned short LOCATION_SOAP_HEADER = 2;
|
||||
const unsigned short LOCATION_SOAP_FAULT = 3;
|
||||
|
||||
const unsigned short USE_LITERAL = 1;
|
||||
const unsigned short USE_ENCODED = 2;
|
||||
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute unsigned short location;
|
||||
readonly attribute unsigned short use;
|
||||
readonly attribute AString encodingStyle;
|
||||
readonly attribute AString namespace;
|
||||
|
||||
readonly attribute PRUint32 partCount;
|
||||
nsIWSDLPart getPart(in PRUint32 index);
|
||||
nsIWSDLPart getPartByName(in AString name);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac4-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLPart : nsISupports {
|
||||
readonly attribute AString name;
|
||||
|
||||
readonly attribute nsIWSDLBinding binding;
|
||||
|
||||
readonly attribute AString type;
|
||||
readonly attribute AString elementName;
|
||||
|
@ -107,9 +88,11 @@ interface nsIWSDLPart : nsISupports {
|
|||
* elementName attribute is used, it is a nsISchemaElement.
|
||||
*/
|
||||
readonly attribute nsISchemaComponent schemaComponent;
|
||||
|
||||
/**
|
||||
* The containing schema for the schemaComponent
|
||||
*/
|
||||
readonly attribute nsISchema schema;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac0-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLBinding : nsISupports {
|
||||
readonly attribute AString protocol;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
};
|
||||
|
||||
|
|
|
@ -0,0 +1,171 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications. Portions created by Netscape Communications are
|
||||
* Copyright (C) 2001 by Netscape Communications. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vidur Apparao <vidur@netscape.com> (original author)
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
|
||||
/*
|
||||
* XXX Currently not in use, but a better representation of a WSDL
|
||||
* definition. In this case, the binding refers to the abstract
|
||||
* construct for each of port, operation, message and part, not the
|
||||
* other way. The SOAP-specific binding data is retrieved using a
|
||||
* set of interfaces derived from the base binding interfaces.
|
||||
*
|
||||
* This scheme would probably yield a more efficient and reusable
|
||||
* internal structure, but is more complex to use relative to the one
|
||||
* where the abstract constructs refer to the corresponding binding
|
||||
* information.
|
||||
*/
|
||||
|
||||
%{ C++
|
||||
#include "nsAWritableString.h"
|
||||
%}
|
||||
|
||||
interface nsIWSDLPort;
|
||||
interface nsIWSDLOperation;
|
||||
interface nsIWSDLMessage;
|
||||
interface nsIWSDLPart;
|
||||
interface nsIDOMElement;
|
||||
interface nsISchemaComponent;
|
||||
interface nsISchema;
|
||||
|
||||
[scriptable, uuid(0458dac1-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLPortType : nsISupports {
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute PRUint32 operationCount;
|
||||
nsIWSDLOperation getOperation(in PRUint32 index);
|
||||
nsIWSDLOperation getOperationByName(in AString name);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458daca-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLPortBinding : nsISupports {
|
||||
readonly attribute AString name;
|
||||
readonly attribute AString protocol;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute nsIWSDLPortType;
|
||||
readonly attribute PRUint32 operationCount;
|
||||
nsIWSDLOperationBinding getOperation(in PRUint32 index);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac2-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLOperation : nsISupports {
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute nsIWSDLMessage input;
|
||||
readonly attribute nsIWSDLMessage output;
|
||||
readonly attribute PRUint32 faultCount;
|
||||
nsIWSDLMessage getFault(in PRUint32 index);
|
||||
|
||||
readonly attribute PRUint32 parameterCount;
|
||||
AString getParameter(in PRUint32 index);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dacb-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLOperationBinding : nsISupports {
|
||||
readonly attribute AString protocol;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute nsIWSDLOperation;
|
||||
|
||||
readonly attribute nsIWSDLMessageBinding input;
|
||||
readonly attribute nsIWSDLMessageBinding output;
|
||||
readonly attribute PRUint32 faultCount;
|
||||
nsIWSDLMessageBinding getFault(in PRUint32 index);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac3-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLMessage : nsISupports {
|
||||
readonly attribute AString name;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute PRUint32 partCount;
|
||||
nsIWSDLPart getPart(in PRUint32 index);
|
||||
nsIWSDLPart getPartByName(in AString name);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dacc-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLMessageBinding : nsISupports {
|
||||
readonly attribute AString protocol;
|
||||
readonly attribute nsIDOMElement documentation;
|
||||
|
||||
readonly attribute nsIWSDLMessage;
|
||||
|
||||
readonly attribute PRUint32 partCount;
|
||||
nsIWSDLPartBinding getPart(in PRUint32 index);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac4-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLPart : nsISupports {
|
||||
readonly attribute AString name;
|
||||
|
||||
readonly attribute AString type;
|
||||
readonly attribute AString elementName;
|
||||
|
||||
/**
|
||||
* The schema component that corresponds to this part. If the
|
||||
* type attribute is used, this is a nsISchemaType. If the
|
||||
* elementName attribute is used, it is a nsISchemaElement.
|
||||
*/
|
||||
readonly attribute nsISchemaComponent schemaComponent;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dacd-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLPartBinding : nsISupports {
|
||||
readonly attribute AString protocol;
|
||||
|
||||
readonly attribute nsIWSDLPart;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac7-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPPortBinding : nsIWSDLPortBinding {
|
||||
const unsigned short STYLE_RPC = 1;
|
||||
const unsigned short STYLE_DOCUMENT = 2;
|
||||
|
||||
readonly attribute AString address;
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString transport;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac8-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPOperationBinding : nsIWSDLOperationBinding {
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString soapAction;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac9-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPPartBinding : nsIWSDLPartBinding {
|
||||
const unsigned short LOCATION_BODY = 1;
|
||||
const unsigned short LOCATION_HEADER = 2;
|
||||
const unsigned short LOCATION_FAULT = 3;
|
||||
|
||||
const unsigned short USE_LITERAL = 1;
|
||||
const unsigned short USE_ENCODED = 2;
|
||||
|
||||
readonly attribute unsigned short location;
|
||||
readonly attribute unsigned short use;
|
||||
readonly attribute AString encodingStyle;
|
||||
readonly attribute AString namespace;
|
||||
};
|
|
@ -27,21 +27,37 @@
|
|||
#include "nsAWritableString.h"
|
||||
%}
|
||||
|
||||
interface nsIWSDLService;
|
||||
interface nsIURI;
|
||||
interface nsIWSDLLoaderListener;
|
||||
interface nsIWSDLPort;
|
||||
interface nsIWSDLLoadListener;
|
||||
|
||||
[scriptable, uuid(0458dac5-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLLoader : nsISupports {
|
||||
nsIWSDLService load(in nsIURI wsdlURI);
|
||||
void loadAsync(in nsIURI wsdlURI, in nsIWSDLLoaderListener listener);
|
||||
nsISupports createServiceProxy(in nsIWSDLService service,
|
||||
in AString nameSpace);
|
||||
nsIWSDLPort load(in AString wsdlURI, in AString portName);
|
||||
void loadAsync(in AString wsdlURI, in AString portName,
|
||||
in nsIWSDLLoadListener listener);
|
||||
nsISupports createPortProxy(in nsIWSDLPort service,
|
||||
in AString nameSpace);
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac6-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLLoaderListener : nsISupports {
|
||||
[scriptable, function, uuid(0458dac6-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsIWSDLLoadListener : nsISupports {
|
||||
void onLoad(in nsIWSDLPort service);
|
||||
void onError(in PRInt32 status,
|
||||
in AString statusMessage);
|
||||
void onComplete(in nsIWSDLService service);
|
||||
};
|
||||
|
||||
%{ C++
|
||||
#define NS_WSDLLOADER_CID \
|
||||
{ /* 0a5af577-a61e-4492-ba0e-dd3c7b657e18 */ \
|
||||
0x0a5af577, 0xa61e, 0x4492, \
|
||||
{0xba, 0x0e, 0xdd, 0x3c, 0x7b, 0x65, 0x7e, 0x18}}
|
||||
|
||||
#define NS_WSDLLOADER_CONTRACTID "@mozilla.org/xmlextras/wsdl/wsdlloader;1"
|
||||
|
||||
#define NS_ERROR_WSDL_NOT_WSDL_ELEMENT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 1)
|
||||
#define NS_ERROR_WSDL_SCHEMA_PROCESSING_ERROR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 2)
|
||||
#define NS_ERROR_WSDL_BINDING_NOT_FOUND NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 3)
|
||||
#define NS_ERROR_WSDL_UNKNOWN_SCHEMA_COMPONENT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 4)
|
||||
#define NS_ERROR_WSDL_UNKNOWN_WSDL_COMPONENT NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 5)
|
||||
#define NS_ERROR_WSDL_LOADING_ERROR NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_GENERAL, 6)
|
||||
%}
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications. Portions created by Netscape Communications are
|
||||
* Copyright (C) 2001 by Netscape Communications. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vidur Apparao <vidur@netscape.com> (original author)
|
||||
*/
|
||||
|
||||
#include "nsISupports.idl"
|
||||
#include "nsIWSDL.idl"
|
||||
|
||||
%{ C++
|
||||
#include "nsAWritableString.h"
|
||||
%}
|
||||
|
||||
[scriptable, uuid(0458dac7-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPPortBinding : nsIWSDLBinding {
|
||||
const unsigned short STYLE_RPC = 1;
|
||||
const unsigned short STYLE_DOCUMENT = 2;
|
||||
|
||||
readonly attribute AString name;
|
||||
readonly attribute AString address;
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString transport;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac8-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPOperationBinding : nsIWSDLBinding {
|
||||
readonly attribute unsigned short style;
|
||||
readonly attribute AString soapAction;
|
||||
};
|
||||
|
||||
[scriptable, uuid(0458dac9-65de-11d5-9b42-00104bdf5339)]
|
||||
interface nsISOAPPartBinding : nsIWSDLBinding {
|
||||
const unsigned short LOCATION_BODY = 1;
|
||||
const unsigned short LOCATION_HEADER = 2;
|
||||
const unsigned short LOCATION_FAULT = 3;
|
||||
|
||||
const unsigned short USE_LITERAL = 1;
|
||||
const unsigned short USE_ENCODED = 2;
|
||||
|
||||
readonly attribute unsigned short location;
|
||||
readonly attribute unsigned short use;
|
||||
readonly attribute AString encodingStyle;
|
||||
readonly attribute AString namespace;
|
||||
};
|
|
@ -31,7 +31,8 @@ LIBRARY_NAME = xmlextraswsdl_s
|
|||
REQUIRES = xpcom string dom caps necko xpconnect
|
||||
|
||||
CPPSRCS = \
|
||||
nsWSDLLoader.cpp \
|
||||
nsWSDLLoader.cpp \
|
||||
nsWSDLDefinitions.cpp \
|
||||
$(NULL)
|
||||
|
||||
# we don't want the shared lib, but we want to force the creation of a
|
||||
|
@ -39,3 +40,7 @@ CPPSRCS = \
|
|||
FORCE_STATIC_LIB = 1
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
INCLUDES += \
|
||||
-I$(srcdir)/../../schema/src \
|
||||
$(NULL)
|
||||
|
|
|
@ -28,17 +28,19 @@ DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN
|
|||
|
||||
CPPSRCS= \
|
||||
nsWSDLLoader.cpp \
|
||||
nsWSDLDefinitions.cpp \
|
||||
$(NULL)
|
||||
|
||||
CPP_OBJS= \
|
||||
.\$(OBJDIR)\nsWSDLLoader.obj \
|
||||
.\$(OBJDIR)\nsWSDLDefinitions.obj \
|
||||
$(NULL)
|
||||
|
||||
EXPORTS = \
|
||||
$(NULL)
|
||||
|
||||
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \
|
||||
-I$(PUBLIC)\dom -I$(PUBLIC)\uconv
|
||||
-I$(PUBLIC)\dom -I$(PUBLIC)\uconv -I..\..\schema\src
|
||||
|
||||
LCFLAGS = \
|
||||
$(LCFLAGS) \
|
||||
|
|
|
@ -0,0 +1,785 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications. Portions created by Netscape Communications are
|
||||
* Copyright (C) 2001 by Netscape Communications. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vidur Apparao <vidur@netscape.com> (original author)
|
||||
*/
|
||||
|
||||
#include "nsWSDLPrivate.h"
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLPort implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsWSDLPort::nsWSDLPort(const nsAReadableString& aName)
|
||||
: mName(aName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWSDLPort::~nsWSDLPort()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsWSDLPort, nsIWSDLPort)
|
||||
|
||||
/* readonly attribute AString name; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetName(nsAWritableString & aName)
|
||||
{
|
||||
aName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute PRUint32 operationCount; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetOperationCount(PRUint32 *aOperationCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aOperationCount);
|
||||
|
||||
return mOperations.Count(aOperationCount);
|
||||
}
|
||||
|
||||
/* nsIWSDLOperation getOperation (in PRUint32 index); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetOperation(PRUint32 index, nsIWSDLOperation **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
return mOperations.QueryElementAt(index, NS_GET_IID(nsIWSDLOperation),
|
||||
(void**)_retval);
|
||||
}
|
||||
|
||||
/* nsIWSDLOperation getOperationByName(in AString name); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetOperationByName(const nsAReadableString& aName,
|
||||
nsIWSDLOperation** aOperation)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
*aOperation = nsnull;
|
||||
|
||||
// XXX Do a linear search for now. If more efficiency is needed
|
||||
// we can store the opeartions in a hash as well.
|
||||
PRUint32 index, count;
|
||||
mOperations.Count(&count);
|
||||
|
||||
for (index = 0; index < count; index++) {
|
||||
nsCOMPtr<nsIWSDLOperation> operation;
|
||||
|
||||
rv = mOperations.QueryElementAt(index, NS_GET_IID(nsIWSDLOperation),
|
||||
getter_AddRefs(operation));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAutoString name;
|
||||
operation->GetName(name);
|
||||
|
||||
if (name.Equals(aName)) {
|
||||
*aOperation = operation;
|
||||
NS_ADDREF(*aOperation);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::GetBinding(nsIWSDLBinding** aBinding)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aBinding);
|
||||
|
||||
*aBinding = mBinding;
|
||||
NS_IF_ADDREF(*aBinding);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::AddOperation(nsIWSDLOperation* aOperation)
|
||||
{
|
||||
NS_ENSURE_ARG(aOperation);
|
||||
|
||||
return mOperations.AppendElement(aOperation);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPort::SetBinding(nsIWSDLBinding* aBinding)
|
||||
{
|
||||
mBinding = aBinding;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsSOAPPortBinding implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsSOAPPortBinding::nsSOAPPortBinding(const nsAReadableString& aName)
|
||||
: mName(aName), mStyle(STYLE_RPC)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsSOAPPortBinding::~nsSOAPPortBinding()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2_CI(nsSOAPPortBinding,
|
||||
nsIWSDLBinding,
|
||||
nsISOAPPortBinding)
|
||||
|
||||
/* readonly attribute AString protocol; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetProtocol(nsAWritableString& aProtocol)
|
||||
{
|
||||
aProtocol.Assign(NS_LITERAL_STRING("soap"));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString bindingName; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetName(nsAWritableString & aBindingName)
|
||||
{
|
||||
aBindingName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString address; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetAddress(nsAWritableString & aAddress)
|
||||
{
|
||||
aAddress.Assign(mAddress);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short style; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetStyle(PRUint16 *aStyle)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aStyle);
|
||||
|
||||
*aStyle = mStyle;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString transport; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::GetTransport(nsAWritableString & aTransport)
|
||||
{
|
||||
aTransport.Assign(mTransport);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetAddress(const nsAReadableString& aAddress)
|
||||
{
|
||||
mAddress.Assign(aAddress);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetStyle(PRUint16 aStyle)
|
||||
{
|
||||
mStyle = aStyle;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPortBinding::SetTransport(const nsAReadableString& aTransport)
|
||||
{
|
||||
mTransport.Assign(aTransport);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLOperation implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsWSDLOperation::nsWSDLOperation(const nsAReadableString &aName)
|
||||
: mName(aName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWSDLOperation::~nsWSDLOperation()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsWSDLOperation, nsIWSDLOperation)
|
||||
|
||||
/* readonly attribute AString name; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetName(nsAWritableString & aName)
|
||||
{
|
||||
aName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIWSDLMessage input; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetInput(nsIWSDLMessage * *aInput)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aInput);
|
||||
|
||||
*aInput = mInputMessage;
|
||||
NS_IF_ADDREF(*aInput);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIWSDLMessage output; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetOutput(nsIWSDLMessage * *aOutput)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aOutput);
|
||||
|
||||
*aOutput = mOutputMessage;
|
||||
NS_IF_ADDREF(*aOutput);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute PRUint32 faultCount; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetFaultCount(PRUint32* aCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aCount);
|
||||
|
||||
return mFaultMessages.Count(aCount);
|
||||
}
|
||||
|
||||
/* nsIWSDLMessage getFault(in PRUint32 index); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetFault(PRUint32 aIndex, nsIWSDLMessage * *aFault)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aFault);
|
||||
|
||||
return mFaultMessages.QueryElementAt(aIndex, NS_GET_IID(nsIWSDLMessage),
|
||||
(void**)aFault);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetBinding(nsIWSDLBinding** aBinding)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aBinding);
|
||||
|
||||
*aBinding = mBinding;
|
||||
NS_IF_ADDREF(*aBinding);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute PRUint32 parameterCount; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetParameterCount(PRUint32 *aParameterCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aParameterCount);
|
||||
|
||||
*aParameterCount = (PRUint32)mParameters.Count();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* AString getParameter (in PRUint32 index); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::GetParameter(PRUint32 index, nsAWritableString & _retval)
|
||||
{
|
||||
nsString* str = mParameters.StringAt((PRInt32)index);
|
||||
if (!str) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
_retval.Assign(*str);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::SetInput(nsIWSDLMessage* aInputMessage)
|
||||
{
|
||||
mInputMessage = aInputMessage;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::SetOutput(nsIWSDLMessage* aOutputMessage)
|
||||
{
|
||||
mOutputMessage = aOutputMessage;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::AddFault(nsIWSDLMessage* aFaultMessage)
|
||||
{
|
||||
NS_ENSURE_ARG(aFaultMessage);
|
||||
|
||||
return mFaultMessages.AppendElement(aFaultMessage);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::SetBinding(nsIWSDLBinding* aBinding)
|
||||
{
|
||||
mBinding = aBinding;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLOperation::AddParameter(const nsAReadableString& aParameter)
|
||||
{
|
||||
mParameters.AppendString(aParameter);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsSOAPOperationBinding implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsSOAPOperationBinding::nsSOAPOperationBinding()
|
||||
: mStyle(nsISOAPPortBinding::STYLE_RPC)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsSOAPOperationBinding::~nsSOAPOperationBinding()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2_CI(nsSOAPOperationBinding,
|
||||
nsIWSDLBinding,
|
||||
nsISOAPOperationBinding)
|
||||
|
||||
/* readonly attribute AString protocol; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::GetProtocol(nsAWritableString& aProtocol)
|
||||
{
|
||||
aProtocol.Assign(NS_LITERAL_STRING("soap"));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short style; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::GetStyle(PRUint16 *aStyle)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aStyle);
|
||||
|
||||
*aStyle = mStyle;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString soapAction; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::GetSoapAction(nsAWritableString & aSoapAction)
|
||||
{
|
||||
aSoapAction.Assign(mSoapAction);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::SetStyle(PRUint16 aStyle)
|
||||
{
|
||||
mStyle = aStyle;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSOAPOperationBinding::SetSoapAction(const nsAReadableString& aAction)
|
||||
{
|
||||
mSoapAction.Assign(aAction);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLMessage implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsWSDLMessage::nsWSDLMessage(const nsAReadableString& aName)
|
||||
: mName(aName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWSDLMessage::~nsWSDLMessage()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsWSDLMessage, nsIWSDLMessage)
|
||||
|
||||
/* readonly attribute AString name; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetName(nsAWritableString & aName)
|
||||
{
|
||||
aName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = mDocumentationElement;
|
||||
NS_IF_ADDREF(*aDocumentation);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute PRUint32 partCount; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetPartCount(PRUint32 *aPartCount)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPartCount);
|
||||
|
||||
return mParts.Count(aPartCount);
|
||||
}
|
||||
|
||||
/* nsIWSDLPart getPart (in PRUint32 index); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetPart(PRUint32 index, nsIWSDLPart **_retval)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(_retval);
|
||||
|
||||
return mParts.QueryElementAt(index, NS_GET_IID(nsIWSDLPart),
|
||||
(void**)_retval);
|
||||
|
||||
}
|
||||
|
||||
/* nsIWSDLPart getPartByName(in AString name); */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::GetPartByName(const nsAReadableString& aName,
|
||||
nsIWSDLPart** aPart)
|
||||
{
|
||||
nsresult rv;
|
||||
|
||||
*aPart = nsnull;
|
||||
// XXX Do a linear search for now. If more efficiency is needed
|
||||
// we can store the part in a hash as well.
|
||||
PRUint32 index, count;
|
||||
mParts.Count(&count);
|
||||
|
||||
for (index = 0; index < count; index++) {
|
||||
nsCOMPtr<nsIWSDLPart> part;
|
||||
|
||||
rv = mParts.QueryElementAt(index, NS_GET_IID(nsIWSDLPart),
|
||||
getter_AddRefs(part));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
nsAutoString name;
|
||||
part->GetName(name);
|
||||
|
||||
if (name.Equals(aName)) {
|
||||
*aPart = part;
|
||||
NS_ADDREF(*aPart);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::SetDocumentationElement(nsIDOMElement* aElement)
|
||||
{
|
||||
mDocumentationElement = aElement;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLMessage::AddPart(nsIWSDLPart* aPart)
|
||||
{
|
||||
NS_ENSURE_ARG(aPart);
|
||||
|
||||
return mParts.AppendElement(aPart);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsWSDLPart implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsWSDLPart::nsWSDLPart(const nsAReadableString& aName)
|
||||
: mName(aName)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsWSDLPart::~nsWSDLPart()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS1_CI(nsWSDLPart, nsIWSDLPart)
|
||||
|
||||
/* readonly attribute AString name; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetName(nsAWritableString & aName)
|
||||
{
|
||||
aName.Assign(mName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString type; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetType(nsAWritableString & aType)
|
||||
{
|
||||
aType.Assign(mType);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString elementName; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetElementName(nsAWritableString & aElementName)
|
||||
{
|
||||
aElementName.Assign(mElementName);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsISchemaComponent schemaComponent; */
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetSchemaComponent(nsISchemaComponent * *aSchemaComponent)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aSchemaComponent);
|
||||
|
||||
*aSchemaComponent = mSchemaComponent;
|
||||
NS_IF_ADDREF(*aSchemaComponent);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::GetBinding(nsIWSDLBinding** aBinding)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aBinding);
|
||||
|
||||
*aBinding = mBinding;
|
||||
NS_IF_ADDREF(*aBinding);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::SetTypeInfo(const nsAReadableString& aType,
|
||||
const nsAReadableString& aElementName,
|
||||
nsISchemaComponent* aSchemaComponent)
|
||||
{
|
||||
mType.Assign(aType);
|
||||
mElementName.Assign(aElementName);
|
||||
mSchemaComponent = aSchemaComponent;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsWSDLPart::SetBinding(nsIWSDLBinding* aBinding)
|
||||
{
|
||||
mBinding = aBinding;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
//
|
||||
// nsSOAPPartBinding implementation
|
||||
//
|
||||
////////////////////////////////////////////////////////////
|
||||
nsSOAPPartBinding::nsSOAPPartBinding(PRUint16 aLocation, PRUint16 aUse,
|
||||
const nsAReadableString& aEncodingStyle,
|
||||
const nsAReadableString& aNamespace)
|
||||
: mLocation(aLocation), mUse(aUse),
|
||||
mEncodingStyle(aEncodingStyle), mNamespace(aNamespace)
|
||||
{
|
||||
NS_INIT_ISUPPORTS();
|
||||
}
|
||||
|
||||
nsSOAPPartBinding::~nsSOAPPartBinding()
|
||||
{
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS2_CI(nsSOAPPartBinding,
|
||||
nsIWSDLBinding,
|
||||
nsISOAPPartBinding)
|
||||
|
||||
/* readonly attribute AString protocol; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetProtocol(nsAWritableString& aProtocol)
|
||||
{
|
||||
aProtocol.Assign(NS_LITERAL_STRING("soap"));
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute nsIDOMElement documentation; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetDocumentation(nsIDOMElement * *aDocumentation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aDocumentation);
|
||||
|
||||
*aDocumentation = nsnull;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short location; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetLocation(PRUint16 *aLocation)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aLocation);
|
||||
|
||||
*aLocation = mLocation;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute unsigned short use; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetUse(PRUint16 *aUse)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aUse);
|
||||
|
||||
*aUse = mUse;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString encodingStyle; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetEncodingStyle(nsAWritableString & aEncodingStyle)
|
||||
{
|
||||
aEncodingStyle.Assign(mEncodingStyle);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
/* readonly attribute AString namespace; */
|
||||
NS_IMETHODIMP
|
||||
nsSOAPPartBinding::GetNamespace(nsAWritableString & aNamespace)
|
||||
{
|
||||
aNamespace.Assign(mNamespace);
|
||||
|
||||
return NS_OK;
|
||||
}
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,211 @@
|
|||
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/*
|
||||
* The contents of this file are subject to the Mozilla Public
|
||||
* License Version 1.1 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.mozilla.org/MPL/
|
||||
*
|
||||
* Software distributed under the License is distributed on an "AS
|
||||
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
||||
* implied. See the License for the specific language governing
|
||||
* rights and limitations under the License.
|
||||
*
|
||||
* The Original Code is Mozilla.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Netscape
|
||||
* Communications. Portions created by Netscape Communications are
|
||||
* Copyright (C) 2001 by Netscape Communications. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Vidur Apparao <vidur@netscape.com> (original author)
|
||||
*/
|
||||
|
||||
#ifndef __nsWSDLLoader_h__
|
||||
#define __nsWSDLLoader_h__
|
||||
|
||||
#include "nsIWSDLLoader.h"
|
||||
#include "nsWSDLPrivate.h"
|
||||
|
||||
#include "nsDOMUtils.h"
|
||||
|
||||
// XPCOM Includes
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsString.h"
|
||||
#include "nsIAtom.h"
|
||||
#include "nsHashtable.h"
|
||||
#include "nsError.h"
|
||||
|
||||
// Loading includes
|
||||
#include "nsIURI.h"
|
||||
#include "nsIXMLHTTPRequest.h"
|
||||
#include "nsIDOMEventListener.h"
|
||||
|
||||
// schema includes
|
||||
#include "nsISchemaLoader.h"
|
||||
|
||||
// DOM includes
|
||||
#include "nsIDOMDocument.h"
|
||||
|
||||
#define NS_ERROR_WSDL_LOADPENDING NS_ERROR_GENERATE_SUCCESS(NS_ERROR_MODULE_GENERAL, 1)
|
||||
|
||||
class nsWSDLAtoms {
|
||||
public:
|
||||
static void CreateWSDLAtoms();
|
||||
static void DestroyWSDLAtoms();
|
||||
|
||||
static nsIAtom* sDefinitions_atom;
|
||||
static nsIAtom* sTypes_atom;
|
||||
static nsIAtom* sMessage_atom;
|
||||
static nsIAtom* sPortType_atom;
|
||||
static nsIAtom* sBinding_atom;
|
||||
static nsIAtom* sService_atom;
|
||||
static nsIAtom* sPort_atom;
|
||||
static nsIAtom* sOperation_atom;
|
||||
static nsIAtom* sPart_atom;
|
||||
static nsIAtom* sDocumentation_atom;
|
||||
static nsIAtom* sImport_atom;
|
||||
static nsIAtom* sInput_atom;
|
||||
static nsIAtom* sOutput_atom;
|
||||
static nsIAtom* sFault_atom;
|
||||
|
||||
static nsIAtom* sBody_atom;
|
||||
static nsIAtom* sHeader_atom;
|
||||
static nsIAtom* sHeaderFault_atom;
|
||||
static nsIAtom* sAddress_atom;
|
||||
};
|
||||
|
||||
class nsWSDLLoader : public nsIWSDLLoader {
|
||||
public:
|
||||
nsWSDLLoader();
|
||||
virtual ~nsWSDLLoader();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLLOADER
|
||||
|
||||
protected:
|
||||
nsresult GetResolvedURI(const nsAReadableString& aSchemaURI,
|
||||
const char* aMethod,
|
||||
nsIURI** aURI);
|
||||
|
||||
protected:
|
||||
nsWSDLPort* mPort;
|
||||
};
|
||||
|
||||
|
||||
class nsWSDLLoadingContext {
|
||||
public:
|
||||
nsWSDLLoadingContext(nsIDOMDocument* aDocument,
|
||||
const nsAReadableString& aLocation) :
|
||||
mDocument(aDocument), mChildIndex(0), mDocumentLocation(aLocation) {
|
||||
}
|
||||
~nsWSDLLoadingContext() {
|
||||
}
|
||||
|
||||
void GetRootElement(nsIDOMElement** aElement) {
|
||||
mDocument->GetDocumentElement(aElement);
|
||||
}
|
||||
|
||||
PRUint32 GetChildIndex() { return mChildIndex; }
|
||||
void SetChildIndex(PRUint32 aChildIndex) { mChildIndex = aChildIndex; }
|
||||
|
||||
void GetTargetNamespace(nsAWritableString& aNamespace) {
|
||||
nsCOMPtr<nsIDOMElement> element;
|
||||
GetRootElement(getter_AddRefs(element));
|
||||
if (element) {
|
||||
element->GetAttribute(NS_LITERAL_STRING("targetNamespace"),
|
||||
aNamespace);
|
||||
}
|
||||
else {
|
||||
aNamespace.Truncate();
|
||||
}
|
||||
}
|
||||
|
||||
void GetDocumentLocation(nsAWritableString& aLocation) {
|
||||
aLocation.Assign(mDocumentLocation);
|
||||
}
|
||||
|
||||
protected:
|
||||
// XXX hold onto the document till issues related to dangling
|
||||
// document pointers in content are fixed. After that, just
|
||||
// hold onto the root element.
|
||||
nsCOMPtr<nsIDOMDocument> mDocument;
|
||||
PRUint32 mChildIndex;
|
||||
nsString mDocumentLocation;
|
||||
};
|
||||
|
||||
class nsWSDLLoadRequest : public nsIDOMEventListener
|
||||
{
|
||||
public:
|
||||
nsWSDLLoadRequest(PRBool aIsSync,
|
||||
nsIWSDLLoadListener* aListener,
|
||||
const nsAReadableString& aPortName);
|
||||
virtual ~nsWSDLLoadRequest();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIDOMEVENTLISTENER
|
||||
|
||||
nsresult LoadDefinition(const nsAReadableString& aURI);
|
||||
nsresult ResumeProcessing();
|
||||
nsresult ContineProcessingTillDone();
|
||||
nsresult GetPort(nsIWSDLPort** aPort);
|
||||
|
||||
nsresult PushContext(nsIDOMDocument* aDocument,
|
||||
const nsAReadableString& aLocation);
|
||||
nsWSDLLoadingContext* GetCurrentContext();
|
||||
void PopContext();
|
||||
|
||||
nsresult GetSchemaElement(const nsAReadableString& aName,
|
||||
const nsAReadableString& aNamespace,
|
||||
nsISchemaElement** aSchemaComponent);
|
||||
nsresult GetSchemaType(const nsAReadableString& aName,
|
||||
const nsAReadableString& aNamespace,
|
||||
nsISchemaType** aSchemaComponent);
|
||||
nsresult GetMessage(const nsAReadableString& aName,
|
||||
const nsAReadableString& aNamespace,
|
||||
nsIWSDLMessage** aMessage);
|
||||
nsresult GetPortType(const nsAReadableString& aName,
|
||||
const nsAReadableString& aNamespace,
|
||||
nsIWSDLPort** aPort);
|
||||
|
||||
nsresult ProcessImportElement(nsIDOMElement* aElement,
|
||||
PRUint32 aIndex);
|
||||
nsresult ProcessTypesElement(nsIDOMElement* aElement);
|
||||
nsresult ProcessMessageElement(nsIDOMElement* aElement);
|
||||
nsresult ProcessAbstractPartElement(nsIDOMElement* aElement,
|
||||
nsWSDLMessage* aMessage);
|
||||
nsresult ProcessPortTypeElement(nsIDOMElement* aElement);
|
||||
nsresult ProcessAbstractOperation(nsIDOMElement* aElement,
|
||||
nsWSDLPort* aPort);
|
||||
nsresult ProcessOperationComponent(nsIDOMElement* aElement,
|
||||
nsIWSDLMessage** aMessage);
|
||||
nsresult ProcessMessageBinding(nsIDOMElement* aElement,
|
||||
nsIWSDLMessage* aMessage);
|
||||
nsresult ProcessOperationBinding(nsIDOMElement* aElement,
|
||||
nsIWSDLPort* aPort);
|
||||
nsresult ProcessBindingElement(nsIDOMElement* aElement);
|
||||
nsresult ProcessPortBinding(nsIDOMElement* aElement);
|
||||
nsresult ProcessServiceElement(nsIDOMElement* aElement);
|
||||
|
||||
protected:
|
||||
nsCOMPtr<nsIWSDLLoadListener> mListener;
|
||||
nsCOMPtr<nsIXMLHttpRequest> mRequest;
|
||||
nsCOMPtr<nsISchemaLoader> mSchemaLoader;
|
||||
|
||||
PRBool mIsSync;
|
||||
|
||||
nsCOMPtr<nsIWSDLPort> mPort;
|
||||
nsString mPortName;
|
||||
nsString mBindingName;
|
||||
nsString mBindingNamespace;
|
||||
nsString mAddress;
|
||||
|
||||
nsVoidArray mContextStack;
|
||||
|
||||
nsSupportsHashtable mTypes;
|
||||
nsSupportsHashtable mMessages;
|
||||
nsSupportsHashtable mPortTypes;
|
||||
};
|
||||
|
||||
#endif // __nsWSDLLoader_h__
|
|
@ -25,138 +25,220 @@
|
|||
#define __nsWSDLPrivate_h__
|
||||
|
||||
#include "nsIWSDL.h"
|
||||
#include "nsIWSDLLoader.h"
|
||||
#include "nsIWSDLSOAPBinding.h"
|
||||
|
||||
// DOM Includes
|
||||
#include "nsIDOMElement.h"
|
||||
|
||||
// Schema includes
|
||||
#include "nsISchema.h"
|
||||
|
||||
// XPCOM Includes
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsVoidArray.h"
|
||||
#include "nsSupportsArray.h"
|
||||
#include "nsString.h"
|
||||
|
||||
class nsWSDLLoader : public nsIWSDLLoader {
|
||||
#define NS_WSDL_SCHEMA_NAMESPACE "http://www.w3.org/2001/XMLSchema"
|
||||
#define NS_WSDL_NAMESPACE "http://schemas.xmlsoap.org/wsdl/"
|
||||
#define NS_WSDL_SOAP_NAMESPACE "http://schemas.xmlsoap.org/wsdl/soap/"
|
||||
|
||||
class nsSOAPPortBinding : public nsISOAPPortBinding {
|
||||
public:
|
||||
nsWSDLLoader();
|
||||
virtual ~nsWSDLLoader();
|
||||
|
||||
nsSOAPPortBinding(const nsAReadableString& aName);
|
||||
virtual ~nsSOAPPortBinding();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLLOADER
|
||||
};
|
||||
NS_DECL_NSIWSDLBINDING
|
||||
NS_DECL_NSISOAPPORTBINDING
|
||||
|
||||
class nsWSDLService : public nsIWSDLService {
|
||||
public:
|
||||
nsWSDLService();
|
||||
virtual ~nsWSDLService();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLSERVICE
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD AddPort(nsIWSDLPort* aPort);
|
||||
NS_IMETHOD SetAddress(const nsAReadableString& aAddress);
|
||||
NS_IMETHOD SetStyle(PRUint16 aStyle);
|
||||
NS_IMETHOD SetTransport(const nsAReadableString& aTransport);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsString mAddress;
|
||||
PRUint16 mStyle;
|
||||
nsString mTransport;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
nsSupportsArray mPorts;
|
||||
};
|
||||
|
||||
class nsWSDLPort : public nsIWSDLPort {
|
||||
public:
|
||||
nsWSDLPort();
|
||||
nsWSDLPort(const nsAReadableString &aName);
|
||||
virtual ~nsWSDLPort();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLPORT
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD SetBindingInfo(const nsAReadableString& aBindingName,
|
||||
PRUint16 aStyle,
|
||||
const nsAReadableString& aTransport);
|
||||
NS_IMETHOD AddOperation(nsIWSDLOperation* aOperation);
|
||||
NS_IMETHOD SetBinding(nsIWSDLBinding* aBinding);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
nsString mBindingName;
|
||||
PRUint16 mStyle;
|
||||
nsString mTransport;
|
||||
nsSupportsArray mOperations;
|
||||
nsCOMPtr<nsIWSDLBinding> mBinding;
|
||||
};
|
||||
|
||||
class nsSOAPOperationBinding : public nsISOAPOperationBinding {
|
||||
public:
|
||||
nsSOAPOperationBinding();
|
||||
virtual ~nsSOAPOperationBinding();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLBINDING
|
||||
NS_DECL_NSISOAPOPERATIONBINDING
|
||||
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD SetStyle(PRUint16 aStyle);
|
||||
NS_IMETHOD SetSoapAction(const nsAReadableString& aAction);
|
||||
|
||||
protected:
|
||||
PRUint16 mStyle;
|
||||
nsString mSoapAction;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
};
|
||||
|
||||
class nsWSDLOperation : public nsIWSDLOperation {
|
||||
public:
|
||||
nsWSDLOperation();
|
||||
nsWSDLOperation(const nsAReadableString &aName);
|
||||
virtual ~nsWSDLOperation();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLOPERATION
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD SetBindingInfo(PRUint16 aStyle,
|
||||
const nsAReadableString& aSoapAction);
|
||||
NS_IMETHOD SetInputMessage(nsIWSDLMessage* aInputMessage);
|
||||
NS_IMETHOD SetOutputMessage(nsIWSDLMessage* aOutputMessage);
|
||||
NS_IMETHOD SetFaultMessage(nsIWSDLMessage* aFaultMessage);
|
||||
NS_IMETHOD SetInput(nsIWSDLMessage* aInputMessage);
|
||||
NS_IMETHOD SetOutput(nsIWSDLMessage* aOutputMessage);
|
||||
NS_IMETHOD AddFault(nsIWSDLMessage* aFaultMessage);
|
||||
NS_IMETHOD AddParameter(const nsAReadableString& aParameter);
|
||||
NS_IMETHOD SetBinding(nsIWSDLBinding* aBinding);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
PRUint16 mStyle;
|
||||
nsString mSoapAction;
|
||||
nsCOMPtr<nsIWSDLMessage> mInputMessage;
|
||||
nsCOMPtr<nsIWSDLMessage> mOutputMessage;
|
||||
nsCOMPtr<nsIWSDLMessage> mFaultMessage;
|
||||
nsSupportsArray mFaultMessages;
|
||||
nsStringArray mParameters;
|
||||
nsCOMPtr<nsIWSDLBinding> mBinding;
|
||||
};
|
||||
|
||||
class nsWSDLMessage : public nsIWSDLMessage {
|
||||
public:
|
||||
nsWSDLMessage();
|
||||
nsWSDLMessage(const nsAReadableString& aName);
|
||||
virtual ~nsWSDLMessage();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLMESSAGE
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetDocumentationElement(nsIDOMElement* aElement);
|
||||
NS_IMETHOD SetBindingInfo(PRUint16 aLocation, PRUint16 aUse,
|
||||
const nsAReadableString& aEncodingStyle,
|
||||
const nsAReadableString& aNamespace);
|
||||
NS_IMETHOD AddPart(nsIWSDLPart* aPart);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsCOMPtr<nsIDOMElement> mDocumentationElement;
|
||||
nsSupportsArray mParts;
|
||||
};
|
||||
|
||||
class nsSOAPPartBinding : public nsISOAPPartBinding {
|
||||
public:
|
||||
nsSOAPPartBinding(PRUint16 aLocation, PRUint16 aUse,
|
||||
const nsAReadableString& aEncodingStyle,
|
||||
const nsAReadableString& aNamespace);
|
||||
virtual ~nsSOAPPartBinding();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLBINDING
|
||||
NS_DECL_NSISOAPPARTBINDING
|
||||
|
||||
protected:
|
||||
PRUint16 mLocation;
|
||||
PRUint16 mUse;
|
||||
nsString mEncodingStyle;
|
||||
nsString mNamespace;
|
||||
nsSupportsArray mParts;
|
||||
nsString mNamespace;
|
||||
};
|
||||
|
||||
class nsWSDLPart : public nsIWSDLPart {
|
||||
public:
|
||||
nsWSDLPart();
|
||||
nsWSDLPart(const nsAReadableString& aName);
|
||||
virtual ~nsWSDLPart();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIWSDLPART
|
||||
|
||||
NS_IMETHOD SetName(const nsAReadableString& aName);
|
||||
NS_IMETHOD SetTypeInfo(const nsAReadableString& aType,
|
||||
const nsAReadableString& aElementName,
|
||||
nsIDOMElement* aSchema,
|
||||
nsIDOMElement* aSchemaRoot);
|
||||
nsISchemaComponent* aSchemaComponent);
|
||||
NS_IMETHOD SetBinding(nsIWSDLBinding* aBinding);
|
||||
|
||||
protected:
|
||||
nsString mName;
|
||||
nsString mType;
|
||||
nsString mElementName;
|
||||
nsCOMPtr<nsIDOMElement> mSchema;
|
||||
nsCOMPtr<nsIDOMElement> mSchemaRoot;
|
||||
nsCOMPtr<nsISchemaComponent> mSchemaComponent;
|
||||
nsCOMPtr<nsIWSDLBinding> mBinding;
|
||||
};
|
||||
|
||||
|
||||
#define NS_WSDLPORT_CID \
|
||||
{ /* c1dfb250-0c19-4339-8211-24eabc0103e5 */ \
|
||||
0xc1dfb250, 0x0c19, 0x4339, \
|
||||
{0x82, 0x11, 0x24, 0xea, 0xbc, 0x01, 0x03, 0xe5}}
|
||||
|
||||
#define NS_WSDLPORT_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/wsdlport;1"
|
||||
|
||||
#define NS_WSDLOPERATION_CID \
|
||||
{ /* cf54bdf5-20de-45ef-b6c8-aa535007549a */ \
|
||||
0xcf54bdf5, 0x20de, 0x45ef, \
|
||||
{0xb6, 0xc8, 0xaa, 0x53, 0x50, 0x07, 0x54, 0x9a}}
|
||||
|
||||
#define NS_WSDLOPERATION_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/wsdloperation;1"
|
||||
|
||||
#define NS_WSDLMESSAGE_CID \
|
||||
{ /* 36b26cab-3eed-4c7c-81ad-94c8b1eb9ebe */ \
|
||||
0x36b26cab, 0x3eed, 0x4c7c, \
|
||||
{0x81, 0xad, 0x94, 0xc8, 0xb1, 0xeb, 0x9e, 0xbe}}
|
||||
|
||||
#define NS_WSDLMESSAGE_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/wsdlmessage;1"
|
||||
|
||||
#define NS_WSDLPART_CID \
|
||||
{ /* 1841ebe8-5bdc-4e79-bcf4-329785318491 */ \
|
||||
0x1841ebe8, 0x5bdc, 0x4e79, \
|
||||
{0xbc, 0xf4, 0x32, 0x97, 0x85, 0x31, 0x84, 0x91}}
|
||||
|
||||
#define NS_WSDLPART_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/wsdlpart;1"
|
||||
|
||||
#define NS_SOAPPORTBINDING_CID \
|
||||
{ /* a9155950-e49d-4123-93b7-e263a3af2b32 */ \
|
||||
0xa9155950, 0xe49d, 0x4123, \
|
||||
{0x93, 0xb7, 0xe2, 0x63, 0xa3, 0xaf, 0x2b, 0x32}}
|
||||
|
||||
#define NS_SOAPPORTBINDING_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/soapportbinding;1"
|
||||
|
||||
#define NS_SOAPOPERATIONBINDING_CID \
|
||||
{ /* f5230937-4af6-43fb-9766-1890896632b2 */ \
|
||||
0xf5230937, 0x4af6, 0x43fb, \
|
||||
{0x97, 0x66, 0x18, 0x90, 0x89, 0x66, 0x32, 0xb2}}
|
||||
|
||||
#define NS_SOAPOPERATIONBINDING_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/soapoperationbinding;1"
|
||||
|
||||
#define NS_SOAPPARTBINDING_CID \
|
||||
{ /* b7698d5c-06cc-45fe-b6bc-88e32a9f970e */ \
|
||||
0xb7698d5c, 0x06cc, 0x45fe, \
|
||||
{0xb6, 0xbc, 0x88, 0xe3, 0x2a, 0x9f, 0x97, 0x0e}}
|
||||
|
||||
#define NS_SOAPPARTBINDING_CONTRACTID \
|
||||
"@mozilla/xmlextras/wsdl/soappartbinding;1"
|
||||
|
||||
#endif // __nsWSDLPrivate_h__
|
||||
|
|
Загрузка…
Ссылка в новой задаче