Службы данных WCF + 'Веб-ответ содержал неожиданные разделы.ID = 16 'ошибка - PullRequest
0 голосов
/ 16 ноября 2011

Это довольно специфический вопрос, но у меня закончились идеи.Я использую Silverlight 4.0 и WCF Data Services.Ошибка 'Веб-ответ содержал неожиданные разделы.ID = 16 'происходит, когда я вызываю SaveChanges в контексте в клиенте Silverlight.Самое смешное, что один и тот же вызов / код работает для более простого сохранения, но не для более сложных (больше объектов на графике), и я почти уверен, что это сработало за один раз.Кроме того, данные попадают в базу данных, поэтому они должны быть успешными на сервере.

Я собрал пакеты для различных запросов $ batch с помощью Fiddler, и единственное отличие, которое я могу сказать, состоит в том, что существует больше сущностейв том, что не удалось.

DataServiceRequestException генерируется на клиенте в этом коде:

this.Context.BeginSaveChanges(SaveChangesOptions.Batch, new AsyncCallback((iar) =>
    {
        ServiceOperationStatus status = ServiceOperationStatus.Success;
        try
        {
            // Callback method for the async request, retrieves the status of the requested action
            DataServiceResponse response = this.Context.EndSaveChanges(iar);
             ...

Единственные страницы, которые я нашел при поиске: http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/c81cb454-01f5-4413-a99b-4ad059c5901f http://social.msdn.microsoft.com/Forums/en-US/adodotnetdataservices/thread/3bb4cef6-7f1e-4875-a140-271fe8ebb3cb/ ~, который упоминает многопоточность в Azure, но я почти уверен, что у меня нет этой проблемы.Я вызываю метод save из команды нажатия кнопки.

Буду признателен за любые мысли.Я собираюсь начать просматривать свою базу данных, чтобы убедиться, что что-то не изменилось, чего я не ожидал.Я добавлю больше информации, когда найду ее.

РЕДАКТИРОВАТЬ: добавлен пакетный обработанный пакет $ из Fiddler (я изменил некоторые имена и удалил свойства, чтобы удалить информацию, специфичную для домена)

--batchresponse_b7b32f26-5246-4d02-9a6e-24ab6156d798
Content-Type: multipart/mixed; boundary=changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 249
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/DT(314)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/DT(314)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="DTemplate" href="DT(314)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/ZFields" type="application/atom+xml;type=feed" title="ZFields" href="DT(314)/ZFields" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DSize" type="application/atom+xml;type=entry" title="Size" href="DT(314)/DSize" />
  <category term="DataModels.DTemplate" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 250
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/ZFields(351)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/ZFields(351)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="ZField" href="ZFields(351)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/DT" type="application/atom+xml;type=feed" title="DT" href="ZFields(351)/DT" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Media" type="application/atom+xml;type=feed" title="Media" href="ZFields(351)/Media" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Playlists" type="application/atom+xml;type=feed" title="Playlists" href="ZFields(351)/Playlists" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Layout" type="application/atom+xml;type=entry" title="Layout" href="ZFields(351)/Layout" />
  <category term="DataModels.ZField" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 251
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/Layouts(412)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/Layouts(412)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="Layout" href="Layouts(412)" />
  <category term="DataModels.Layout" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content
Content-ID: 252
Cache-Control: no-cache
DataServiceVersion: 1.0;

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content
Content-ID: 253
Cache-Control: no-cache
DataServiceVersion: 1.0;

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 254
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/Playlists(13410)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/Playlists(13410)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="Playlist" href="Playlists(13410)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PlaylistItems" type="application/atom+xml;type=feed" title="PlaylistItems" href="Playlists(13410)/PlaylistItems" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SEntities" type="application/atom+xml;type=feed" title="SEntities" href="Playlists(13410)/SEntities" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SConstraint" type="application/atom+xml;type=entry" title="SConstraint" href="Playlists(13410)/SConstraint" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PlaylistMode" type="application/atom+xml;type=entry" title="PlaylistMode" href="Playlists(13410)/PlaylistMode" />
  <category term="DataModels.Playlist" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 255
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/SConstraints(18677)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/SConstraints(18677)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="SConstraint" href="SConstraints(18677)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/TimeRanges" type="application/atom+xml;type=feed" title="TimeRanges" href="SConstraints(18677)/TimeRanges" />
  <category term="DataModels.SConstraint" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content
Content-ID: 256
Cache-Control: no-cache
DataServiceVersion: 1.0;

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 257
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/TimeRanges(16222)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/TimeRanges(16222)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="TimeRange" href="TimeRanges(16222)" />
  <category term="DataModels.TimeRange" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content
Content-ID: 258
Cache-Control: no-cache
DataServiceVersion: 1.0;

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content
Content-ID: 259
Cache-Control: no-cache
DataServiceVersion: 1.0;

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 260
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/PlaylistItems(1555717)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/PlaylistItems(1555717)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="PlaylistItem" href="PlaylistItems(1555717)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/Playlist" type="application/atom+xml;type=entry" title="Playlist" href="PlaylistItems(1555717)/Playlist" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/SConstraint" type="application/atom+xml;type=entry" title="SConstraint" href="PlaylistItems(1555717)/SConstraint" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/PExclusion" type="application/atom+xml;type=feed" title="PExclusion" href="PlaylistItems(1555717)/PExclusion" />
  <category term="DataModels.PlaylistItem" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content
Content-ID: 261
Cache-Control: no-cache
DataServiceVersion: 1.0;

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 262
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/SConstraints(18676)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/SConstraints(18676)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="SConstraint" href="SConstraints(18676)" />
  <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/TimeRanges" type="application/atom+xml;type=feed" title="TimeRanges" href="SConstraints(18676)/TimeRanges" />
  <category term="DataModels.SConstraint" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content
Content-ID: 263
Cache-Control: no-cache
DataServiceVersion: 1.0;

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 201 Created
Content-ID: 264
Cache-Control: no-cache
DataServiceVersion: 1.0;
Content-Type: application/atom+xml;charset=utf-8
Location: http://localhost/Services/EDMDataService.svc/TimeRanges(16221)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<entry xml:base="http://localhost/Services/EDMDataService.svc/" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom">
  <id>http://localhost/Services/EDMDataService.svc/TimeRanges(16221)</id>
  <title type="text"></title>
  <updated>2011-11-15T21:16:31Z</updated>
  <author>
    <name />
  </author>
  <link rel="edit" title="TimeRange" href="TimeRanges(16221)" />
  <category term="DataModels.TimeRange" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
  <content type="application/xml">
    <m:properties>

    </m:properties>
  </content>
</entry>
--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914
Content-Type: application/http
Content-Transfer-Encoding: binary

HTTP/1.1 204 No Content
Content-ID: 265
Cache-Control: no-cache
DataServiceVersion: 1.0;

--changesetresponse_d4c80211-1c69-4d36-98fd-df47e2383914--
--batchresponse_b7b32f26-5246-4d02-9a6e-24ab6156d798--
...