More in this section

Forums / General Discussions / Adding reference to Sitefinity Service

Adding reference to Sitefinity Service

4 posts, 0 answered
  1. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    28 Apr 2011
    Link to this post
    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 'http://localhost:60876/Sitefinity/Services/Content/DocumentService.svc'.

    There was an error downloading 'http://localhost:60876/Sitefinity/Services/Content/DocumentService.svc'.
    The request failed with HTTP status 412: Precondition Failed.
    Metadata contains a reference that cannot be resolved: 'http://localhost:60876/Sitefinity/Services/Content/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.
  2. Nikolay Datchev
    Nikolay Datchev avatar
    87 posts
    Registered:
    01 Nov 2016
    05 May 2011
    Link to this post
    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
  3. Ray
    Ray avatar
    16 posts
    Registered:
    31 Aug 2011
    15 Oct 2011
    Link to this post
    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?
  4. Nikolay Datchev
    Nikolay Datchev avatar
    87 posts
    Registered:
    01 Nov 2016
    19 Oct 2011
    Link to this post
    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
4 posts, 0 answered