Problem calling a Web Service from Silverlight 2

Standard

image

Apparently the “System.ServiceModel.ProtocolException” error is common in the fledgling world of Silverlight 2 and Web Services.

 

In my case I tried to reference a Web Service that my company created and was disappointed with this entertaining message:

 

System.ServiceModel.ProtocolException’ occurred in System.ServiceModel.dll but was not handled in user code Additional information: [UnexpectedHttpResponseCode]Arguments:Not Found
Debugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version=2.0.30226.2&File=System.ServiceModel.dll&Key=UnexpectedHttpResponseCode

 

What this meant in my case is that I needed a “crossdomain.xml” file placed in the root folder of the server I was accessing.

 

For a development server, this could mean something like this:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
  <allow-access-from domain="*" />
</cross-domain-policy>

 

This gives all applications (Silverlight, Flash) no matter where they’re from to access any web applicaitons on your web host.

 

As an ISV I find this a bit annoying, as it means updating a file that is outside of the Web Application (in the Web Root).

 

It would be nice to be able to configure this information within the virtual directory of the application itself.

 

 

Links

About these ads

One response »

  1. Pingback: Post: 132 - Mirrored Blogs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s