Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Error finding URLBase in XML Node

coconut74
2011-06-09
2012-12-14
  • coconut74
    coconut74
    2011-06-09

    Hi!!!
    I've a llittle problem. When I use libupnp, it compile well, and when I run the exemple tv_device, I can see it on my network.
    But I still have this message :

    Initializing State Table
    [b]common/sample_util.c(221): Error finding URLBase in XML Node[/b]
    Found service: urn:schemas-upnp-org:service:tvcontrol:1
    serviceId: urn:upnp-org:serviceId:tvcontrol1
    [b]common/sample_util.c(221): Error finding URLBase in XML Node[/b]
    Found service: urn:schemas-upnp-org:service:tvpicture:1
    serviceId: urn:upnp-org:serviceId:tvpicture1
    State Table Initialized
    Advertisements Sent
    

    Do you know what's the problem?

     
  • What is the version of the libUPnP library you are using?

    I think that there is a chance that you are using an old version of the library, because IIRC, this problem has been fixed not a long time ago:

    http://pupnp.git.sourceforge.net/git/gitweb.cgi?p=pupnp/pupnp;a=commit;h=7ec5511a8d0cc78ae65ecc87744cdeee4b171b18

    @@ -242,7 +241,7 @@ char *SampleUtil_GetFirstElementItem(IXML_Element *element, const char *item)
                    return NULL;
            }
            tmpNode = ixmlNodeList_item(nodeList, 0);
    -       if (tmpNode) {
    +       if (!tmpNode) {
                    SampleUtil_Print("%s(%d): Error finding %s value in XML Node\n",
                            __FILE__, __LINE__, item);
                    ixmlNodeList_free(nodeList);
    

    Regards,
    Marcelo.

     
  • coconut74
    coconut74
    2011-06-10

    Hello,

    thanks for your reply.
    I use the version 1.6.13

    I have the good line in sample_utlis.c

    if (!tmpNode) {
    

    I use Linux 10.10

    Another question : is it possible to use it with Windows?

     
  • coconut74
    coconut74
    2011-06-10

    Sorry, I know what is the problem!!!
    To find my documents, I listen port 49152
    But I use a proxy which block a lot of port, so I think I can't use it.

    But if you have any advise concerning Windows ;-)

    Thank you

     
  • Hi,

    Yes, it is possible to use libUPnP with windows, some people have worked to make that happen. There are some MS Visual C project files on the repository tree. Also it should compile with mingw gcc.

    I personally do not use windows, so I am not the best person to tell you how to do it.

    Regards,
    Marcelo.

     
  • coconut74
    coconut74
    2011-06-10

    Thank you, I will see for Windows later

    I think that my previous problem is not resolved. It's not a problem of proxy I think because he found the "serviceId: urn:schemas-upnp-org:service:tvcontrol:1"

    So I don't know there is always this message :

    common/sample_util.c(221): Error finding URLBase in XML Node
    

    I see that if I go on the Web page to change parameters of the TV, there is nothing on the page…

     
  • zephyrus
    zephyrus
    2012-03-07

    This is not the problem of libupnp per se.

    It is the problem of XML description for TV device.

    I am using libupnp to build a UPnP Proxy for a dumb router.
    http://sourceforge.net/projects/upnpproxy/index.html

    If my XML description doesn't define URLBase, then I get the same error message.
    URLBase seems to be used as the "base" for the URL references in the
    subsequent XML description (i.e., to act as a short-hand for a prefix.)
    It may not be well documented in the UPnP document per se.
    I checked a router called NEC ATerm  WR6650S (maybe available in Japan only)  by retrieving its XML
    desription of UPnP functionality.
    It doesn't use URLBase.

    So the use of URLBase is not mandatory.
    (You can see the use of URLBase is just to check the prefix for the "location" for URLs
    From 1.6.15:  upnp/sample/sampe_util.c

    baseURL = SampleUtil_GetFirstDocumentItem(DescDoc, "URLBase");
    if (baseURL)
    base = baseURL;
    else
    base = location;

    So actually, not finding URLBase is not a fatal error.

    I have seen some confusion about how to interpret URLBase in some
    auxiliary tools myself.

     
  • zephyrus
    zephyrus
    2012-03-07

    My own follow-up.

    XML description of device functions is very delicate, and finicky.

    I just changed a few parts of a description that worked and saw misbehavior:
    - a mere addition of whitespace can confuse some clients,
    - a seemingly innocuous change can make a Java-based client
       fail to interact with the UPnP device. (It seems that parsing of
      the description of UPnP XML fails or something (due to a common Java
      library that handles XML?), and so suddenly all java-based test tool
      became unresponsive while skype and other windows binaries can talk to the UPnP router device.

    I wonder if there is a validator for XML UPnP description (but even then,
    there are clients which fail depending on the XML is indented or not (i.e., the presence of
    extra whitespace!).

     
  • Tieske
    Tieske
    2012-07-03

    As a general response, (I was just browsing through the forum);
    * URLBase element has been deprecated in UPnP architecture spec 1.1, see page 44 at http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
    * the opentools for UPnP development contain several utilities (Windows) , and iirc also a service/device validator. See http://opentools.homeip.net/dev-tools-for-upnp/
    * if you become member of the UPnP forum, there is also an official test tool