Posted by anoriginalidea on May 31, 2008
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
Posted in Silverlight | Tagged: Silverlight, webservice | 1 Comment »
Posted by anoriginalidea on May 30, 2008
In a project I’m doing I need to create a web application that can consume Silverlight 2 RIA content from other web applications.
As it turns out, this is pretty easy to do. All you need to do is reference the xap in the other web application from your page and it works exactly the same as if you were using an xap from within your own web application.
A Problem with Debugging
One problem is that Visual Studio tries to run the two web applications on different ports, which makes it impossible to reference the other web app directly. You can’t use a relative url:
<form id="form1" runat="server" style="height:100%;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div style="height:100%;">
<asp:Silverlight ID="Xaml1" runat="server" Source="../Crm_Web/ClientBin/TechnologyOneCrm.xap" Version="2.0" Width="100%" Height="100%" />
</div>
</form>
Therefore you need to set the web application you wish to point to on a static port, like this:
You can then access the web application directly:
<form id="form1" runat="server" style="height:100%;">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
<div style="height:100%;">
<asp:Silverlight ID="Xaml1" runat="server" Source="http://localhost:2000/Crm_Web/ClientBin/TechnologyOneCrm.xap" Version="2.0" Width="100%" Height="100%" />
</div>
</form>
There’s probably many better solutions to this problem, but I thought I’d post my workaround.
Posted in Silverlight | Tagged: asp.net, Silverlight, web application | Leave a Comment »
Posted by anoriginalidea on May 26, 2008
So what’s the difference between WPF and Silverlight again? Oh yes, well WPF has more advanced features.
You know, 3D graphics!
Isn’t it strange that many Silverlight demos invariably incorporate 3D style effects?
Take a look at this article for a very rich solution:
Silverlight: Building Advanced 3D Animations with Silverlight 2.0
I wonder how long it will be before Silverlight supports 3D natively?
Posted in Uncategorized | 2 Comments »