Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Matthew 6 posts 26 karma points
    Sep 02, 2010 @ 22:58
    Matthew
    0

    Blank Node from Node Factory

    I am creating a webservice that will allow us to retriueve umbraco content on web portals located on other servers.

    I am having trouble getting the Node Factory to work. The webservice is coded inside the umbraco install. I import the NodeFactory namespaces and perform a call like this:

    Node n = new Node(nodeId); // where nodeId is a published node

    The node always returns with blank class properties. And the Properties array has one entry:

    n.Properties[0].Alias; // "error"
    n.Properties[0].Value; // "No published item exist with id #" where # is nodeId

    Alternatively, I can use the Document class which works. But I do not want to sacrifice performance with the added db calls it invokes.

    Thanks!

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Sep 02, 2010 @ 23:05
    Tom Fulton
    0

    Maybe try..

    n.getProperty("propertyAlias").Value
  • Matthew 6 posts 26 karma points
    Sep 03, 2010 @ 06:05
    Matthew
    0

    The only property I can retrieve with the getProperty call is "error".

    n.getProperty("error").Value; // "No published item exist with id #" where # is nodeId
    n.getProperty("content").Value // Null exception because getProperty returns null

    Also, I have made sure that node data is up to date and available in umbraco.config, which it is.

  • snake001 4 posts 25 karma points
    Oct 16, 2010 @ 17:46
    snake001
    0

    Hi Matthew,

    were you able to resolve your issue?

    I have the same problem now,

    given

    Node nd = new Node(1084);
    var a = nd.Id; // it gives 0, as well as all other properties for that matter

    Thanks,

    Matt

  • Matthew 6 posts 26 karma points
    Oct 18, 2010 @ 16:11
    Matthew
    0

    Hi Matt,

    Yes, I was able to resolve the issue. I apologize for not updating this thread.

    Ultimately, the issue was related to load balancing not being setup entirely correct. And load balancing is going to differ widely among who sets it up and what the specific needs are.

    My suggestion, if you aren't already, is to try the node factory code first in a non-load balanced environment.

     

Please Sign in or register to post replies

Write your reply to:

Draft