PC Review


Reply
Thread Tools Rate Thread

I can't get Batch request to work with ADO.NET Data Services, needhelp

 
 
bart
Guest
Posts: n/a
 
      24th Jul 2009
http://wiibart.posterous.com/i-cant-...rk-with-adonet

We are using a ADO.NET REST service and it does not allow to update a
record with many related records like a customer with orders or a
playlist with its items.

To avoid too many http requests I decided to look at ADO.NET batch
requests.

But after a day of testing and googling I have not made any batch
update yet, I did get a lot of unhelpful errors. The examples in the
documentation don't help much either and are also not very clear I
must say.

When I use following headers I get an 400 response with error JSON
format as shown below;




MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=batch(c8660a87-b5d3-40c3-ac52-
bdeff069231e)
Accept: application/json

{
"error": {
"code": "", "message": {
"lang": "nl-NL", "value": "Media type requires a \';\' character
before a parameter definition."
}
}
}

So I searched the Internet and found some examples that specify the
boundary different, so I tried;

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=batch_c8660a87-b5d3-40c3-ac52-
bdeff069231e
Accept: application/json

Now I get this 202 response (in xml)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/
metadata">
<code></code>
<message xml:lang="nl-NL">The boundary delimiter ' --batch_c8660a87-
b5d3-40c3-ac52-bdeff069231e' is not valid. Please specify a valid
boundary delimiter or make sure that the content length specified is
correct.</message>
</error>
--batchresponse_ad73de2c-21dd-47c4-84ed-007aecb447db--

It seems like the boundary delimiter in de body is wrong, I have the
body set like this;

--batch_c8660a87-b5d3-40c3-ac52-bdeff069231e
Content-Type: multipart/mixed; boundary=changeset_77162fcd-b8da-41ac-
a9f8-9357efbbd621

--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621
Content-Type: application/http
Content-Transfer-Encoding: binary

MERGE /PlaylistItem(272L) HTTP/1.1
Content-Type: application/atom+xml;type=entry

{ SortOrder: 1 }

--changeset_77162fcd-b8da-41ac-a9f8-9357efbbd621--

--batch_c8660a87-b5d3-40c3-ac52-bdeff069231e--


So I'm lost, and by posting this article I hope someone can help me,
and with that help others. You can comment on this article using your
Twitter credentials using OAUTH

Thanks,

Bart
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Data.SqlClient.SqlException: An attempt to attach an auto-named database for file weird0 Microsoft C# .NET 3 30th May 2007 07:27 AM
needhelp TulasiKumar Microsoft Dot NET 0 13th Mar 2006 07:59 AM
Batch file help request Larry Dighera Windows XP General 6 7th May 2005 07:52 PM
Re: needhelp Carey Frisch [MVP] Windows XP Setup 0 21st May 2004 02:43 PM
batch command doesn't work if called by another batch jonefer Windows XP General 3 20th Nov 2003 05:35 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:56 PM.