Skip to main content

Microsoft Silverlight

Answered Question Communication exception error for WCFRSS Feed

(0)

akoranteng
akoranteng

Member

Member

1 points

1 Posts

Communication exception error for WCF

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.Lutay
Sergey.L...

Contributor

Contributor

7200 points

1,341 Posts

Answered Question

Re: Communication exception error for WCF

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

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Blog

Twitter

Sincerely,
Sergey Lutay

davidezordan
davidezo...

Contributor

Contributor

5690 points

875 Posts

Silverlight MVP

Re: Communication exception error for WCF

Hi,

follow the steps described here: http://msdn.microsoft.com/en-us/library/dd470100(VS.95).aspx

HTH.

Thanks, Davide

Silverlight MVP

Blog Twitter Silverlight Experts

mothilal
mothilal

Member

Member

334 points

124 Posts

Re: Communication exception error for WCF

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
KishoreS

Member

Member

18 points

12 Posts

Re: Communication exception error for WCF

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

davidezordan
davidezo...

Contributor

Contributor

5690 points

875 Posts

Silverlight MVP

Re: Re: Communication exception error for WCF

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.

Thanks, Davide

Silverlight MVP

Blog Twitter Silverlight Experts

KishoreS
KishoreS

Member

Member

18 points

12 Posts

Re: Re: Re: Communication exception error for WCF

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.

Sergey.Lutay
Sergey.L...

Contributor

Contributor

7200 points

1,341 Posts

Re: Re: Re: Communication exception error for WCF

Do you change reference to service from http://localhost:3581/Service1.svc to IIS url?

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Blog

Twitter

Sincerely,
Sergey Lutay

KishoreS
KishoreS

Member

Member

18 points

12 Posts

Re: Re: Re: Re: Communication exception error for WCF

Hi,

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.

Sergey.Lutay
Sergey.L...

Contributor

Contributor

7200 points

1,341 Posts

Re: Re: Re: Re: Communication exception error for WCF

Look How to: Host a WCF Service in IIS article.

(If this has answered your question, please click on "mark as answer" on this post. Thank you!)

Blog

Twitter

Sincerely,
Sergey Lutay

KishoreS
KishoreS

Member

Member

18 points

12 Posts

Answered Question

Re: Re: Re: Re: Re: Communication exception error for WCF

I have added the two files (crossdomain and clientaccesspolicy) to the service project and it started working.

Thanks for your help.

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities