Silverlight calling HttpHandler

I have a Silverlight 2 application that I am trying to call on an HttpHandler using a WebClient. I have an HttpHandler just sending an email that says that when you call test. If I hit it through the browser, I get an email. However, using a WebClient object with a delegate, I cannot get it to connect.

I started thinking about using cross domain policy to connect. However, the HttpHandler is in an SSL web app. When the control is deployed, it will reside in the same SSL web application (using the asp.net silverlight control).

Will this work? If not, what can I do to make it work?

+2


a source to share


1 answer


If you are trying to determine if this is a problem for your web service, try pushing just a regular .txt or whatever file that will be shared with your .Xap to see if your web client code is the problem.

You are most likely doing something that won't work, such as:



  • Pressing F5 in a Silverlight project that is not in a web project ... so the URL in the address bar starts with file:///

    instead http://

    . You cannot request a cross-diagram.
  • Finding another domain. Subdomains that are different are also cross-domain. To do this, you need a cross domain permission file.

I would not recommend validating with Windows Forms as it can request any web page without these security restrictions at all.

+2


a source







All Articles