I have an interesting twist to this set of WCF RIA problems.
I can get my WCF RIA services working nicely, as long as I access my site using the original domain name, on a site hosted by DiscountAsp.Net (http://dreamnit.com/Money.Web). You can try this by signing in as
User: "casey", Password: "password").
But if I try and access the exact same site via a domain name pointer (http://yinyangmoney.com/Money.Web) and using the same sign in as before, I get the "Not Found" error.
I am using the DomainServiceHostFactory
solution, but it appears that the WCF RIA services can't even find my Money-Web-AuthenticationServices.svc file which points to the factory class. When I come in using the domain name pointer, the error is visible in the app and via Fiddler.
I am using IIS7. I also made another interesting discovery. I can make either of my domain names work by hard coding the references to the SVC files in my DomainServiceHostFactory class. However, I cannot make both of them work...
Here is my DomainServiceHostFactory class that makes the "yinyangmoney" domain name work, but breaks the "dreamnit" domain name...
public
class
AuthenticationServiceHostFactory :
DomainServiceHostFactory
{
protected
override
ServiceHost CreateServiceHost(Type serviceType,
Uri[] baseAddresses)
{
bool bLocalHost =
false;
foreach (Uri uri
in baseAddresses)
{
if (uri.ToString().Contains("://localhost"))
bLocalHost = true;
}
Although I don't believe it to be a cross domain issue, since I just want to find the SVC file for the domain I come in on. And I also have my cross domain config set to wide open anyway.
I guess it comes down to the Uri baseAddresses that I pass to
DomainServiceHost. I can make it work if I pass a single, hardcoded SVC Uri in an array of 1, but I can't make it work if I pass the Uri in an array of 2.
Hosting RIA services on shared hosting environment and without changing anything on IIS Or RIA . Yes it is possible...
RIA framework dynamically creates WCF service (Domain services) and add endpoints to the service.It first check if endpoint does'nt exist then create it,and it checks for 3 endpoints (http,soap and binary).After creating end points it adds authentication schema
to end points.It picks IIS authentication schema's and tries to apply on end points and failed to apply.
If we could create desired end points in web.config RIA framework will not create or do anything with endpoints and it works succesfully ..
I had major issues just trying to get authentication working on my main project, always getting a NotFound for query "GetUser". What was weird is that i had the same exact config content for a new project i created after installing WCF Services.
I was able to debug the new Project using visual studio development server on XP. But i was unable to do so with my converted project.
Then i hit your article, and it got things running for me (so far)
All i required was the serviceHostingEnvironment part, defining my prefix to
http://localhost:<port>
Maybe the rest is not always required, so people should try with the serviceHostingEnvironment section first.
and Thank you very very much for all your hard work tracking this issue.
I had the same issue, the app working in VS but not in IIS6.
When tried to access the authenticationservice as http://server/site/site-Web-AuthenticationService.svc, got this
IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme.
I fixed it by unchecking "Integrated windows authentication" checkbox in authentication methods of IIS. Now there are no methods selected.
sandus
Member
36 Points
69 Posts
Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Nov 25, 2009 08:07 AM | LINK
Thank's
IT"S WORKING NOW !
jimmccurdy
Member
44 Points
19 Posts
Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Nov 25, 2009 02:13 PM | LINK
I have an interesting twist to this set of WCF RIA problems.
I can get my WCF RIA services working nicely, as long as I access my site using the original domain name, on a site hosted by DiscountAsp.Net (http://dreamnit.com/Money.Web). You can try this by signing in as User: "casey", Password: "password").
But if I try and access the exact same site via a domain name pointer (http://yinyangmoney.com/Money.Web) and using the same sign in as before, I get the "Not Found" error.
I am using the DomainServiceHostFactory solution, but it appears that the WCF RIA services can't even find my Money-Web-AuthenticationServices.svc file which points to the factory class. When I come in using the domain name pointer, the error is visible in the app and via Fiddler.
Does anyone have any ideas about this one?
Jim
ColinBlair
All-Star
29787 Points
5012 Posts
Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Nov 25, 2009 02:19 PM | LINK
Are you using IIS6 or IIS7? I am also hosted at DiscountAsp.net so I know they have different servers.
Upshot Blog
ColinBlair on Twitter
MVVM and RIA Services
jimmccurdy
Member
44 Points
19 Posts
Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Nov 25, 2009 03:02 PM | LINK
I am using IIS7. I also made another interesting discovery. I can make either of my domain names work by hard coding the references to the SVC files in my DomainServiceHostFactory class. However, I cannot make both of them work...
Here is my DomainServiceHostFactory class that makes the "yinyangmoney" domain name work, but breaks the "dreamnit" domain name...
public class AuthenticationServiceHostFactory : DomainServiceHostFactory{
protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
{
bool bLocalHost = false;
foreach (Uri uri in baseAddresses)
{
if (uri.ToString().Contains("://localhost"))
bLocalHost = true;
}
if (!bLocalHost) // Specify the exact URL of the web service
baseAddresses = new Uri[]
{
new Uri(http://yinyangmoney.com/Money.Web/Services/Money-Web-AuthenticationService.svc),
//new Uri(http://dreamnit.com/Money.Web/Services/Money-Web-AuthenticationService.svc),
};
return new DomainServiceHost(serviceType, baseAddresses);
}
}
ColinBlair
All-Star
29787 Points
5012 Posts
Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Nov 25, 2009 03:08 PM | LINK
Do you have Fiddler installed to see what is actually happening? I think you might be seeing a cross domain issue going on here somehow.
Upshot Blog
ColinBlair on Twitter
MVVM and RIA Services
jimmccurdy
Member
44 Points
19 Posts
Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Nov 25, 2009 03:29 PM | LINK
Although I don't believe it to be a cross domain issue, since I just want to find the SVC file for the domain I come in on. And I also have my cross domain config set to wide open anyway.
I guess it comes down to the Uri baseAddresses that I pass to DomainServiceHost. I can make it work if I pass a single, hardcoded SVC Uri in an array of 1, but I can't make it work if I pass the Uri in an array of 2.
Works:Works:
baseAddresses = new Uri[]
{
new Uri(http://yinyangmoney.com/Money.Web/Services/Money-Web-AuthenticationService.svc),
//new Uri(http://dreamnit.com/Money.Web/Services/Money-Web-AuthenticationService.svc),
};
return new DomainServiceHost(serviceType, baseAddresses);
baseAddresses = new Uri[]
{
//new Uri(http://yinyangmoney.com/Money.Web/Services/Money-Web-AuthenticationService.svc),
new Uri(http://dreamnit.com/Money.Web/Services/Money-Web-AuthenticationService.svc),
};
return new DomainServiceHost(serviceType, baseAddresses);
Doesn't work:
baseAddresses = new Uri[]
{
new Uri(http://yinyangmoney.com/Money.Web/Services/Money-Web-AuthenticationService.svc),
new Uri(http://dreamnit.com/Money.Web/Services/Money-Web-AuthenticationService.svc),
};
return new DomainServiceHost(serviceType, baseAddresses);
rajneeshnoonia
Member
16 Points
8 Posts
Re: Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Dec 11, 2009 06:50 AM | LINK
RIA framework dynamically creates WCF service (Domain services) and add endpoints to the service.It first check if endpoint does'nt exist then create it,and it checks for 3 endpoints (http,soap and binary).After creating end points it adds authentication schema to end points.It picks IIS authentication schema's and tries to apply on end points and failed to apply.
If we could create desired end points in web.config RIA framework will not create or do anything with endpoints and it works succesfully ..
Check complete solution at my blog "Rajneesh Noonia" (http://rajneeshnoonia.blogspot.com)
MComeauS2S
Member
290 Points
164 Posts
Re: Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Dec 11, 2009 08:48 PM | LINK
Hi rajneesh,
I had major issues just trying to get authentication working on my main project, always getting a NotFound for query "GetUser". What was weird is that i had the same exact config content for a new project i created after installing WCF Services.
I was able to debug the new Project using visual studio development server on XP. But i was unable to do so with my converted project.
Then i hit your article, and it got things running for me (so far)
All i required was the serviceHostingEnvironment part, defining my prefix to http://localhost:<port>
Maybe the rest is not always required, so people should try with the serviceHostingEnvironment section first.
and Thank you very very much for all your hard work tracking this issue.
mj_sheppard
Member
12 Points
21 Posts
Re: Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Dec 31, 2009 06:45 PM | LINK
I had the same problem but setting up the profile provider as suggested by steyoung fixed it. [:)]
Thanks,
Michael
josejoco
Member
20 Points
16 Posts
Re: Re: Re: Re: Re: Re: Re: Re: Re: Authentication failed after switching to WCF RIA
Jan 26, 2010 02:52 PM | LINK
I had the same issue, the app working in VS but not in IIS6.
When tried to access the authenticationservice as http://server/site/site-Web-AuthenticationService.svc, got this IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme.
I fixed it by unchecking "Integrated windows authentication" checkbox in authentication methods of IIS. Now there are no methods selected.