Skip to main content
Home Forums Silverlight Programming Accessing Web Services with Silverlight Communication exception error for WCF
10 replies. Latest Post by KishoreS on November 5, 2009.
(0)
akoranteng
Member
1 points
1 Posts
11-03-2009 2:10 PM |
I am using WCF to load a gridview in a silverlight application. I am getting a System.ServiceModel.CommuniucationExceptionerror when making the HTTP request. will appreciate any suggestions.
Thanks
Sergey.L...
Contributor
7200 points
1,341 Posts
11-03-2009 2:33 PM |
Hi,
Does there are cross-domain request to service? Look http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx for more details.
Also you can see a Fiddler tool to look at primary information about excaption. Look http://www.bluerosegames.com/SilverlightBrassTacks/post/Fiddler-is-your-friend-for-Silverlight-communications-debugging.aspx
davidezo...
5690 points
875 Posts
11-03-2009 3:25 PM |
follow the steps described here: http://msdn.microsoft.com/en-us/library/dd470100(VS.95).aspx
HTH.
mothilal
334 points
124 Posts
11-04-2009 7:00 AM |
Use fiddler to check where the error. Download Fiddler, install it and open it. Then run ur application. Now check the line marked with red in ur fiddler. Click that line and checks where the error comes from..
If this post answers ur question, then don't forget to mark the post as answered..
KishoreS
18 points
12 Posts
11-04-2009 12:00 PM |
I am also getting the following error when i try to consume the WCF service in Silverlight application using VS 2010.
"An error occurred while trying to make a request to URI 'http://localhost:3581/Service1.svc'. This could be due to attempting to access a service in a cross-domain way without a proper cross-domain policy in place, or a policy that is unsuitable for SOAP services. You may need to contact the owner of the service to publish a cross-domain policy file and to ensure it allows SOAP-related HTTP headers to be sent. This error may also be caused by using internal types in the web service proxy without using the InternalsVisibleToAttribute attribute. Please see the inner exception for more details."
I have copied the clientaccesspolicy.xml and crossdomain under $:\Inetpub\wwwroot folder but no luck. I am able to consume the same service using a windows appl as a client to make sure my service working properly.
Please could anyone help me to resolve this issue.
Thanks in advance,
Kishore
11-04-2009 3:39 PM |
Seems like your SL application is looking for the service in the address 'http://localhost:3581/Service1.svc', if you have deployed it on IIS you should update the Service Reference.
11-04-2009 11:43 PM |
Hi David,
I have updated the service reference and still getting the same error. Any other suggestions?
I am able to browse "http://localhost:3581/Service1.svc. On click of a button, i am calling a web method using the proxy that is where i am getting the error.
11-05-2009 2:46 AM |
Do you change reference to service from http://localhost:3581/Service1.svc to IIS url?
11-05-2009 2:58 AM |
How do i host the service in IIS?. i have followed the traditional wayto host in IIS but, didn't work. Currently, self hosting the service.
Could you please send me the detail steps (hosting in IIS) to resolve this? I am new to WCF services. I am currently working with VS 2010 and the client is a silverlight application. I have selected the check box "Host the silverlight application in a new or existing web site in the solution" when i created the silverlight 3 application to consume the WCF services.
Currently, i have copied both the xml files to C:\Inetpub\wwwroot folder. Is that correct?
Please let me know if you need more details.
11-05-2009 3:17 AM |
Look How to: Host a WCF Service in IIS article.
11-05-2009 6:02 AM |
I have added the two files (crossdomain and clientaccesspolicy) to the service project and it started working.
Thanks for your help.