All service calls from silverlight failing - silverlight

I have a strange issue. All the webservice calls from silverlight application in my computer are failing. When I checked with fiddler, I can see that all the services are properly returning data. But the service calls in silverlight end up in the Communication Exception. The remote server returned an error: Not found.
I am using silverlight 4.0.
Any help would be appreciated.

are you calling remote or local services? If you are calling remote services, it could be there is no cross-domain policy in place on the remote server. try making a "normal" asp.net page or console app (etc.) that calls the service. If that is successfull, then this is probably the issue. you would have to make a sort of "proxy" webservice locally that calls the remote one--unless it is your own webservice and you can place a clientaccesspolicy.xml in there. here is a really good article on the subject.

The issue was really small. The disk space in C: drive of my machine was very low. Once some space got freed up, the issue got resolved. Thanks to all who helped.

Related

Windows Azure Cloud Service connection with sql database

I have been making requests to my cloud REST Service over the two past weeks. Everything was fine until yesterday.
Over the past days, I kept re-publishing my service to the cloud to test some of its operations with a client. I DID NOT change anything in my web.config, just some method bodies.
Yesterday, by making the simplest GET request to my service, through my browser or Advanced Rest Client, i started getting the following error:
The server encountered an error processing the request. Please see the service help page for constructing valid requests to the service. The exception message is 'The underlying provider failed on Open.'. and so on
I suspect after doing my research that this means I clearly have a connection error with my database which I don't get since it was working fine so far.
I also tried to Stop and Start my service in the Azure Production Enviroment but without any luck. Also the server firewall is configured as it should be.
Any answers would be much appreciated.
Thanks.
In my experience these generally tend to be azure service outages. There is currently 'Scheduled maintenance' occurring on all DB instances which may be affecting you.
http://www.windowsazure.com/en-us/support/service-dashboard/

System Security Exception in Silverlight app making GET request

I am new to silverlight. I have been trying to patch up a silverlight app that makes a get request to some site over the net, say google. However, I keep getting the system.security exception again nd again. I read various other posts and what i gathered is that for these things to work u need to choose HOST APPLICATION IN A NEW WEBSITE option while creation of the project, i have done that, but still get the same exception. I downloaded the app from http://www.shinedraw.com/data-handling/flash-vs-silverlight-simple-http-post-request/ and ran it by clicking debug in VS2010, still it gave the same exception.
Please tell me what i am doing wrong, i know its cross domain issues, but dont know what else to do.
The second answer at this post - WebClient.DownloadStringAsync throwing Security Exception in Silverlight, I think, offers a workaround, but does this means there is no way to access such services from silverlight directly?? -
Experienced users please explain.
You cannot call a web service other than from your own domain directly from a Silverlight application. If you want to to this, you would have to install a cross-domain policy on the server that hosts the service. But you can always install a web service within your own web application (that hosts the Sivlerlight app) and call the other service from that service. It's one sercie call more but it works also with services you don't own.

Silverlight client never calls WCF Service

This one has me completed stumped. I have developed a silverlight application that calls back to WCF services ( it's a silverlight - basicHttpBinding)
The site works perfectly fine from my development machine, but when it is deployed to the developement server. The application is delivered with the XAP just fine, but it never attempts to talk to the service. I have a service call in the bootstrapper so it should be calling this when the client starts up. The services are healthy. They can be browsed to and show the standard WCF service display. We have been through the bindings many times and everything seems to be ok. I have added an extensive amount of error handling for displaying any errors, but on this dev server, no service calls and no errors are being raised.
Fiddler shows the page being loaded up, but my client never issues a call to the service. The service is in the same folder as the default.aspx which hosts the Silverlight client.
This is a Silverlight 3.0 app.
Anybody ever seen anything similar?
I will try to debug in three steps
Verify whether the hosted service on dev server is up or not, by hitting the service URL from your browser on your dev machine.
Make sure that ServiceReferences.ClientConfig consists ur hosted service URL and not dev machine service URL.
If still error occurs try to debug your application from visual studio by pointing the endpoint address to http://urserver/urservicename.svc
Also make sure you dont have have cross domain problems by using "silverlight spy" tool
Put a graphical display like "I made the call!" before the service invocation. just to be sure that your app is really trying to call the service...
So we could narrow the search to a communication problem. : )
Verify that there aren't any cross-domain rules stopping the app to make the call.
by the way, are you calling a WCF service from another domain?
Are you sure the silverlight app is loading at all? If you are making the service call in the boot strapper and the call breaks, I assume that will lead to just a blank page. If you are seeing just a blank page, then perhaps there is something wrong with the .xap mime type issued from the server. Here is some more info on that:
http://learn.iis.net/page.aspx/262/configuring-iis-for-silverlight-applications/

Silverlight clientaccesspolicy.xml crossdomain.xml

I am one of 2 developers on a silverlight project that is hosted online. The problem is that i seem to randomly have problems with our webservices not working (This never happens to my colleague).
Using firebug, i had a look at any problems that it was reporting and i found this:
GET clientaccesspolicy.xml 404 not found
GET crossdomain.xml 404 not found
Any ideas why only i have a problem with like this?
We have both cleared out our cache and recycled the application pool of the webserver... no joy.
Thanks,
Kohan
So the webserver intermittently returns 404 errors on the policy file? What version IIS?
If your colleague never gets the error, compare the request headers between his system and yours to be sure there isn't something weird going on.
If the policy file is hosted by a provider and you're getting intermittent 404 errors you should put in a ticket with the provider.
This happens when the client attempts to connect to a domain on which it is not hosted. The policy files are used to grant access to that server from the SL client.
Are you both running the client from the same location? Double check your proxy settings and hosts file too.
Found out the problem came when accessing the site without typing "www."
I should have known to check that first. :(

Deploying a Silverlight Application with built-in ASMX WebService to IIS

I've got a Silverlight application which uses a built-in .ASMX WebService to access a SQL database and run some queries. Everything runs without any hitches on my Development machine.
I'm trying to deploy the application to IIS 6 and I'm having some issues.
The Silverlight application itself seems to run fine, however the Web Service does not. I get an unhandled exception error that says [Async_ExceptionOcurred] as soon as the page loads (when the page loads I'm making some Async WebService method calls).
I think this is an issue with the Web Service but I don't know what the problem is. I tried setting the WebService namespace to my URL, but that didn't work. I've tried messing with the SQL connection string in my Web Config but that also affects nothing.
One thing to note is that my IIS Virtual Directory only contains my SilverlightApp.Web folder. I know that the other folder that's part of the application contains a .ClientSettings file for the WebService, but I think this is embedded into the .xap.
Can anyone shed any light on this?
The most likely thing that's happening:
Your webservice proxy on the client is using the address of the web service it was built against: ("http://localhost...").
Things to do:
Use fiddler to confirm this is the issue. It will show you where the proxy is making the call to.
Use the overloaded constructor for the web service and specify a URI. Consider using id/deffing for debug/release. This will overwrite the settings in the client.config.
Create another endpoint in the client config for the release build (Shawn's article here) and select one or the other (again using if/defs).
There are other options as well (looking at the URI and building up the service adress)... but that's the general idea.
hth,
Erik

Resources