Hi, We have a silverlight application. We are using this technique to pass data to report parameters using a WCF service (the reports locate in another class library application):
public
void
SaveBtn()
{
var deviceInfo =
new
NameValueDictionary();
var parameters =
new
NameValueDictionary();
parameters.Add(
"name"
, name);
// other fields
var serviceClient =
new
ReportServiceClient(
new
Uri(App.Current.Host.Source,
"../ReportService.svc"
));
serviceClient.RenderAsync(
"IMAGE"
,
"ReportProject.Reporting.Letter.Preview, ReportProject.Reporting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
,
deviceInfo,
parameters);
serviceClient.RenderCompleted +=
new
EventHandler<RenderEventArgs>(serviceClient_RenderCompleted);
}
void
serviceClient_RenderCompleted(
object
sender, RenderEventArgs e)
{
var result = e.RenderingResult;
File.WriteAllBytes(
"f:/file.tiff"
, result.DocumentBytes);
}
This process works fine in local host. But when we publish silverlight web application in IIS when SaveBtn is called this exception will be thrown (the attached image):
[Async_ExceptionOccurred]
.....
As I mentioned this process works on local host.
PS: We followed this technique for using WCF Telerik Reporting Service.
We also added a file called clientaccesspolicy.xml to root of the report project (the class library I mentioned):
<
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
>
Any idea? Thanks in advance.