NS_ENSURE_ARG_POINTER(aEncoding); NS_ENSURE_ARG_POINTER(aSource); NS_ENSURE_ARG_POINTER(_retval); *_retval = nsnull;
    nsStructEncoder::Decode(nsISOAPEncoding * aEncoding,                             nsIDOMElement * aSource,                             nsISchemaType * aSchemaType,                             nsISOAPAttachments * aAttachments,                             nsIVariant ** _retval){  nsresult rc;  nsCOMPtr<nsISOAPPropertyBagMutator> mutator = do_CreateInstance(NS_SOAPPROPERTYBAGMUTATOR_CONTRACTID, &rc);  if (NS_FAILED(rc))    return rc;  nsCOMPtr<nsISchemaModelGroup>modelGroup;  if (aSchemaType) {    nsCOMPtr<nsISchemaComplexType>ctype = do_QueryInterface(aSchemaType);    if (ctype) {      rc = ctype->GetModelGroup(getter_AddRefs(modelGroup));      if (NS_FAILED(rc))        return rc;    }  }  nsCOMPtr<nsIDOMElement> child;  nsSOAPUtils::GetFirstChildElement(aSource, getter_AddRefs(child));  nsCOMPtr<nsIDOMElement> result;  rc =  DecodeStructParticle(aEncoding, child, modelGroup, aAttachments, mutator, getter_AddRefs(result));  if (!NS_FAILED(rc)  //  If there were elements left over, then we failed to decode everything.      && result)    rc = SOAP_EXCEPTION(NS_ERROR_ILLEGAL_VALUE,"SOAP_LEFTOVERS","Decoded struct contained extra items not mentioned in the content model.");  if (NS_FAILED(rc))    return rc;  nsCOMPtr < nsIPropertyBag > bag;  rc = mutator->GetPropertyBag(getter_AddRefs(bag));  if (NS_FAILED(rc))    return rc;  nsCOMPtr < nsIWritableVariant > p =      do_CreateInstance(NS_VARIANT_CONTRACTID, &rc);  if (NS_FAILED(rc))    return rc;  p->SetAsInterface(NS_GET_IID(nsIPropertyBag), bag);  if (NS_FAILED(rc))    return rc;  *_retval = p;  NS_ADDREF(*_retval);  return NS_OK;}