This project is read-only.

Problem using RIA/JS

Topics: jQuery
Nov 16, 2011 at 1:02 PM

I have a problem using the RIA/JS library. I built an example like in the scenarios (simpleget), but when i call


I get the following error:

SCRIPT5007: Unable to get value of the property 'length': object is null or undefined
jquery-1.6.1.js, line 613 character 4

My whole js-code to fetch the data is the following (the JSON Request works (returns the correct JSON response))

$(function () {
    var persons = [];
    // Bind arrayChange event to render ui.
        function () {
            $("#persons").empty().append($.render($.template("#person"), persons)); 
    // Bind array with data source and refresh.
        serviceUrl: "RIAApplication-Web-Services-PersonDomainService.svc",
        queryName: "GetPersons"
Dec 6, 2011 at 12:06 AM

Is metadata being returned from the server?

Check that you have the "transmitMetadata" attribute set in the web.config ...

        <add name="soap" type="Microsoft.ServiceModel.DomainServices.Hosting.SoapXmlEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        <add name="JSON" transmitMetadata="true" type="Microsoft.ServiceModel.DomainServices.Hosting.JsonEndpointFactory, Microsoft.ServiceModel.DomainServices.Hosting, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

Dec 6, 2011 at 7:11 AM

Hi!  metadata were already set to true. Any other ideas?

Dec 6, 2011 at 12:16 PM

Problem solved! Solution found in this thread:

I've used a wrong version of Microsoft.ServiceModel.DomainServices.Hosting.dll!