Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

WCF Data Services are not called correctly
Guest
#1 Posted : Wednesday, February 8, 2012 12:33:45 PM(UTC)
Groups: Member
Joined: 11/1/2005(UTC)
Posts: 278

Hi there,
Thanks for offering that tool for free. It's the easiest solution to run a 64 bits web server.

The proble I have is that my WCF Data Service is not working with your web server.

Create an empty web project.

Add WCF Data Service and insert the following code... Then run and browse that .svc page. Very easy to reproduce.

You should get this:

<?xml version="1.0" encoding="UTF-8" standalone="true"?>
-<service xmlns="http://www.w3.org/2007/app" xmlns:app="http://www.w3.org/2007/app" xmlns:atom="http://www.w3.org/2005/Atom" xml:base="http://localhost:43215/WcfDataService1.svc/"> -<workspace> <atom:title>Default</atom:title> -<collection href="Teams"> <atom:title>Teams</atom:title> </collection> -<collection href="Groups"> <atom:title>Groups</atom:title> </collection> </workspace> </service>

Whereas you get an empty HTML page. Meaning I' stuck because I need the 64 bits webserver and WCF Data Services ;)

Thanks,
John.

Here is the code of the svc dummy service:

using System;
using System.Collections.Generic;
using System.Data.Services;
using System.Data.Services.Common;
using System.Linq;
using System.ServiceModel.Web;
using System.Web;

namespace WebApplication1
{
[EntityPropertyMapping("Name",
SyndicationItemProperty.Title,
SyndicationTextContentKind.Plaintext,
false)]
[EntityPropertyMapping("Odds",
SyndicationItemProperty.Summary,
SyndicationTextContentKind.Plaintext,
false)]
public class Team
{
public static List<Team> Teams = new List<Team>{
new Team {ID = 1, Name = "New Zealand", Odds = "1:1000"},
new Team {ID = 2, Name = "Paraquay", Odds = "1:50"},};


public int ID { get; set; }
public string Name { get; set; }
public string Odds { get; set; }
}

[DataServiceKey("Name")]
[EntityPropertyMapping("Name",
SyndicationItemProperty.Title,
SyndicationTextContentKind.Plaintext,
false)]
public class Group
{
public static List<Group> Groups = new List<Group>{
new Group {
Name = "A",
Teams = new List<Team>{
Team.Teams[0],
Team.Teams[1],
Team.Teams[2],
Team.Teams[3]
}
},
new Group {
Name = "B",
Teams = new List<Team>{
Team.Teams[4],
Team.Teams[5],
Team.Teams[6],
Team.Teams[7]
}
},
};
public string Name { get; set; }
public List<Team> Teams { get; set; }
}

public class WorldCupData
{
public IQueryable<Team> Teams
{
get
{
return Team.Teams.AsQueryable();
}
}
public IQueryable<Group> Groups
{
get
{
return Group.Groups.AsQueryable();

}
}
}

public class WcfDataService1 : DataService<WorldCupData>
{
// This method is called only once to initialize service-wide policies.
public static void InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule("*", EntitySetRights.AllRead);
config.SetEntitySetPageSize("*", 100);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
}
}


PS: it also cool to be able to post to the forum as a guest ;)
knipjo
#2 Posted : Wednesday, February 8, 2012 1:08:38 PM(UTC)
Groups: Member
Joined: 2/8/2012(UTC)
Posts: 2

Ha, ok, here is how I attach files ;)

Attached there is the sample project. Just run it with and without your web server.

Make sure you browse the service: WcfDataService1.svc
File Attachment(s):
WebApiServer.rar (68kb) downloaded 106 time(s).
Ultidev Team
#3 Posted : Wednesday, February 8, 2012 1:43:47 PM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi!

We ran a quick test and saw that empty page comes with with 401 (not authorized) response code.

- WCF authorization problem first discovered with RIA services. We are working with Microsoft right now trying to resolve this issue. The problem you have reported will probably be resolved at the same time as RIA Services problem.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
knipjo
#4 Posted : Thursday, February 9, 2012 5:07:55 AM(UTC)
Groups: Member
Joined: 2/8/2012(UTC)
Posts: 2

Hi team,

This is basic http binding, then it should not have an issue with the bug you mention. And you say it only works in IIS but here it is working in the VS internal web server, which means it's not the same issue.

Second I'm less certain, but it looks like it's also not the same. Anyway, thank you for your fast support. I'll have to wait for a future release. Good luck with that ;)

John.
Ultidev Team
#5 Posted : Thursday, February 9, 2012 9:51:31 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
Hi, you are right about the bindings. We have re-tested it and, the first problem is just standard address mismatch, so we have edit it out. The actual problem, which is 401 (unauthorized) seems to be exactly what we have experienced with RIA Services: it works for localhost if Anonymous authentication is replaced with Windows, so we are reasonably sure that if WCF folks tell us what is going on, we may create a fix or a work-around.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Ultidev Team
#6 Posted : Thursday, March 22, 2012 10:53:23 AM(UTC)
Ultidev Team

Groups: Administration
Joined: 11/3/2005(UTC)
Posts: 2,253

Thanks: 28 times
Was thanked: 60 time(s) in 59 post(s)
He there!

The work-around is described here and next build (16) will have Windows auth implemented in a way more consistent with how IIS does it.

Best regards,
UltiDev Team.
Please donate at http://www.ultidev.com/products/Donate.aspx to help us improve our products.
Guest
#7 Posted : Tuesday, September 18, 2018 8:42:54 PM(UTC)
Groups: Member
Joined: 11/1/2005(UTC)
Posts: 278

Message was deleted by a Moderator.
Rss Feed  Atom Feed
Users browsing this topic
Guest (4)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.