Skip to main content

Microsoft Silverlight

Answered Question Silverlight 2 Beta 2RSS Feed

(0)

theathmtm
theathmtm

Member

Member

32 points

15 Posts

Silverlight 2 Beta 2

I had a Silverlight 2 Beta 1 control that was calling a WCF service. Now after upgrading to Beta 2, there is an error being thrown on the AsyncCallback. The crossdomain.xml and clientaccesspolicy.xml haven't been changed.

Here is the error:

System.Reflection.TargetInvocationException was unhandled by user code
  Message="An exception occurred during the operation, making the result invalid.  Check InnerException for exception details."
  StackTrace:
       at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
       at Silverlight.AnalysisViewer.AnalysisConfigurationService.AnalysisConfigurationLoadCompletedEventArgs.get_Result()
       at Silverlight.AnalysisViewer.Page.AnalysisConfigurationLoadCompleted(Object sender, AnalysisConfigurationLoadCompletedEventArgs e)
       at Silverlight.AnalysisViewer.AnalysisConfigurationService.AnalysisConfigurationServiceClient.OnAnalysisConfigurationLoadCompleted(Object state)
  InnerException: System.ServiceModel.ProtocolException
       Message="The remote server returned an unexpected response: (404) Not Found."
       StackTrace:
            at System.ServiceModel.AsyncResult.End[TAsyncResult](IAsyncResult result)
            at System.ServiceModel.Channels.ServiceChannel.SendAsyncResult.End(SendAsyncResult result)
            at System.ServiceModel.Channels.ServiceChannel.EndCall(String action, Object[] outs, IAsyncResult result)
            at System.ServiceModel.ClientBase`1.ChannelBase`1.EndInvoke(String methodName, Object[] args, IAsyncResult result)
            at Silverlight.AnalysisViewer.AnalysisConfigurationService.AnalysisConfigurationServiceClient.AnalysisConfigurationServiceClientChannel.EndAnalysisConfigurationLoad(IAsyncResult result)
            at Silverlight.AnalysisViewer.AnalysisConfigurationService.AnalysisConfigurationServiceClient.Silverlight.AnalysisViewer.AnalysisConfigurationService.IAnalysisConfigurationService.EndAnalysisConfigurationLoad(IAsyncResult result)
            at Silverlight.AnalysisViewer.AnalysisConfigurationService.AnalysisConfigurationServiceClient.OnEndAnalysisConfigurationLoad(IAsyncResult result)
            at System.ServiceModel.ClientBase`1.OnAsyncCallCompleted(IAsyncResult result)

 

samcov
samcov

Participant

Participant

969 points

379 Posts

Re: Silverlight 2 Beta 2

There are two things you will need to check.

  1. You MUST change your xml file to include the use of headers.  You can copy the one given in the breaking changes directly.
  2. If you are calling the service using WebRequest(not a service reference), you can't access FrameWork Elements in the callback.

Sam...

"The difference between genius and stupidity is that genius has its limits." - Albert Einstein

theathmtm
theathmtm

Member

Member

32 points

15 Posts

Re: Re: Silverlight 2 Beta 2

How do you allow the use of headers in the cross domain policy in Beta 2?

theathmtm
theathmtm

Member

Member

32 points

15 Posts

Re: Silverlight 2 Beta 2

I updated the CrossDomain.xml to:

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy> <allow-http-request-headers-from domain="* " headers="*" />

</cross-domain-policy>

 

And removed the clientaccesspolicy.xml and I'm still getting the same exception.

 

I'm using a standard WCF client:

private AnalysisConfigurationService.AnalysisConfigurationServiceClient _aisc;

public void LoadAnalysisConfiguration(long analysisConfigurationId)

{

_aisc =
new AnalysisConfigurationService.AnalysisConfigurationServiceClient();_aisc.AnalysisConfigurationLoadCompleted += new EventHandler<Silverlight.AnalysisViewer.AnalysisConfigurationService.AnalysisConfigurationLoadCompletedEventArgs>(AnalysisConfigurationLoadCompleted);

_aisc.AnalysisConfigurationLoadAsync(analysisConfigurationId);

}

theathmtm
theathmtm

Member

Member

32 points

15 Posts

Re: Re: Silverlight 2 Beta 2

Needed to update the ClientAccessPolicy and the CrossDomainPolicy

<?xml version="1.0" encoding="utf-8"?>

<access-policy>

<cross-domain-access>

<policy>

<allow-from http-request-headers="*">

<domain uri="*"/>

</allow-from>

<grant-to>

<resource path="/" include-subpaths="true"/>

</grant-to>

</policy>

</cross-domain-access>

</access-policy>

 

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy>

<allow-http-request-headers-from domain="* " headers="*" />

</cross-domain-policy>

theathmtm
theathmtm

Member

Member

32 points

15 Posts

Answered Question

Re: Re: Silverlight 2 Beta 2

Needed to update the ClientAccessPolicy and the CrossDomainPolicy

<?xml version="1.0" encoding="utf-8"?>

<access-policy>

<cross-domain-access>

<policy>

<allow-from http-request-headers="*">

<domain uri="*"/>

</allow-from>

<grant-to>

<resource path="/" include-subpaths="true"/>

</grant-to>

</policy> </cross-domain-access>

</access-policy>

 

<?xml version="1.0"?>

<!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">

<cross-domain-policy> <allow-http-request-headers-from domain="* " headers="*" />

</cross-domain-policy>

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities