Hi,
I'm trying to create a budget via WCF Connected service in VS2017 (netcore 2.0) app. I'm using v201710 version.
Code:
/// Create the campaign budget.
Budget budget = new Budget
{
deliveryMethod = BudgetBudgetDeliveryMethod.STANDARD,
amount = new Money { microAmount = 50000000 },
isExplicitlyShared = false
};
BudgetOperation budgetOperation = new BudgetOperation();
budgetOperation.@operator = Operator.ADD;
budgetOperation.operand = budget;
var operations = new BudgetOperation[] { budgetOperation };
try
{
BudgetReturnValue budgetRetval = Client.mutateAsync(_soapHeader, operations).Result.rval;
//Client.CloseAsync();
return budgetRetval.value[0];
}
catch (Exception e)
{
throw new System.ApplicationException("Failed to add budget.", e);
}
It is failing with - [RangeError.TOO_LOW @ operations[0].operand.amount, RequiredError.REQUIRED @ operations[0].operator] - even though both amount and operator are assigned.
The client is constructed via Activator.CreateInstance<T>() where T is BudgetServiceInterfaceClient from WCF generated class.
For example, the same setup but getAsync for the budget works fine.
Any ideas what could be wrong? When I use .NET 4.6.1 ad AdWords client library, the budget creation works fine.
Any help appreciated.
Thanks,
Martin