Pages

Thursday, July 02, 2009

Silverlight 2.0 – Silverlight Apps calling asmx web services

A while back I worked on a Silverlight application that was hosted in SharePoint. The Silverlight application was to call a web service written by a third party vendor in .NET 2.0.

ProblemAs what we all normally would do in a Silverlight app is to call this web service. However, I got the following error when my application tries to call the asmx web service:

“An error occurred while trying to make a request to URI 'http://localhost:1000/webservice.asmx'. 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. Please see the inner exception for more details.”

Solution

After some research, I found a recipe to get it going again:

Create a new file within the web service application (at the root of the requesting domain), called clientaccesspolicy.xml with the following contents:

Search This Blog

About me

Douglas is a Principal Cloud Consultant at DWS with a strong business and technical background specialising in SharePoint and Dynamics CRM. I am an MCP, MCTS (Microsoft Certified Technology Specialist) and MCBMSS (Microsoft Certified Business Management Solutions Specialist).

As the name suggests, this blog is mainly about CRM and SharePoint. I have had a strong
focus on the integration of the functionality in SharePoint and CRM. At other times, it may discuss about my discoveries of
various technologies.