Skip to Content.
Sympa Menu

perfsonar-dev - Re: [pS-dev] failure of converting returning message (XML) to DOM

Subject: perfsonar development work

List archive

Re: [pS-dev] failure of converting returning message (XML) to DOM


Chronological Thread 
  • From: Loukik Kudarimoti <>
  • To: ulisses <>
  • Cc: Jason Zurawski <>, ,
  • Subject: Re: [pS-dev] failure of converting returning message (XML) to DOM
  • Date: Thu, 24 Aug 2006 16:20:16 +0100

ulisses wrote:
Hi again Loukik!

On 2006-08-23 12:44:47, Loukik Kudarimoti wrote:
Ulisses,

The example below probably fails most rules specified by NMWG :) I guess this is the reason why it won't create a DOM object

- What is the purpose of the metadata element? It has no contents!
- Why do you have a data element inside another data element?
- Why do you have link element containing link meta information inside the data element? This clearly belongs under the metadata element (as it it meta information)

yes, I found these problems and corrected already, the following minimal version of xml also causes the same problem:

<nmwg:message id="localhost.localdomain.66dffd41:10d3ab5e77b:-7ffe"
type="TOPSDownloadDBResponse"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";>
<nmwg:metadata id="TOPSDownloadDBResponseMetadata"/>
<nmwg:data id="TOPSDownloadDBResponse"
metadataIdRef="TOPSDownloadDBResponseMetadata">
<nmwg:data id="localhost.localdomain.66dffd41:10d3ab5e77b:-7fff">
<nmwgtopo3:link
id="localhost.localdomain.66dffd41:10d3ab5e77b:-8000"
xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/l3/3.0/";>
<nmwgtopo3:name>test</nmwgtopo3:name>
</nmwgtopo3:link>
</nmwg:data>
</nmwg:data>
</nmwg:message>

any hint?
Ulisses, I don't quite notice significant changes in the above xml in comparison to the ones you sent in the last email. I am not sure if one data element can be put inside another. I see this being done in the xml you mailed me as well. Has Jason confirmed this to you? Maybe its best to wait for Jason to come back.


A standard message is usually of this kind. But again, I am only guessing what you are trying to achieve so I might not be right here.

<nmwg:message id="msg1" type="TOPSDownloadDBResponse" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";

xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/l3/3.0/";>

<nmwg:metadata id="TOPSDownloadDBResponseMetadata">
<nmwg:subject id="sub1">
<nmwgtopo3:link id="link1">
<nmwgtopo3:name type="logical">test</nmwgtopo3:name>
</nmwgtopo3:link>
</nmwg:subject> </nmwg:metadata>

<nmwg:data id="TOPSDownloadDBResponse"
metadataIdRef="TOPSDownloadDBResponseMetadata">
</nmwg:data>

</nmwg:message>


