def FillAbstractObject(service, objectType, valueDict):
    """This method is useful for creating the "cartItems" and "payments" fields of
       the CheckoutShoppingCart method. It takes in the array currently being built,
       the name in the WSDL of the element to be added (e.g. DebitAccountInfo for payments
       or Package for the Item field of a CartItem."""
    newObject = service.factory.create(objectType)
    for currField in valueDict.keys():
        setattr(newObject, currField, valueDict[currField])
    return newObject
