locked
RIA services Http 400 error RRS feed

  • Question

  • This is really a night mare. I am getting http 400 errors when I access the services and I am neither able to login using the membership provider nor able to do anything else but for accessing the .svc urls.

    I did the following.

    1. Read the blog by timheur at http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx

    2. Deployed the site on IIS 6 windows 2003.

    3. Made sure that web.config contains the following entries. Apart from the following entries, I also have the RIAServiceBehaviour configured.

    1    	  <service name="ZBSilverBusiness.Web.AuthenticationService" behaviorConfiguration="RIAServiceBehavior">
    2    		<endpoint address="" binding="wsHttpBinding" contract="ZBSilverBusiness.Web.AuthenticationService" />
    3    		<endpoint address="/soap" binding="basicHttpBinding" contract="ZBSilverBusiness.Web.AuthenticationService" />
    4    		<endpoint address="/binary" binding="customBinding" bindingConfiguration="BinaryHttpBinding" contract="ZBSilverBusiness.Web.AuthenticationService" />
    5    	  </service>
    6    	  <service name="ZBSilverBusiness.Web.UserRegistrationService" behaviorConfiguration="RIAServiceBehavior">
    7    		 <endpoint address="" binding="wsHttpBinding" contract="ZBSilverBusiness.Web.UserRegistrationService" />
    8    		 <endpoint address="/soap" binding="basicHttpBinding" contract="ZBSilverBusiness.Web.UserRegistrationService" />
    9    		 <endpoint address="/binary" binding="customBinding" bindingConfiguration="BinaryHttpBinding" contract="ZBSilverBusiness.Web.UserRegistrationService" />
    10   	  </service>
    11   	  <service name="ZBSilverBusiness.Web.MyDomainService" behaviorConfiguration="RIAServiceBehavior">
    12   		 <endpoint address="" binding="wsHttpBinding" contract="ZBSilverBusiness.Web.MyDomainService" />
    13   		 <endpoint address="/soap" binding="basicHttpBinding" contract="ZBSilverBusiness.Web.MyDomainService" />
    14   		 <endpoint address="/binary" binding="customBinding" bindingConfiguration="BinaryHttpBinding" contract="ZBSilverBusiness.Web.MyDomainService" />
    15   	  </service>
    16   
    
     

    3. Created a domain service as follows.

    public class MyDomainService : DomainService
        {
            [Invoke(HasSideEffects = false)]
            public string Echo()
            {
                var b = OperationContext.Current.Host.Description.Endpoints[0] as WebHttpBinding;
                return b.Security.Mode + " - " + b.Security.Transport.ClientCredentialType;
            }
        }
    
    

    4. Loaded it like http://ipaddress/ClientBin/ZBSilverBusiness-Web-Services-MyDomainService.svc . This works very well.

    5. Now when I try accessing http://ipaddress/ClientBin/ZBSilverBusiness-Web-Services-MyDomainService.svc/Echo  or http://ipaddress/ClientBin/ZBSilverBusiness-Web-Services-MyDomainService.svc/binary it gives me Http 400 error.

    Can anyone help?

    Muthu

     

    Friday, December 25, 2009 5:01 AM

Answers

  • The problem is solved now. I seriously don't exactly know how. I did the following things.

    I Installed RIAServices on the server with server=true flag and then followed the steps from timheur blog. It was originally not working.

    But eventually I had to restart the server for a few other things and now my RIA App magically stopped giving me 404 errors.

    But I was still left with Authentication service not being able to connect to the database I mentioned. Finally I found that the RIA is still using the Connecting string named as "LocalSqlServer" and doesn't honour any connection string that I use. I do not know if this is by design and I have not read the documentation, but finally I could see that it is working.

    Thanks Colin for atleast taking a minute and pointing me to some direction.

    But otherwise RIA is not a smooth experience at all. If all the time saved by merging client and server code into a single piece is lost for deployment, I doubt the usefulness of WCF RIA services itself.

    Tuesday, December 29, 2009 11:32 PM

All replies

  • Have any one seen the errors as above? If so, pls give me some idea

     Crying

    Monday, December 28, 2009 12:09 AM
  • What do you get if you put a breakpoint in your invoke? Is the string result getting created correctly?

    Monday, December 28, 2009 10:42 AM
  • Thanks for the reply Colin. When I debug, I can see that the urls are generated as like these..

    http://localhost:52878/ClientBin/ZBSilverBusiness-Web-Services-ZBDataService.svc/binary

    http://localhost:52878/ClientBin/ZBSilverBusiness-Web-UserRegistrationService.svc/binary

     If I invoke them separately in IE browser, both the above Urls return HTTP 400 error. But if I invoke the urls without the binary tag, they return the webservice definitions correctly.

    Is there something else I am missing?

    Tuesday, December 29, 2009 1:09 AM
  • The problem is solved now. I seriously don't exactly know how. I did the following things.

    I Installed RIAServices on the server with server=true flag and then followed the steps from timheur blog. It was originally not working.

    But eventually I had to restart the server for a few other things and now my RIA App magically stopped giving me 404 errors.

    But I was still left with Authentication service not being able to connect to the database I mentioned. Finally I found that the RIA is still using the Connecting string named as "LocalSqlServer" and doesn't honour any connection string that I use. I do not know if this is by design and I have not read the documentation, but finally I could see that it is working.

    Thanks Colin for atleast taking a minute and pointing me to some direction.

    But otherwise RIA is not a smooth experience at all. If all the time saved by merging client and server code into a single piece is lost for deployment, I doubt the usefulness of WCF RIA services itself.

    Tuesday, December 29, 2009 11:32 PM
  • First, I will point out that RIA Services has nothing to do with configuring the authentication, it just piggybacks on top of the regular ASP.NET authentication system so the problems you had configuring the database connection string would still have been there even if you were not using RIA Services.

    Second, had you tried recycling the application pool or doing an IISReset? If rebooting the server fixed the problem then one  of the less invasive resets should also have worked.

    Wednesday, December 30, 2009 10:26 AM