1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Consuming the sitefinty Formsservice.svc

Consuming the sitefinty Formsservice.svc

4 posts, 0 answered
  1. Sajitha
    Sajitha avatar
    3 posts
    Registered:
    19 Nov 2012
    27 Nov 2012
    Link to this post
    Hi 
    I am trying to retrieve the responses from a Sitefinbity form usinfg the webservice call. For now I am testing the call using an xmlhttp request as below.

    I am getting a response when I use t his as the url to the request

    url= http://www.kramesstaywell.com/sitefinity/Services/Forms/FormsService.svc/
    like this
    xmlhttp.open('GET',url,true);

    However when I try to retrieve the responses for a particular form using the url below  I am getting the following error

    url =http://www.kramesstaywell.com/sitefinity/Services/Forms/FormsService.svc/entries/MetroTest?

    Error: {"Detail":"Value cannot be null.\u000d\u000aParameter name: No
    persistent type with name:
    Telerik.Sitefinity.DynamicTypes.Model.MetroTest"}

    Will you be able to tell me whats wrong with the URL above?

    I am also attaching the test html I have been using
    Any help is greatly appreciated.
    Thanks in advance
    KSW




  2. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    30 Nov 2012
    Link to this post
    Hi Sajitha,

     You can take a look at some of these resources for consuming web services in Sitefinity.

    Restful Services in SF
    Working with web services in SF

    Also are you calling this from a widget, page code-behind, or another solution?

    Regards,
    Patrick Dunn
    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. Sajitha
    Sajitha avatar
    3 posts
    Registered:
    19 Nov 2012
    30 Nov 2012
    Link to this post
    Hi Patrick,
    Thanks for the response. My final goal is to access the sitefinity webservice from Salesforce. However I am now testing it using a simple javascript xmlhttp call.  I understand that we need to first authenticate the user before we can access any of the webservice, which eventually I will have to implement. But for now I am logging on to the backend on the browser and the accessing the webservice from the same browser, so that way the cookie is created in the browser. 
    The code below works and returns all the available forms.
    Howevere if I change the url variable to the one commented out(url for the responses for a form) below it gives the following error I mentioned in my previous post. It looked like I need to pass some parameters like providername.. etc? If so what value would i use as parameter. The help document that is available for the webservice does not give examples of the sample values that should be passed for the providename and other parameters :

     Error: {"Detail":"Value cannot be null.\u000d\u000aParameter name: No persistent type with name: Telerik.Sitefinity.DynamicTypes.Model.MetroTest"}

     <script language="javascript">
    var xmlhttp;
    function init() {
    // put more code here in case you are concerned about browsers that do not provide XMLHttpRequest object directly
    xmlhttp = new XMLHttpRequest();
    }
    function getdetails() {
    var url = "http://www.kramesstaywell.com/sitefinity/Services/Forms/FormsService.svc/";
    // var url =   http://www.kramesstaywell.com/sitefinity/Services/Forms/FormsService.svc/entries/MetroTest";
    xmlhttp.open('GET',url,true);
    xmlhttp.send(null);
    xmlhttp.onreadystatechange = function() {
    if (xmlhttp.readyState == 4) {
    if ( xmlhttp.status == 200) {
    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    }
    else
    document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
    }
    };
    }
    </script>
  4. Patrick Dunn
    Patrick Dunn avatar
    237 posts
    Registered:
    03 Nov 2014
    04 Dec 2012
    Link to this post
    Hi Sajitha,

     In IE visit the help page for your service. In this case it will be

    http://YourDomain.com/Sitefinity/Services/Forms/FormsService.svc/help

    It will give you examples of how to make a variety of different calls to the service. For example:

    Getting a Form Entry
    http://localhost:15014/Blow_me_up/sitefinity/Services/Forms/FormsService.svc//entry/{formName}/{entryId}/?providerName={providerName}&itemType={itemType}&managerType={managerType}

    I hope this helps and keep in mind only IE will render the help pages correctly. FF/Chrome just display a jumble of URLs that are near impossible to read.

    Greetings,
    Patrick Dunn
    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