WP7 Emulator and Fiddler - silverlight

I know there are a LOT of blog posts on this. But I can't seem to find an answer. I'm trying to debug an application that communicates with some services I have running locally. Right now, I have two services. One of them works. One of them does not. Both are running in http://localhost:90. To help me resolve this, I turned to Fiddler.
Oddly, Fiddler shows traffic in Internet Explorer in the emulator, but it does not show traffic from my application. With my application running, I launch Fiddler and nothing appears. I do not see any traffic. I have been able to confirm that I am successfully accessing the one service. However, no traffic appears in Fiddler. To see if Http traffic is running, I exited my Silverlight application and started Internet Explorer on the emulator. When I visit websites in IE on the emulator, I see traffic being written to Fiddler.
I'm totally confused. What am I doing wrong?

You need to actually configure Fiddler to be able to access localhost. Here is a workaround that needs to be done in the application.
Basically, what you need is the extra dot when accessing the location. So in your case it will be:
http://localhost.:90
Also, you might want to try some additional config settings.

Related

Google Analytics with Silverlight HTTPS cross domain policy problems

I'm sending simple messages to Google Analytics from a Silverlight app. They look something like this (data changed):
http://www.google-analytics.com/collect?v=1&tid=foobar&cid=foobar&t=pageview&dp=foobar&dt=foobar
Very simple API. If I use HTTP it works beautifully.
If I use HTTPS, I run afoul of Silverlight's cross domain policies. According to the docs, google-analytics.com needs to approve the cross-domain call by hosting either a clientaccesspolicy.xml (Silverlight-specific) or crossdomain.xml (original used by FLASH). Turns out they do host crossdomain.xml, and I can see that Silverlight downloads it (via Fiddler), but apparently Silverlight doesn't like the file's content and doesn't allow HTTPS calls to that domain (System.Security.SecurityException).
So.. at least at the moment, I can't use Google Analytics from Silverlight using HTTPS. Does anyone know a work around for this issue?
Note, I can't just use HTTP, because that causes IE to issue a "Allow Mixed Content" prompt which causes problems for some of our customers. I need to use HTTPS like the rest of our app.
EDIT: OK, I took a totally different approach, using HtmlPage.Window.Invoke to call a 3 line Javascript function to do the asynchronous send rather than using WebClient in the Silverlight code. Works like a champ. Anybody see any potential problems with that?
I suspect there may be a way to make this work, because I know google-analytics.com is very cross-domain friendly for exactly this reason.
If you absolutely can't get it to work another option would be to proxy the hits. If you do this, you'll want to make sure to use the ua and uip override fields in the hit you're sending so that they show up in Google Analytics with the IP address and User Agent of the original visitor and not your server.
Here's some more info on using a proxy server with the Measurement Protocol:
https://developers.google.com/analytics/devguides/collection/protocol/v1/devguide#using-a-proxy-server

Why does my WPF .NET4 app starts slow on PCs first time when I can only ping the internet

I have deployed a WPF .NET4 application on my customer's network.
The network can ping the internet, but the PCs are not able to browse.
It takes about 60 seconds to start the application.
TcpView shows that the app is trying to communicate with these URLs:
customer.teliacarrier.com
office365.com
msgr.dlservice.microsoft.com
akamaitechnologies
If we open the internet and starts the application once everything work fine and we can close the firewall again.
Does anyone know why the app communicates on the URLs the first time???
The customer has solved the problem.
The firewall was configures to allow ping to all external sites.
When they changed the rule to not allow ping everything worked fine.
I think that .NET 4 uses some signed files that the machine tries to authenticate.
If you used ClickOnce deployment or 3rd party components the app might be looking for updates.
All of the URLs (except for the office365.com) refer to download/mirror sites.
You could try to have a look at the requests that are being send to get more details.
If you have signed your files they may be trying to authenticate against a Certificate Authority. Also - make sure you ngen your wpf files before delivery - this speeds up the first launch of the file (Regardless of reaching out to websites). http://msdn.microsoft.com/en-us/library/6t9t5wcf(v=vs.80).aspx

ssl, silverlight, wcf and local install

I'm trying to get a silverlight program to install locally and still be able to access wcf data services over ssl. When I run the application in browser, everything works fine. When I run the application out of browser without ssl everything works fine. When I run the application OoB with ssl, I get a "Not Found" error. When I run fiddler and retry, everything works fine. I'm guessing that the program isn't correctly decrypting or sending the ssl traffic when OoB since when fiddler does it for it, the application works fine. I'm also not hitting any exceptions or break points on the server when I attach VS to it (this makes me think there is a problem with the send). Any ideas on what my next step should be? Also, I am using a self signed certificate, could this be an issue? THANKS!
Has anyone found a resolution for this issue? Or does silverlight just not work with SSL in OOB mode??
See this link for reference:
http://msdn.microsoft.com/en-us/library/dd920295(v=vs.95).aspx
basically it says:
Client certificates are supported by the browser stack, but not by the
client stack. And there is currently an issue that (at least for our
application) prevents client certificates from working even with the
browser stack if you're in trusted out-of-browser mode.

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/

Resources