Adding reference to Sitefinity Service

Posted by Community Admin on 03-Aug-2018 15:10

Adding reference to Sitefinity Service

All Replies

Posted by Community Admin on 28-Apr-2011 00:00

Ok I was trying to add a service reference to a Sitefinity Service and got this error. Most of the services that I tried to added get this error (or similar). The only ones I was able to add successfully were AnalyticsPermissionsService, DashboardData, AccountsService, and MapDataService which I don't have a need for right now. How do I use the other services like 'DocumentService'?

An error (Details) occurred while attempting to find services at 'localhost:60876/.../DocumentService.svc'.

There was an error downloading 'localhost:60876/.../DocumentService.svc'.
The request failed with HTTP status 412: Precondition Failed.
Metadata contains a reference that cannot be resolved: 'localhost:60876/.../DocumentService.svc'.
The remote server returned an unexpected response: (405) Method Not Allowed.
The remote server returned an error: (405) Method Not Allowed.
If the service is defined in the current solution, try building the solution and adding the service reference again.

Posted by Community Admin on 05-May-2011 00:00

Hello Kristian,

We are investigating the problem and will come back to you soon. The main difference between the services that you can get a proxy reference and the others that you receive an error is that the first ones are exposed as SOAP services through the standard HTTP binding. The other services are actually REST services with WebHttpBinding, you can call them even with simple WebRequests if you follow the REST protocol  but you have to parse the returned json data manually, also you need to pass authentication cookie in order to get any data from Sitefinity. When we have a working sample or solution with using a reference or by using the service contract , i will post it here.

Regards,
Nikolay Datchev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 15-Oct-2011 00:00

I saw that the response to this post was in May of this year.  I am attempting to connect to the services and I am getting the same error message: The remote server returned an error: (412) Precondition Failed.

It being October, is there any solutions for this?

Posted by Community Admin on 19-Oct-2011 00:00

Hi Ray,
The actual problem is that we have HTTP restfull services and you cannot connect to them automatcally and have proxies build as with SOAP services. Basically as far as i know there is no support in Visual Studioo for automatic making of service references for restfull services. You have to call them with web requests build manually and prepare the parameters manually.
You can get help on the service protocol by calling for example:
~/Sitefinity/Services/Content/NewsItemService.svc/help
We will also not have an example where we use consume the services directly with the WCF service contracts, since there are currently unresolved issues with how this approach will consume Multilingial values and custom fields - which do not participate in the contract.
I will check if we have some code example with using manual building of json somewhere and post additionally to the thread.

Kind regards,
Nikolay Datchev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed