OrderService - "lastModifiedDateTime" in Statement is throwing [ServerError.SERVER_ERROR @ ]

179 views
Skip to first unread message

Paige Watson

unread,
Dec 10, 2012, 2:23:36 PM12/10/12
to google-doubleclick...@googlegroups.com
 
I'm trying to get the orders modified since the last time I checked.
Here's the code I am using:
 
OrderService orderService = (OrderService)User.GetService(DfpService.v201208.OrderService);
// Sets defaults for page and Statement.
OrderPage page = new OrderPage();
int offset = 0;
int startCount = 0;
int endCount = 0;
int limit = 500; 
//DownloadDateTime = System.DateTime.Now - 1 hour 
Statement statement = new StatementBuilder(string.Format("WHERE lastModifiedDateTime >= :lastModifiedDateTime ORDER BY id LIMIT 500 OFFSET {0}", offset)).AddValue("lastModifiedDateTime", DateTimeUtilities.FromDateTime(DownloadDateTime)).ToStatement(); 
// Get orders by Statement.
page = orderService.getOrdersByStatement(statement);
When I run this, a [ServerError.SERVER_ERROR @ ] exception is returned.  If I remove "WHERE lastModifiedDateTime >= :lastModifiedDateTime" from the statement, it works without issue, but returns everything.

Statement statement = new StatementBuilder(string.Format("ORDER BY id LIMIT 500 OFFSET {0}", offset)).ToStatement();

What am I missing?

Vincent Tsao (DFP API Team)

unread,
Dec 11, 2012, 11:36:44 AM12/11/12
to google-doubleclick...@googlegroups.com
Hello:

Could you post the SOAP XML for your request and response where this is failing? Please remember to strip out your auth token before posting.

Thanks,
Vincent Tsao, DFP API Team
Message has been deleted
Message has been deleted

Vincent Tsao (DFP API Team)

unread,
Jan 16, 2013, 8:00:13 PM1/16/13
to google-doubleclick...@googlegroups.com
Deleted message because it contained your auth token. Please remember to strip out your auth token before posting any SOAP XML logs. Please also change your DFP password immediately.

My reply to your message is as follows:

Hello:
This is a known issue that we are working on. For now the workaround is to not use bind variables:
"WHERE lastModifiedDateTime >= :lastModifiedDateTime"
so instead of ":lastModifiedDateTime", put the date directly into the query as a string. Let me know if that works.

Thanks,
Vincent Tsao, DFP API Team

Vincent Tsao (DFP API Team)

unread,
Jan 17, 2013, 3:54:46 PM1/17/13
to google-doubleclick...@googlegroups.com
This should now be fixed and should work with bind variables again. Please let me know if it still does not work for anybody.

Thanks,
Vincent Tsao, DFP API Team

Søren Gregersen

unread,
Jan 17, 2013, 5:19:23 PM1/17/13
to google-doubleclick...@googlegroups.com
I've just run into this issue, and spend a few hours figuring out what was going on.

Please let me know if you need any help testing this.

dpsadtr...@gmail.com

unread,
Jan 18, 2013, 2:09:28 PM1/18/13
to google-doubleclick...@googlegroups.com
I put the bind variable code back..and re-tested...it seem to give me the same error as before: see below.

was I supposed to UPDATE something on my end?  How would your fix be applied? Or does my customer need to update something on their end?

GetAllOrders:::Setting Last ModDate FROM 'app.config=System.Configuration.KeyValueInternalCollection'
GetAllOrders::oneDaysAgo_str=2012/10/16 12:59:5
GetAllOrders:statement.query=WHERE lastModifiedDateTime >= :lastModifiedDateTime ORDER BY lastModifiedDateTime ASC LIMIT 500 OFFSET 0
Failed to get all orders. Exception says "[ServerError.SERVER_ERROR @ ]"

Vincent Tsao (DFP API Team)

unread,
Jan 18, 2013, 2:18:16 PM1/18/13
to google-doubleclick...@googlegroups.com
Hi All:

Apologies for this, I thought the fix was pushed but it has not been. I will confirm next time before updating you.

For now, please continue using the workaround of inlining the dateTime directly into the query and not using bind variables. Thanks for your patience on this.

Vincent Tsao, DFP API Team

Reply all
Reply to author
Forward
0 new messages