Rolodex WCF Timeout check clientaccesspolicy.xml

Rolodex WCF Timeout check clientaccesspolicy.xml

Old forum URL: forums.lhotka.net/forums/t/5621.aspx


JonM posted on Friday, October 17, 2008

I'm playing with rolodex sample app on the CSLA Silverlight 3.6 RC using the RTM Silver2 tools.  Everything compiles just fine.  I'm using the default cassini web server.  When I login the async call timeout with a message that basically says there is a communication error and that I need to make sure I have clientaccesspolicy.xml file.  I have checked the policy file and .svc file and can access them through internet explorer.  I don't know why my silverlight app can't get to them.  The inner exception just says SecurityException: Security Error.  There are no other details.  Any ideas on this?  I verified that the serviceconfig file's URL and port number match the wcfwebhost projects address and port.  I'm stuck.

sergeyb replied on Saturday, October 18, 2008

I am guessing that SQL server connection string in web.config is not correct on your computer.  Please verify that you have SQL Express running and your connection string is pointing to correct folder.  If database is not a problem, here is the easiest way I found to debug wcf service.  Add the following to web.config to the web site that hosts wcf service

 

<system.diagnostics>
        <sources>
            <source name="System.ServiceModel"
                    switchValue="Information, ActivityTracing"
                    propagateActivity="true">
                <listeners>
                    <add name="traceListener"
                        type="System.Diagnostics.XmlWriterTraceListener"
                        initializeData= "c:\Traces.svclog" />
                </listeners>
            </source>
        </sources>
    </system.diagnostics>

 

Run the app again, then double-click on c:\traces.svclog.  It will open in default viewer, and you can just look for error messages – they will be highlighted in red in the list of messages on the left hand side.  This trick actually works on any wcf service, even hosted in windows service.

 

Sergey Barskiy

Principal Consultant

office: 678.405.0687 | mobile: 404.388.1899

cid:_2_0648EA840648E85C001BBCB886257279
Microsoft Worldwide Partner of the Year | Custom Development Solutions, Technical Innovation

 

From: JonM [mailto:cslanet@lhotka.net]
Sent: Friday, October 17, 2008 10:38 PM
To: Sergey Barskiy
Subject: [CSLA .NET] Rolodex WCF Timeout check clientaccesspolicy.xml

 

I'm playing with rolodex sample app on the CSLA Silverlight 3.6 RC using the RTM Silver2 tools.  Everything compiles just fine.  I'm using the default cassini web server.  When I login the async call timeout with a message that basically says there is a communication error and that I need to make sure I have clientaccesspolicy.xml file.  I have checked the policy file and .svc file and can access them through internet explorer.  I don't know why my silverlight app can't get to them.  The inner exception just says SecurityException: Security Error.  There are no other details.  Any ideas on this?  I verified that the serviceconfig file's URL and port number match the wcfwebhost projects address and port.  I'm stuck.

JonM replied on Saturday, October 18, 2008

Thanks for the help.  I put the code in and did not get anything in my log!  I was baffled at first.  I started down the fiddler debugging path.  Fiddler didn't show anything either!  I eventually figured it out.  Basically I'm using the default debug config that uses the built-in cassini web server.  Once instance hosts the WCFhost and the other instance hosts the silverlight application.  I noticed that when I hit F5 to start the app I got 2 internet explorer windows.  The first opened to the wcfhost port.  The second one opened the rolodex app with a login screen.  The problem is that the rolodex app was NOT pointing the URL off its cassini web server.  Instead it just had a local path in it 'C:\Projects\..blah..blah\Rolodex\LoginPage.htm'.   This was the problem!  When I manually type in the URL and login to that page everything works!  It turns out I had my start up projects set to WCFhostWeb, and Rolodex.  I should have started up the 'Web' project instead of the Rolodex project directly.  Starting the silverlight app directly just opens a IE page to its local path.   Wow what a pain to figure out!

Copyright (c) Marimer LLC