views:

183

answers:

2
    private void btnUpdate_Click(object sender, RoutedEventArgs e) 
 { 
   xxxxxxx.Workflow1_WebServiceSoapClient zer = new xxxxx.Workflow1_WebServiceSoapClient(); 
        zer.demanderSubmitReportCompleted += new EventHandler<xxxxxxxxxxxxxxx.demanderSubmitReportCompletedEventArgs>(service2); 
        zer.demanderSubmitReportAsync("zzz", 20000); 

   }   

public void service2(object sender, xxxxx.demanderSubmitReportCompletedEventArgs e) 
{ 
        string a = e.Result; 
} 

I'm trying to call a windows workflow foundation published as a web service from a Silverlight project. When I call it from a console application it works fine because I can add a web reference then I just make an instance of that webservice then I invoke the method I want. The problem is in the silverlight project cause i can just add a service reference so I find myself working with soap stuff that doesn't work at all, and here is the code error:

here is the code:i change it a litle bit in english

Error in exécution Microsoft JScript: Unhandled Error in Silverlight Application  exception happened in the operation, résult not valide. Consult InnerException for more information.   in System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary()
   in AEDSilverlightIntegrated.ServiceReference2.demanderSubmitReportCompletedEventArgs.get_Result()
   in AEDSilverlightIntegrated.SilverEntryAedHeaderNew.mmm_demanderSubmitReportCompleted(Object sender, demanderSubmitReportCompletedEventArgs e)
   in AEDSilverlightIntegrated.ServiceReference2.Workflow1_WebServiceSoapClient.OndemanderSubmitReportCompleted(Object state)
A: 

1st things 1st make sure that the service exposes a corss domain policy file to allow silverlight to make teh cross domain call.

This is only required if the service is on a different domein to the silverlight host page.

mikehole
i added the cross domain file but it doesnt work: <?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="*"/> <allow-http-request-headers-from domain="*" headers="SOAPAction" /> </cross-domain-policy>
A: 

Hi,

well i find a solution and i want to share it with all of you, the solution is to build a web service work as a bridge between windows workflow foundation publishaed as a web service and a silverlight app.not so genious but this resolve the pb

thanks