rc = aEncoding->GetDecoder(schemaType, schemaURI, getter_AddRefs(decoder));
rc = aEncoding->GetDecoder(schemaURI, schemaType, getter_AddRefs(decoder));
NS_IMETHODIMP nsDefaultEncoder::Decode(nsISOAPEncoding* aEncoding,		                            nsIDOMElement *aSource, 					    nsISchemaType *aSchemaType,					    nsISOAPAttachments* aAttachments,					    nsIVariant **_retval){  nsCOMPtr<nsISOAPDecoder> decoder;  nsCOMPtr<nsISchemaType> type = aSchemaType;  if (!type) {	//  Where no type has been specified, look one up from schema attribute, if it exists    nsCOMPtr<nsISchemaCollection> collection;    nsresult rc = aEncoding->GetSchemaCollection(getter_AddRefs(collection));    if (NS_FAILED(rc)) return rc;    nsAutoString explicittype;    rc = aSource->GetAttributeNS(kSchemaDatatypesNamespaceURI, kSchemaTypeAttribute, explicittype);    if (NS_FAILED(rc)) return rc;    nsAutoString ns;    nsAutoString name;    if (!explicittype.IsEmpty()) {      rc = nsSOAPUtils::GetNamespaceURI(aSource, explicittype, ns);      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));      if (NS_FAILED(rc)) return rc;    }    if (!type) {      rc = aSource->GetNamespaceURI(ns);      if (NS_FAILED(rc)) return rc;      rc = aSource->GetLocalName(name);      if (NS_FAILED(rc)) return rc;      nsCOMPtr<nsISchemaElement> element;      rc = collection->GetElement(ns, name, getter_AddRefs(element));      if (NS_FAILED(rc)) return rc;      if (element) {        rc = element->GetType(getter_AddRefs(type));        if (NS_FAILED(rc)) return rc;      }       else if (ns.Equals(nsSOAPUtils::kSOAPEncodingURI)) {  	//  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));	}	else {          rc = collection->GetType(kSchemaDatatypesNamespaceURI, name, getter_AddRefs(type));	}        if (NS_FAILED(rc)) return rc;      }    }  }  if (type) {    nsCOMPtr<nsISchemaType> lookupType = type;    do {      nsAutoString schemaType;      nsAutoString schemaURI;      nsresult rc = lookupType->GetName(schemaType);      if (NS_FAILED(rc)) return rc;      rc = lookupType->GetTargetNamespace(schemaURI);      if (NS_FAILED(rc)) return rc;      rc = aEncoding->GetDecoder(schemaType, schemaURI, 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));      }      else {	break;      }    } while(lookupType);  }  if (!decoder) {    PRUint16 typevalue;    if (type) {      nsresult rc = type->GetSchemaType(&typevalue);      if (NS_FAILED(rc)) return rc;    }    else {      typevalue = nsISchemaType::SCHEMA_TYPE_COMPLEX;    }    nsAutoString schemaType;    if (typevalue == nsISchemaType::SCHEMA_TYPE_COMPLEX) {      schemaType.Assign(kAnyTypeSchemaType);    }    else {      schemaType.Assign(kAnySimpleTypeSchemaType);    }    nsresult rc = aEncoding->GetDecoder(schemaType, kSchemaDatatypesNamespaceURI, getter_AddRefs(decoder));    if (NS_FAILED(rc)) return rc;  }  if (decoder) {    return decoder->Decode(aEncoding, aSource, type, aAttachments, _retval);  }  return NS_ERROR_NOT_IMPLEMENTED;}