Silverlight 4.0 + MVC 2.0 + WCF RIA Services + EF 4.0 = Load Error - asp.net-mvc-2

I'm trying to buid a site with the following:
VS 2010 (for the updated WCF RIA Services)
Silverlight 4.0 (packaged with WCF RIA Services).
MVC 2
EF 4.0
I am setting it up so that the public facing pages will be html from MVC, but the administration portion will be a silverlight navigation application using using WCF RIA Services for data access.
When I create the silverlight application within a webforms application, it works (I am able to add a datagrid and retrieve data using EF 4.0 and WCF RIA Services successfully):
alt text http://www.patleague.com/images/sl4_webforms.png
When I create the silverlight application within an MVC2 application:
alt text http://www.patleague.com/images/sl4_mvc2.png
I get an error as follows (I've added the same datagrid in both cases - a simple table with 2 records):
alt text http://www.patleague.com/images/sl4_mvc_dataerr.png
The webforms server-side works while the MVC server side doesn't. I've unsuccessfully tried WCF logging as well as fiddler, but I somehow can't get any output (using the example here: http://msdn.microsoft.com/en-us/library/ms730064.aspx), and I've also tried fiddler to get some information with no luck. I'm really struggling with this and I wonder if anyone else has run into this issue and found a way around it?
Thanks, Dennis

Ignoring the routes for the services corrected this problem when added to Global.asax.cs:
routes.IgnoreRoute("{*allsvc}", new { allsvc = #".*\.svc(/.*)?" });
Credit for this answer has to go to OneSmartGuy: his answer fixed my issue also.

This issue might be specific to my site, but perhaps other people are having the same issue, and I had been so darn frustrated by this that I had given up for a while and tried other methods to get done what I wanted, but came back to Silverlight because I have a hard time with Javascript and JS UI libraries. I had better luck with fiddler when working on the deployed site (I didn't get any output when working with the development server).
When I browsed to my site with the silverlight app, the dialog popped up with the usual "load operation failed for query...", and fiddler showed the following when highlighting the error:
IIS specified authentication schemes 'Basic, Anonymous', but the binding only supports specification of exactly one authentication scheme. Valid authentication schemes are Digest, Negotiate, NTLM, Basic, or Anonymous. Change the IIS settings so that only a single authentication scheme is used.
I looked up this error in the DiscountASP.net (my hosting provider) and found a KB article that instructed me to update the web.config (for IIS7) as follows:
<system.webServer>
<security>
<authentication>
<basicAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
And viola! I could use WCF RIA Services with Silverlight in asp.net MVC2! I found also that it was unnecessary for me to create a special service and a domainhostfactory as described in several blog posts while researching this stuff, or change the routing to avoid interactions with MVC and the service request. This is all I had to do
I guess this is a pretty basic fix, and hopefully it'll help someone else. I was extremely frustrated with this, and dissapointed that such a simple fix is publicly available, yet no step-by-step instructions for this scenario is given from Microsoft as this is using the most up-to-date microsoft technologies.
Thanks, Dennis

Related

Consuming NetSuite SOAP Webservice in .Net Core

I am having a bit of an issue with integrating with NetSuite API on .Net Core using VS2017 and it has no option to add Web Service. When I consumed their web service using add connected services some objects and classes are missing.
In .Net 4.5, the classes and object are available. My manager wants me to write the API in .Net Core.
I took the sample code from NetSuite and the very first thing is class NetSuiteService which has important Passport property for login.
Anyone had a solution to this?
It's fairly easy to integrate SuiteTalk with Dot NetCore, all you need to do is import the WSDL into .NetCore project via adding it as ConnectedService reference and it will set you up with WCF.
The DEMO code that NetSuite people have provided will not match the code generated on your machine. I would recommend you using TBA instead of other authentications.
(just copy paste the code provided by NetSuite's folks for authentication as that is the convention, you can change the crypt algorithm if you want to, just generate the Keys, put them in your configs and you're good to go)
Class "NetSuitePortTypeClient" will contain your endpoints for all types of communication to NetSuite web services.
Read the first 50-100 pages of the documentation manual that NetSuite provides for learning the conventions to be used throughout your journey.
Hope this will give you a headstart.

Is ASP.NET MVC a Good Fit for an Event Ticketing Site?

Good Afternoon,
I'm rebuilding an event ticketing site originally developed using ASP.NET 3.5 WebForms and am considering using ASP.NET MVC2 for the rebuilt solution. I like the idea of friendly URLs as the current site has very long query string URLs for each specified event. MVC2 also appeals from a separation of concerns point of view as well. The biggest unknown for me is will MVC2 handle calls to 3 separate web services (SOAP and REST) to get ticket availability? That is, does the controller functionality permit use of such web services? Finally, MVC3 is due to RTM in January. Am I better off waiting for MVC3, or can I start the project in MVC2 and port it later?
Thanks for all your advice and insight.
MVC can handle any HTTP request as ASP.NET forms does. Indeed you should consider to use WCF for handling SOAP queries. And yes, sure you can easely create REST API with MVC.
It is better to start now, with ASP.NET MVC 3 RC2. It is very stable and nice. This will minimize migration work. Welcome to MVC happy world!
The controller will let you run pretty much any code you want.
I just started using MVC in a big project and it's turning out well. We went with MVC 3 and it's been a little tricky living on the edge, but it seems to have a lot of nice improvements. I'm extremely happy to be using MVC instead of Web Forms. To me, it seems to flow smoothly instead of fighting with the way the web works.

Session not sticking for ASP.NET MVC2 in IIS7.5 in IE8

We have an ASP.NET MVC2 web application. For reasons outside the scope of this issue we decided to use the classic session state in the application. Following features are implemented in it related to session.
Session_Start event handler in global.asax stores a variable in session. This is in relation to a workaround to detect session expiration.
Session being used has the following values in web.config:
sessionState timeout="30" mode="InProc" cookieless="UseCookies"
Forms authentication is being used has the following values set in web.config:
forms loginUrl="~/Account.aspx/LogOn" timeout="1440" protection="All" slidingExpiration="false"
The web application was working in IIS6 without issues, until we deployed it onto IIS7.5. On IIS7.5 Everything apart from Session seems to be working. It seems the session either regenerates or loses values; in short it doesn’t stick, only happens in IE8; still works in Chrome and firefox.
Search on Google leads to a possible answers that; the global.asax doesn’t get fired in IIS7.5. Some guys got it working as a web application in IIS7.5; but we are running it as a site. Converting it to a web application doesn’t seem to solve the problem for us as we tried that too.
The configuration for our new server is Windows 2008 R2, IIS7.5, asp.net framework 2,3.5 and 4 are installed on the machine.
An interesting aspect of this is that the session seems to be working on google chrome and firefox browsers; which leads us to think that this may have something to do with the cookie generation on the client.
If someone has faced this issue and has a resolution we are all ears.
Thanks in advance for the help.

WCF RIA over Net.TCP binding?

I am trying to improve the performance of a Silverlight 4 WCF RIA application. As it's for intranet use only, I figured switching from the default binary HTTP binding to the Net.TCP binding might improve performance a bit.
However, I am having a hard time just getting a simple proof of concept application running. I have:
switched the proof of conecpt app from Cassini to IIS (7)
added the appropriate bindings and enabled protocols on IIS
added a clientaccesspolicy.xml file to my IIS root
Now, when I create a context like so:
var context = new DomainService1(
new Uri(
"net.tcp://localhost:4502/BusinessApplication/BusinessApplication2.Web/ClientBin/BusinessApplication2-Web-DomainService1.svc"));
... I get the following error:
The provided URI scheme 'net.tcp' is invalid; expected 'http'. Parameter name: via
Now I'm stumped. As far as I can tell, the problem is that the client being created by the auto-generated WCF RIA code needs to be told that it's to use a Net.TCP endpoint, but I'm unsure how to do that.
I've found plenty of blog posts explaining how to get WCF services going over Net.TCP, but I haven't found a single one talking about WCF RIA, and I can't find any offical documentation either. All of those explanations involve changes to the web.config file that seem unsuited to a WCF RIA app.
Could some one please either explain to me how to get this configured, or point me at some documentation?
WCF RIA Services depends on HttpContext which is not available with Net.TCP binding.
As for perf issues, could you elaborate a bit further? What is the bottleneck query/operation? What is the size of data (entity size x entity count)? What is the delta between your perf requirements and current perf?
Perhaps there are other ways that don't involve Net.TCP?
Thanks.
Dinesh
(WCF RIA Services Program Manager)

Deployment Error: Silverlight 4.0 w/WCF RIA Services in ASP.NET MVC 2 App

I've got an MVC 2 App with an RIA Services link to a Silverlight Application. The public facing portion of my site will be strictly MVC/HTML, but the administive portion will be silverlight (hosted in an MVC view page with data coming from RIA Services). On my development machine, all is well, but when I deploy to Discount ASP servers, neither the MVC controller/view nor the WCF RIA services called from silverlight function:
A silverlight datagrid gets a load error:
System.ServiceModel.DomainServices.Client.DomainOperationException: Load operation failed for query... The remote server returned an error NotFound.
In the MVC page where I had a simple table that worked prior to adding an EF model and DomainDataSource, I now get the error:
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
This is very similar to an issue I had before (with the beta versions of RIA Services & SL4 & MVC 2), but after upgrading from the beta to the release, the fix I had made before with respect to routing doesn't seem to work any longer. The link for that issue is: SL4/MVC2/WCF RIA Services = Load Error
I'm really struggling with deploying, and could use some help if anybody can shed any light on this.
Thanks! Dennis
Mvc 2 with Ria to Silverlight? Im having the same 404 problem.
One upon a time I fixed the problem by telling my rout's to ignore the svc's.
routes.IgnoreRoute("{*allsvc}", new { allsvc = #".*\.svc(/.*)?" });
Post beta, this ignore route trick no longer works for me.
You have to deploy System.ServiceModel.DomainServices.EntityFramework to your webserver.
cyberwaelder