Ok the cryptic message should really have said, "Check your svc address donkey" 
:)

Works great now


Regards,
Philip Beadle
Readify | Principal Consultant
Microsoft MVP - ASP/ASP.NET, MCAD, MCT
Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia
M: +61 417 301 024 | E: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> | C: [EMAIL 
PROTECTED]<sip:[EMAIL PROTECTED]> | W: www.readify.net<http://www.readify.net/>

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Philip Beadle
Sent: Wednesday, October 08, 2008 10:38 AM
To: listserver@ozSilverlight.com
Subject: [OzSilverlight] ADO.Net DataServices - mime type issues

Hi All

I am trying to call a data service on EF from Silverlight RC0 and am getting an 
error that says

Error processing response's mime-type type 'text/html'.  The only supported 
mime-type is 'application/atom+xml'.

If I manually hit the service I get what I expect.

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<feed 
xml:base="http://dotnetnuke.teched/DesktopModules/SL_Announcements/DataService.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";>
  <title type="text">C_dnn_PhilipBeadle_SL_Announcements</title>
  
<id>http://dotnetnuke.teched/DesktopModules/SL_Announcements/DataService.svc/C_dnn_PhilipBeadle_SL_Announcements</id>
  <updated>2008-10-07T23:33:29Z</updated>
  <link rel="self" title="C_dnn_PhilipBeadle_SL_Announcements" 
href="C_dnn_PhilipBeadle_SL_Announcements" />
  <entry>
    
<id>http://dotnetnuke.teched/DesktopModules/SL_Announcements/DataService.svc/C_dnn_PhilipBeadle_SL_Announcements(1)</id>
    <title type="text"></title>
    <updated>2008-10-07T23:33:28Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="C_dnn_PhilipBeadle_SL_Announcements" 
href="C_dnn_PhilipBeadle_SL_Announcements(1)" />
    <category term="DotNetNuke.TechEdModel.C_dnn_PhilipBeadle_SL_Announcements" 
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"; />
    <content type="application/xml">
      <m:properties>
        <d:ModuleID m:type="Edm.Int32">379</d:ModuleID>
        <d:ItemID m:type="Edm.Int32">1</d:ItemID>
        <d:Content>&amp;lt;p&amp;gt;Item 1&amp;lt;/p&amp;gt;</d:Content>
        <d:CreatedByUser m:type="Edm.Int32">1</d:CreatedByUser>
        <d:CreatedDate 
m:type="Edm.DateTime">2008-10-06T14:27:55.547</d:CreatedDate>
      </m:properties>
    </content>
  </entry>
  <entry>
    
<id>http://dotnetnuke.teched/DesktopModules/SL_Announcements/DataService.svc/C_dnn_PhilipBeadle_SL_Announcements(2)</id>
    <title type="text"></title>
    <updated>2008-10-07T23:33:28Z</updated>
    <author>
      <name />
    </author>
    <link rel="edit" title="C_dnn_PhilipBeadle_SL_Announcements" 
href="C_dnn_PhilipBeadle_SL_Announcements(2)" />
    <category term="DotNetNuke.TechEdModel.C_dnn_PhilipBeadle_SL_Announcements" 
scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme"; />
    <content type="application/xml">
      <m:properties>
        <d:ModuleID m:type="Edm.Int32">379</d:ModuleID>
        <d:ItemID m:type="Edm.Int32">2</d:ItemID>
        <d:Content>&amp;lt;p&amp;gt;More content for the 
lists&amp;lt;/p&amp;gt;</d:Content>
        <d:CreatedByUser m:type="Edm.Int32">1</d:CreatedByUser>
        <d:CreatedDate 
m:type="Edm.DateTime">2008-10-06T14:28:11.007</d:CreatedDate>
      </m:properties>
    </content>
  </entry>
</feed>


And this is how I call the service. Error is on the yellow line.

        void GetList_Executed(object sender, CommandPattern.ExecutedEventArgs e)
        {
            var query = (from c in 
App.proxy.C_dnn_PhilipBeadle_SL_Announcements select c);
            var userQuery = 
(DataServiceQuery<C_dnn_PhilipBeadle_SL_Announcements>)query;
            userQuery.BeginExecute(OnGetListComplete, query);
        }

        void OnGetListComplete(IAsyncResult result)
        {
            var query = 
(DataServiceQuery<C_dnn_PhilipBeadle_SL_Announcements>)result.AsyncState;
            var lst = query.EndExecute(result).ToList(); error occurs here
            foreach(var ann in lst)
            {
                var announcement = new SL_AnnouncementInfo
                {
                    Content = ann.Content,
                    CreatedByUserName = ann.CreatedByUser.ToString(),
                    ModuleId = ann.ModuleID,
                    CreatedDate = ann.CreatedDate
                };
                col.Add(announcement);
            }
            Commands.BindList.Execute(col);
        }
Regards,
Philip Beadle
Readify | Principal Consultant
Microsoft MVP - ASP/ASP.NET, MCAD, MCT
[cid:image001.gif@01C9293A.89E2BD70]
Suite 206 Nolan Tower | 29 Rakaia Way | Docklands | VIC 3008 | Australia
M: +61 417 301 024 | E: [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]> | C: [EMAIL 
PROTECTED]<sip:[EMAIL PROTECTED]> | W: www.readify.net<http://www.readify.net/>
________________________________
The content of this e-mail, including any attachments is a confidential 
communication between Readify Pty Ltd and the intended addressee and is for the 
sole use of that intended addressee. If you are not the intended addressee, any 
use, interference with, disclosure or copying of this material is unauthorized 
and prohibited. If you have received this e-mail in error please contact the 
sender immediately and then delete the message and any attachment(s).
P Please consider your environmental responsibility before printing this e-mail

------------------------------------------------------------------- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.
Powered by mailenable.com - List managed by www.readify.net



------------------------------------------------------------------- 
OzSilverlight.com - to unsubscribe from this list, send a message back to the 
list with 'unsubscribe' as the subject.

Powered by mailenable.com - List managed by www.readify.net

<<inline: image001.gif>>

Reply via email to