Forum » Web Services

Microsoft Silverlight 2.0 and the Last.FM webservices

 
  • Microsoft Silverlight 2.0 and the Last.FM webservices

    Hi All,

    After the release of Silverlight 2.0 last week i tried to make a nice Silverlight banner that reads the Last.FM webservices. A great new feature (WebClient Class) is introduced in Silverlight that enable you to read data from the internet. Too bad MS included a new security method on webservice calls:
    The WebClient class does not currently support cross-domain calls. The current release of WebClient requires that the Silverlight-based application be hosted on the same server as the target Web service. Alternatively, if the Web service and Silverlight-based application are hosted in separate domains, the Web service hosting the service must have an XML policy file that indicates that clients can make these cross-domain calls.
    from this page: Sending and Receiving Plain XML Messages with Silverlight
    a sample app on Scott Guthrie's sample.

    According to MS the webservice provider has to explicitly opt-in to allow cross-domain access. By opting-in, a service states that the operations it exposes can safely be invoked by a Silverlight control, without potentially damaging consequences to the data the service stores.

    The solution is to add a XML to http://ws.audioscrobbler.com:

    Silverlight supports two different mechanisms for services to opt-in to cross-domain access:

    Place a clientaccesspolicy.xml file at the root of the domain where the service is hosted to configure the service to allow cross-domain-access.

    Place a valid crossdomain.xml file at the root of the domain where the service is hosted. The file must mark the entire domain public. Silverlight supports a subset of the crossdomain.xml schema.


    For more info see the microsoft page How to: Make a Service Available Across Domain Boundaries and a post about this issue on My blog


    Is it possible for Last.FM to create one of these XML files on the audioscrobbler website ?

    Sincerly,
    Kasper

    • Noin said...
    • User
    • 22 Mar 2008, 12:18
    I got hit by the same problem just yesterday as well.
    Would be nice to have a crossdomain.xml file in the domain root.

    More info:
    http://www.crossdomainxml.org/

    • sanakan said...
    • User
    • 22 Apr 2008, 04:28
    how about bugging Microsoft to fix this (i.e. to properly allow to access web services), instead of thousands of WS-providers?

Anonymous users may not post messages. Please log in or create an account to post in the forums.