Addition of SOAPParameter class and contractID, minor fixes to encoding code. This is not part of the build.

This commit is contained in:
vidur%netscape.com 2002-01-02 23:29:12 +00:00
Родитель 61e87f295f
Коммит 0a0d0b4d0b
6 изменённых файлов: 40 добавлений и 36 удалений

Просмотреть файл

@ -62,12 +62,3 @@ readonly attribute boolean isComplete;
*/
boolean abort();
};
%{ C++
#define NS_SOAPPARAMETER_CID \
{ /* 87d21ec2-539d-11d4-9a59-00104bdf5339 */ \
0x87d21ec2, 0x539d, 0x11d4, \
{0x9a, 0x59, 0x00, 0x10, 0x4b, 0xdf, 0x53, 0x39} }
#define NS_SOAPPARAMETER_CONTRACTID \
"@mozilla.org/xmlextras/soap/parameter;1"
%}

Просмотреть файл

@ -1011,7 +1011,7 @@ NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,
if (NS_FAILED(rc)) return rc;
rc = nsSOAPUtils::GetLocalName(explicittype, name);
if (NS_FAILED(rc)) return rc;
rc = collection->GetType(ns, name, getter_AddRefs(type));
rc = collection->GetType(name, ns, getter_AddRefs(type));
// if (NS_FAILED(rc)) return rc;
}
if (!type) {
@ -1020,7 +1020,7 @@ NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,
rc = aSource->GetLocalName(name);
if (NS_FAILED(rc)) return rc;
nsCOMPtr<nsISchemaElement> element;
rc = collection->GetElement(ns, name, getter_AddRefs(element));
rc = collection->GetElement(name, ns, getter_AddRefs(element));
// if (NS_FAILED(rc)) return rc;
if (element) {
rc = element->GetType(getter_AddRefs(type));
@ -1028,10 +1028,10 @@ NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,
}
else if (ns.Equals(*nsSOAPUtils::kSOAPEncURI[mVersion])) { // Last-ditch hack to get undeclared types from SOAP namespace
if (name.Equals(kArraySOAPType)) { // This should not be needed if schema has these declarations
rc = collection->GetType(ns, name, getter_AddRefs(type));
rc = collection->GetType(name, ns, getter_AddRefs(type));
}
else {
rc = collection->GetType(*nsSOAPUtils::kXSURI[mVersion], name, getter_AddRefs(type));
rc = collection->GetType(name, *nsSOAPUtils::kXSURI[mVersion], getter_AddRefs(type));
}
// if (NS_FAILED(rc)) return rc;
}
@ -1046,14 +1046,25 @@ NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,
if (NS_FAILED(rc)) return rc;
rc = lookupType->GetTargetNamespace(schemaURI);
if (NS_FAILED(rc)) return rc;
PRUint16 typevalue;
rc = lookupType->GetSchemaType(&typevalue);
if (NS_FAILED(rc)) return rc;
// Special case builtin types so that the namespace for the
// type is the version that corresponds to our SOAP version.
if (typevalue == nsISchemaType::SCHEMA_TYPE_SIMPLE) {
nsCOMPtr<nsISchemaSimpleType> simpleType = do_QueryInterface(lookupType);
PRUint16 simpleTypeValue;
rc = simpleType->GetSimpleType(&simpleTypeValue);
if (NS_FAILED(rc)) return rc;
if (simpleTypeValue == nsISchemaSimpleType::SIMPLE_TYPE_BUILTIN) {
schemaURI.Assign(*nsSOAPUtils::kXSURI[mVersion]);
}
}
nsAutoString encodingKey;
SOAPEncodingKey(schemaURI, schemaType, encodingKey);
rc = aEncoding->GetDecoder(encodingKey, getter_AddRefs(decoder));
if (NS_FAILED(rc)) return rc;
if (decoder) break;
PRUint16 typevalue;
rc = lookupType->GetSchemaType(&typevalue);
if (NS_FAILED(rc)) return rc;
if (typevalue == nsISchemaType::SCHEMA_TYPE_COMPLEX) {
nsCOMPtr<nsISchemaComplexType> oldtype = do_QueryInterface(lookupType);
oldtype->GetBaseType(getter_AddRefs(lookupType));
@ -1169,7 +1180,7 @@ NS_IMETHODIMP nsArrayEncoder::Decode(nsISOAPEncoding* aEncoding,
if (NS_FAILED(rc)) return rc;
rc = nsSOAPUtils::GetLocalName(value, name);
if (NS_FAILED(rc)) return rc;
rc = collection->GetElement(ns, name, getter_AddRefs(element));
rc = collection->GetElement(name, ns, getter_AddRefs(element));
// if (NS_FAILED(rc)) return rc;
if (element) {
rc = element->GetType(getter_AddRefs(subtype));

Просмотреть файл

@ -333,7 +333,7 @@ nsresult nsSOAPUtils::GetLocalName(const nsAString & aQName,
if (i < 0)
aLocalName = aQName;
else
aQName.Mid(aLocalName, i, aQName.Length() - i);
aQName.Mid(aLocalName, i+1, aQName.Length() - i);
return NS_OK;
}

Просмотреть файл

@ -62,12 +62,3 @@ readonly attribute boolean isComplete;
*/
boolean abort();
};
%{ C++
#define NS_SOAPPARAMETER_CID \
{ /* 87d21ec2-539d-11d4-9a59-00104bdf5339 */ \
0x87d21ec2, 0x539d, 0x11d4, \
{0x9a, 0x59, 0x00, 0x10, 0x4b, 0xdf, 0x53, 0x39} }
#define NS_SOAPPARAMETER_CONTRACTID \
"@mozilla.org/xmlextras/soap/parameter;1"
%}

Просмотреть файл

@ -1011,7 +1011,7 @@ NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,
if (NS_FAILED(rc)) return rc;
rc = nsSOAPUtils::GetLocalName(explicittype, name);
if (NS_FAILED(rc)) return rc;
rc = collection->GetType(ns, name, getter_AddRefs(type));
rc = collection->GetType(name, ns, getter_AddRefs(type));
// if (NS_FAILED(rc)) return rc;
}
if (!type) {
@ -1020,7 +1020,7 @@ NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,
rc = aSource->GetLocalName(name);
if (NS_FAILED(rc)) return rc;
nsCOMPtr<nsISchemaElement> element;
rc = collection->GetElement(ns, name, getter_AddRefs(element));
rc = collection->GetElement(name, ns, getter_AddRefs(element));
// if (NS_FAILED(rc)) return rc;
if (element) {
rc = element->GetType(getter_AddRefs(type));
@ -1028,10 +1028,10 @@ NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,
}
else if (ns.Equals(*nsSOAPUtils::kSOAPEncURI[mVersion])) { // Last-ditch hack to get undeclared types from SOAP namespace
if (name.Equals(kArraySOAPType)) { // This should not be needed if schema has these declarations
rc = collection->GetType(ns, name, getter_AddRefs(type));
rc = collection->GetType(name, ns, getter_AddRefs(type));
}
else {
rc = collection->GetType(*nsSOAPUtils::kXSURI[mVersion], name, getter_AddRefs(type));
rc = collection->GetType(name, *nsSOAPUtils::kXSURI[mVersion], getter_AddRefs(type));
}
// if (NS_FAILED(rc)) return rc;
}
@ -1046,14 +1046,25 @@ NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,
if (NS_FAILED(rc)) return rc;
rc = lookupType->GetTargetNamespace(schemaURI);
if (NS_FAILED(rc)) return rc;
PRUint16 typevalue;
rc = lookupType->GetSchemaType(&typevalue);
if (NS_FAILED(rc)) return rc;
// Special case builtin types so that the namespace for the
// type is the version that corresponds to our SOAP version.
if (typevalue == nsISchemaType::SCHEMA_TYPE_SIMPLE) {
nsCOMPtr<nsISchemaSimpleType> simpleType = do_QueryInterface(lookupType);
PRUint16 simpleTypeValue;
rc = simpleType->GetSimpleType(&simpleTypeValue);
if (NS_FAILED(rc)) return rc;
if (simpleTypeValue == nsISchemaSimpleType::SIMPLE_TYPE_BUILTIN) {
schemaURI.Assign(*nsSOAPUtils::kXSURI[mVersion]);
}
}
nsAutoString encodingKey;
SOAPEncodingKey(schemaURI, schemaType, encodingKey);
rc = aEncoding->GetDecoder(encodingKey, getter_AddRefs(decoder));
if (NS_FAILED(rc)) return rc;
if (decoder) break;
PRUint16 typevalue;
rc = lookupType->GetSchemaType(&typevalue);
if (NS_FAILED(rc)) return rc;
if (typevalue == nsISchemaType::SCHEMA_TYPE_COMPLEX) {
nsCOMPtr<nsISchemaComplexType> oldtype = do_QueryInterface(lookupType);
oldtype->GetBaseType(getter_AddRefs(lookupType));
@ -1169,7 +1180,7 @@ NS_IMETHODIMP nsArrayEncoder::Decode(nsISOAPEncoding* aEncoding,
if (NS_FAILED(rc)) return rc;
rc = nsSOAPUtils::GetLocalName(value, name);
if (NS_FAILED(rc)) return rc;
rc = collection->GetElement(ns, name, getter_AddRefs(element));
rc = collection->GetElement(name, ns, getter_AddRefs(element));
// if (NS_FAILED(rc)) return rc;
if (element) {
rc = element->GetType(getter_AddRefs(subtype));

Просмотреть файл

@ -333,7 +333,7 @@ nsresult nsSOAPUtils::GetLocalName(const nsAString & aQName,
if (i < 0)
aLocalName = aQName;
else
aQName.Mid(aLocalName, i, aQName.Length() - i);
aQName.Mid(aLocalName, i+1, aQName.Length() - i);
return NS_OK;
}