To understand what you are trying to achieve, I have the following questions (as I haven't followed up your email thread).

* what are you trying to achieve?

umm.... I'm not sure if I understand what you mean

* Have you defined all possible message sequences for your service?

it is an stateless service for now, do you refer to this?
No. I meant to ask what are the possible types of requests and responses that your Topology service will be able to handle? Have you discussed these requests and responses with Jason and Martin?
* Are these message sequences agreed upon by NMWG (i.e Martin and Jason)

maybe you are refering to the xml format/schema used?

The following is a document with a more complete xml, including references
within the document,
even Jason told me I should use org.ggf.ns.nmwg.topology.l3.v3_0.Interface,
currently I'm using
org.ggf.ns.nmwg.topology.base.v3_0.Interface which seems to does the trick.
Have Jason and Martin seen this document and agreed to it?
<nmwg:message id="localhost.localdomain.-240dae5e:10d3f9071a8:-6195"
type="TOPSDownloadDBResponse"
xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";>
<nmwg:metadata id="TOPSDownloadDBResponseMetadata"/>
<nmwg:data id="TOPSDownloadDBResponse"
metadataIdRef="TOPSDownloadDBResponseMetadata">
<nmwg:data id="localhost.localdomain.-240dae5e:10d3f9071a8:-6197">
<nmwgtopo3:link
id="localhost.localdomain.-240dae5e:10d3f9071a8:-7fe5"
xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/l3/3.0/";>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-7fe6"
interfaceIdRef="20290">
<nmwgtopo3:ifDescription>LO0</nmwgtopo3:ifDescription>
<nmwgtopo3:type>other</nmwgtopo3:type>
<nmwgtopo3:capacity>0</nmwgtopo3:capacity>
<nmwgtopo3:netmask>62.40.102.46/32</nmwgtopo3:netmask>
<nmwgtopo3:ipAddress value="62.40.102.46"/>
</nmwgtopo3:interface>
<nmwgtopo3:name>ie1.ie.geant.net_62.40.102.46/32 -
_</nmwgtopo3:name>
</nmwgtopo3:link>
<nmwgtopo3:link
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6f1d"
xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/l3/3.0/";>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6f1f"
interfaceIdRef="59682">
<nmwgtopo3:type>other</nmwgtopo3:type>
<nmwgtopo3:capacity>0</nmwgtopo3:capacity>
<nmwgtopo3:netmask>130.59.36.124/30</nmwgtopo3:netmask>
</nmwgtopo3:interface>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6f1e"
interfaceIdRef="59584">
<nmwgtopo3:type>other</nmwgtopo3:type>
<nmwgtopo3:capacity>0</nmwgtopo3:capacity>
<nmwgtopo3:netmask>130.59.36.124/30</nmwgtopo3:netmask>
</nmwgtopo3:interface>
<nmwgtopo3:name>130.59.36.124/0</nmwgtopo3:name>
</nmwgtopo3:link>
</nmwg:data>
<nmwg:data id="localhost.localdomain.-240dae5e:10d3f9071a8:-6196">
<nmwgtopo3:node
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6242"
xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/base/3.0/";>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6243"
interfaceIdRef="59513"/>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6245"
interfaceIdRef="59253"/>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6246"
interfaceIdRef="59249"/>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6244"
interfaceIdRef="59385"/>
<nmwgtopo3:hostName>swiBAS1.switch.ch</nmwgtopo3:hostName>
<nmwgtopo3:name>swiBAS1.switch.ch</nmwgtopo3:name>
</nmwgtopo3:node>
<nmwgtopo3:node
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6318"
xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/base/3.0/";>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-631b"
interfaceIdRef="59646"/>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-631c"
interfaceIdRef="59517"/>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-6319"
interfaceIdRef="59686"/>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-631a"
interfaceIdRef="59671"/>
<nmwgtopo3:interface
id="localhost.localdomain.-240dae5e:10d3f9071a8:-631d"
interfaceIdRef="59167"/>
<nmwgtopo3:hostName>swiFF2.switch.ch</nmwgtopo3:hostName>
<nmwgtopo3:name>swiFF2.switch.ch</nmwgtopo3:name>
</nmwgtopo3:node>
</nmwg:data>
</nmwg:data>
</nmwg:message>

* If the above two points are done, are you sure your service is producing xml messages which are conforming to the agreements you might have had with NMWG?

I think I don't understand what you mean with message sequences, do you refer to xml schema?
I mean to ask whether the requests and responses that you have discussed and agreed to use are the same as the ones your service is generating.
Finally, if all above are ok, what is the error message being produced (look at catalina.out if you are testing it on a deployed service)

I think that I already asked you previously if it was possible force the XML to DOM parser to tell in which line it is the error?

The output is just:

<?xml version="1.0" encoding="UTF-8"?>
<nmwg:message xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";
id="resultCodeMessage">
<nmwg:metadata id="resultCodeMetadata">
<nmwg:eventType>error.common.parse_error</nmwg:eventType>
</nmwg:metadata>
<nmwg:data id="resultDescriptionData_for_resultCodeMetadata"
metadataIdRef="resultCodeMetadata">
<nmwg:datum value="Cannot convert Message to DOM" />
</nmwg:data>
</nmwg:message>

I don't see any XML/DOM errors in the tomcat logs
Ok, if no logs are being generated to explain the error, I would suggest to add an entry in bugzilla asking for this feature. Can you do this?

Loukik.
Thanks so much

Ulisses


Regards,
Loukik.

ulisses wrote:
Hi again

I managed to have a very minimum version of the XML document that fails to convert to DOM:

<nmwg:message id="localhost.localdomain.66dffd41:10d3ab5e77b:-7ffe"
type="TOPSDownloadDBResponse" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";>
<nmwg:metadata id="TOPSDownloadDBResponseMetadata"/>
<nmwg:data id="TOPSDownloadDBResponse" metadataIdRef="TOPSDownloadDBResponseMetadata">
<nmwg:data id="localhost.localdomain.66dffd41:10d3ab5e77b:-7fff">
<nmwgtopo3:link
id="localhost.localdomain.66dffd41:10d3ab5e77b:-8000" xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/l3/3.0/";>
<nmwgtopo3:name>test</nmwgtopo3:name>
</nmwgtopo3:link>
</nmwg:data>
</nmwg:data>
</nmwg:message>

any hint? thanks

Ulisses

On 2006-08-23 12:55:12, ulisses wrote:
On 2006-08-23 12:38:14, ulisses wrote:
Hi all again

before holidays I was trying to understand why I was failing to convert XML to DOM

now, I have noticed something I think it is not ok:

In the following sample XML document, there are two occurrencies of one medatada element with
the same ID (marked with [1]. I yet don't know why appears the second instance of that element.

this looks wrong, isn't it? or am I missing something?
well, I have found the problem of why there was being inserted two metadata elements with the
same ID, and I now generate a more nice looking xml, in any case I don't figure out why it cannot be converted to DOM:

<?xml version="1.0" encoding="UTF-8"?>
<nmwg:message xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/"; id="resultCodeMessage">
<nmwg:metadata id="resultCodeMetadata">
<nmwg:eventType>error.common.parse_error</nmwg:eventType>
</nmwg:metadata>
<nmwg:data id="resultDescriptionData_for_resultCodeMetadata" metadataIdRef="resultCodeMetadata">
<nmwg:datum value="Cannot convert Message to DOM" />
</nmwg:data>
</nmwg:message>

The XML file is

<nmwg:message id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7e75"
type="TOPSDownloadDBResponse" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";>
<nmwg:metadata id="TOPSDownloadDBResponseMetadata"/>
<nmwg:data id="TOPSDownloadDBResponse" metadataIdRef="TOPSDownloadDBResponseMetadata">
<nmwg:data id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7e76">
<nmwgtopo3:node
id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7f41" xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/base/3.0/";>
<nmwgtopo3:hostName>landas-gw.uninett.no</nmwgtopo3:hostName>
<nmwgtopo3:name>landas-gw.uninett.no</nmwgtopo3:name>
</nmwgtopo3:node>
<nmwgtopo3:node
id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7f71" xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/base/3.0/";>
<nmwgtopo3:hostName>svalbard-gw.uninett.no</nmwgtopo3:hostName>
<nmwgtopo3:name>svalbard-gw.uninett.no</nmwgtopo3:name>
</nmwgtopo3:node>
</nmwg:data>
<nmwg:data id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7f9a">
<nmwgtopo3:link
id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7fc3" xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/l3/3.0/";>
<nmwgtopo3:interface
id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7fc4"
interfaceIdRef="private_index: 0, snmp_ifindex: unknown">

<nmwgtopo3:ifDescription>NULLGE-0/2/0.30</nmwgtopo3:ifDescription>
<nmwgtopo3:type>other</nmwgtopo3:type>
<nmwgtopo3:capacity>0</nmwgtopo3:capacity>
<nmwgtopo3:netmask>62.40.100.144/28</nmwgtopo3:netmask>
<nmwgtopo3:ipAddress value="62.40.100.145"/>
</nmwgtopo3:interface>
<nmwgtopo3:name>hr1.hr.geant.net_62.40.100.144/28 - _</nmwgtopo3:name>
</nmwgtopo3:link>
<nmwgtopo3:link
id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7faf" xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/l3/3.0/";>
<nmwgtopo3:interface
id="localhost.localdomain.-5ae93b59:10d3a9f2382:-7fb0"
interfaceIdRef="private_index: 0, snmp_ifindex: unknown">
<nmwgtopo3:ifDescription>SO-1/2/0</nmwgtopo3:ifDescription>
<nmwgtopo3:type>other</nmwgtopo3:type>
<nmwgtopo3:capacity>0</nmwgtopo3:capacity>
<nmwgtopo3:netmask>62.40.103.100/30</nmwgtopo3:netmask>
<nmwgtopo3:ipAddress value="62.40.103.101"/>
</nmwgtopo3:interface>
<nmwgtopo3:name>nl1.nl.geant.net_62.40.103.100/30 - _</nmwgtopo3:name>
</nmwgtopo3:link>
</nmwg:data>
</nmwg:data>
</nmwg:message>


any hint on how hunt this problem will be greatly appreciated

regards

Ulisses

Thanks in advance

Ulisses

<nmwg:message id="msg2_resp" messageIdRef="msg2"
type="TOPSDownloadDBResponse" xmlns:nmwg="http://ggf.org/ns/nmwg/base/2.0/";> <nmwg:metadata id="TOPSDownloadDBResponseMetadata_0"/> // [1]
<nmwg:data id="TOPSDownloadDBResponse_0" metadataIdRef="TOPSDownloadDBResponseMetadata_0">
<nmwg:metadata id="TOPSDownloadDBResponseMetadata_0"/> // [1]
<nmwg:data id="localhost.localdomain.-7edd1411:10cb415db62:-7ffe">
<nmwgtopo3:link
id="localhost.localdomain.-7edd1411:10cb415db62:-7fff" xmlns:nmwgtopo3="http://ggf.org/ns/nmwg/topology/l3/3.0/";>
<nmwgtopo3:interface
id="localhost.localdomain.-7edd1411:10cb415db62:-8000" interfaceIdRef="private_index: 0, snmp_ifindex: unknown">

<nmwgtopo3:ifDescription>GE-0/0/0.20</nmwgtopo3:ifDescription>
<nmwgtopo3:type>other</nmwgtopo3:type>
<nmwgtopo3:capacity>0</nmwgtopo3:capacity>
<nmwgtopo3:netmask>62.40.98.40/29</nmwgtopo3:netmask>
<nmwgtopo3:ipAddress value="62.40.98.41"/>
</nmwgtopo3:interface>
<nmwgtopo3:name>be1.be.geant.net_62.40.98.40/29 - _</nmwgtopo3:name>
</nmwgtopo3:link>
</nmwg:data>
</nmwg:data>
</nmwg:message>




Archive powered by MHonArc 2.6.16.

Top of Page