var locationCriterion = new LocationGroups {
matchingFunction = new Function
{
operatorSpecified = true,
@operator = FunctionOperator.AND,
lhsOperand = new FunctionArgumentOperand[]
{
new LocationExtensionOperand
{
radius = new ConstantOperand
{
typeSpecified = true,
type = ConstantOperandConstantType.LONG,
unitSpecified = true,
unit = ConstantOperandUnit.MILES,
longValueSpecified = true,
longValue = distance
}
},
},
rhsOperand = new FunctionArgumentOperand[] {
new GeoTargetOperand
{
locations = new long[123456789]
}
}
}
};
When I send the request through I get the "The request was aborted: The connection was closed unexpectedly."
Can anyone see something obvious that is wrong with this Criterion? The remainder of the code works perfectly with other Criterions.
Having a few issues getting the actual SOAP request but will try and get it if I need to.
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Header> <RequestHeader xmlns="https://adwords.google.com/api/adwords/cm/v201502"> <clientCustomerId>MyCustID</clientCustomerId> <developerToken>MyDevToken</developerToken> <userAgent>MyAgent</userAgent> </RequestHeader> </soap:Header> <soap:Body> <mutate xmlns="https://adwords.google.com/api/adwords/cm/v201502"> <operations> <operator>ADD</operator> <operand> <campaignId>293088684</campaignId> <criterion xsi:type="LocationGroups"> <matchingFunction> <operator>AND</operator> <lhsOperand xsi:type="LocationExtensionOperand"> <radius> <type>LONG</type> <unit>MILES</unit> <longValue>20</longValue> </radius> </lhsOperand> <rhsOperand xsi:type="GeoTargetOperand"> <locations>2826</locations> </rhsOperand> </matchingFunction> </criterion> </operand> </operations> </mutate> </soap:Body> </soap:Envelope>
Response: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <ResponseHeader xmlns="https://adwords.google.com/api/adwords/cm/v201502"> <requestId>0005134c51aac2c80ac45d8a000042bb</requestId> <serviceName>CampaignCriterionService</serviceName> <methodName>mutate</methodName> <operations>0</operations> <responseTime>249</responseTime> </ResponseHeader> </soap:Header> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>[FunctionError.INVALID_OPERATOR @ operations[0].operand.criterion.matchingFunction, FunctionError.INVALID_NUMBER_OF_OPERANDS @ operations[0].operand.criterion.matchingFunction.rhsOperand]</faultstring> <detail> <ApiExceptionFault xmlns="https://adwords.google.com/api/adwords/cm/v201502"> <message>[FunctionError.INVALID_OPERATOR @ operations[0].operand.criterion.matchingFunction, FunctionError.INVALID_NUMBER_OF_OPERANDS @ operations[0].operand.criterion.matchingFunction.rhsOperand]</message> <ApplicationException.Type>ApiException</ApplicationException.Type> <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FunctionError"> <fieldPath>operations[0].operand.criterion.matchingFunction</fieldPath> <trigger></trigger> <errorString>FunctionError.INVALID_OPERATOR</errorString> <ApiError.Type>FunctionError</ApiError.Type> <reason>INVALID_OPERATOR</reason> </errors> <errors xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="FunctionError"> <fieldPath>operations[0].operand.criterion.matchingFunction.rhsOperand</fieldPath> <trigger></trigger> <errorString>FunctionError.INVALID_NUMBER_OF_OPERANDS</errorString> <ApiError.Type>FunctionError</ApiError.Type> <reason>INVALID_NUMBER_OF_OPERANDS</reason> </errors> </ApiExceptionFault> </detail> </soap:Fault> </soap:Body> </soap:Envelope>