Search code examples
xmlxml-namespacesip-cameraonvif

Does the recieving end of an XML with an external namespace fetch the namespace?


like the title says, I am wondering if for example I send an endpoint some XML with the namespace being: 'http://www.external.com/customNS', would the receiving end fetch that namespace? I think logically the answer is yes (unless there are rules that prevent fetching from external sources) but I need to verify this.

Question 2: just in case the answer is yes for the first question, reason I am asking is I have a task dealing with Onvif at work, which uses XML to send commands to IP cameras, and when the onvif XML namespace servers went down (Dec/28), some requests started failing, but I need to make sure this was the cause instead of faulty requests, so do you think cameras actually have the namespaces pre-loaded, and do absolutely no external fetching, or do they just fetch them on at least the first time a request with the specific namespace is received? I tried creating a server, and sending it to the camera as a namespace, but I didn't receive any requests, but this might just mean that the camera rejects requests with servers that aren't onvif's.

Example request I send to the camera (without header and footer):

<GetServiceCapabilities xmlns="http://www.onvif.org/ver20/ptz/wsdl" />

Solution

  • would the receiving end fetch that namespace?

    No.

    Namespaces are strings. Their purpose in life is to be unique within the document, that's all.

    That it's possible to use URLs as namespaces, and then set up a web server that gives more information at that URL is a bonus. There is no requirement for that, there is no technical definition of what kind of data has to be at such a URL, and the XML parser does not need it to do its job.

    There might be other things (XML schemas, external DTDs, maybe XLink/XInclude) that could trigger requests during parsing or handling of the document, but namespace URIs definitely won't.