This is a migrated thread and some comments may be shown as answers.

Calling WCF services failed after publishing

1 Answer 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sat
Top achievements
Rank 1
Sat asked on 19 Jan 2017, 09:43 AM

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.

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 19 Jan 2017, 10:02 AM
Hi Sat,

There seems to be a problem with the Reporting WCF service. Please check if it responds to requests in browser at <host>/ReportService.svc. Check the serviceModel element in the configuration and how endpoints for the service and its resources are defined.

You can use Fiddler to check the requests, their responses and statuses in Fiddler - Inspectors - Request|Response - Raw tabs.

Regards,
Stef
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Sat
Top achievements
Rank 1
Answers by
Stef
Telerik team
Share this question
or