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

OpenAccess Service works locally but not hosted

3 Answers 50 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tony
Top achievements
Rank 1
Tony asked on 23 Nov 2012, 03:48 PM
I have 3 projects, one with the entity model, another one with the OData v3 service generated from the entity model, the third one is an asp.net web application.

During local development the service reference I added into the web app is from same solution: http://localhost:55001/MyModelService.svc

After everything was successfully tested I then published the service project and hosted it on a third party hosting service. I was able to browse the service successfully by going: http://service.myapp.com/MyService.svc

I then re-added the existing service reference into my web app with the remote url shown above, published the web app on another hosting service.

When I load up the web app I got an error:
DataServiceQueryException was unhandled by user code
An error occurred while processing this request.

Is there any settings that I have missed or anything else I am doing wrong?

thanks in advance

3 Answers, 1 is accepted

Sort by
0
Viktor Zhivkov
Telerik team
answered on 23 Nov 2012, 04:34 PM
Hello Tony,

Can you provide more details about the exception that your client code experiences?
A lot of things can cause an exception.
You can include exception details in the response sent to the client by applying the following attribute to the data service class:
[ServiceBehavior(IncludeExceptionDetailInFaults = true)]

You also can check if you are in cross-domain scenario and missed to set up the policies properly.

All the best,
Viktor Zhivkov
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
0
Tony
Top achievements
Rank 1
answered on 23 Nov 2012, 05:27 PM
hi Viktor

thanks for your quick response. I had a look at the inner exception, it says:
[System.Data.Services.Client.DataServiceClientException] 
"<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?><error xmlns=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\"><code></code><message xml:lang=\"en-US\">An error occurred while processing this request.</message></error>"

I will look into the cross-domain scenario now

cheers
0
Tony
Top achievements
Rank 1
answered on 23 Nov 2012, 06:02 PM
hi Viktor

After I added the  clientaccesspolicy.xml the issue seems fixed when debugging.

I will test further and hopefully it is the real fix

thanks again
Tags
Data Access Free Edition
Asked by
Tony
Top achievements
Rank 1
Answers by
Viktor Zhivkov
Telerik team
Tony
Top achievements
Rank 1
Share this question
or