[Fiware-friendly-testing] IoT Broker GE xml validation problems (OneSource)

Pedro MIguel Faria Borges pedroborges at onesource.pt
Thu Nov 27 17:01:26 CET 2014


Hello, 

I’m sending this to the list to see if any of the other teams which is working with the IoT Broker is having similar problems.

I’m trying to use NEC IoT Broker GE and the Configuration Manager IoT Discovery GE to run some tests before proceeding to the development of the app which was assigned to our team (OneSource). 
I had some problems related to compiling the source code which I managed to overcome. I used the sources because the binaries are not available on the catalogue and the instructions to compile and run the GE from the sources are incomplete.

Nevertheless, I later managed to get the binaries from the image on the FIWARE Cloud to a local Ubuntu VM and got the server up and running.

Now, onwards to the real issue (copied from the comments about a ticket I submitted on JIRA):

I contacted the authors of the code and they gave me some pointers. Turns out one of the pom.xml files was pointing to a wrong version of the broker upon compilation (3.3.3). The current version provided in the same source code is 3.4.2 still there are no further instructions on how to run the generated files.
Nevertheless, I managed to copy the code from the FIWARE Cloud image and run it on a local machine. I figured out I had to have another GE, the IoT Configuration Manager working parallel to the IoT Broker in order to manage the entities from which we will get data. Now, it seems that the XMLValidator code is giving me some trouble. I registered an entity via HTTP POST osgi9 directly with the configuration manager. Then I try to access it by communicating via osgi10 with the IoT broker. The IoT Broker communicates with the IoT DIscovery service and gets a response, but then the XMLValidator says the XML is wrong even tough it clearly is not. See below:
This is the IoT Broker asking for the availability of a resource to the IoT ConfMan:
2014-11-27 10:31:13,682 | INFO | (HttpConnectionClient.java:initializeConnection:170) | Output Stream: <?xml version="1.0" encoding="UTF-8" standalone="yes"?><discoverContextAvailabilityRequest><entityIdList><entityId isPattern="false"><id>Dorm</id></entityId></entityIdList><attributeList/><restriction><scope><operationScope><scopeType>IncludeAssociations</scopeType><scopeValue xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xsi:type="xs:string">SOURCES</scopeValue></operationScope></scope></restriction></discoverContextAvailabilityRequest>
Then IoT Broker gets:
2014-11-27 10:31:13,947 | INFO | (HttpConnectionClient.java:initializeConnection:188) | <?xml version="1.0" encoding="UTF-8"?><discoverContextAvailabilityResponse>
<contextRegistrationResponseList>
<contextRegistrationResponse>
<contextRegistration>
<entityIdList>
<entityId type="Room" isPattern="false">
<id>Dorm</id>
</entityId>
</entityIdList>
<contextRegistrationAttributeList>
<contextRegistrationAttribute>
<name>temperature</name>
<type>degree</type>
<isDomain>false</isDomain>
<metadata>
<contextMetadata>
<name>ID</name>
<type>string</type>
<value/>
</contextMetadata>
<contextMetadata>
<name/>
<type/>
<value/>
</contextMetadata>
</metadata>
</contextRegistrationAttribute>
</contextRegistrationAttributeList>
<providingApplication>http://192.168.100.1:70
</providingApplication>
</contextRegistration>
</contextRegistrationResponse>
</contextRegistrationResponseList>
<errorCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
<details xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="xs:string">Result</details>
</errorCode>
</discoverContextAvailabilityResponse>
2014-11-27 10:31:13,949 | INFO | (HttpConnectionClient.java:initializeConnection:218) | Connection Closed!
2014-11-27 10:31:13,987 | INFO | (XmlValidator.java:error:128) | 
ERROR
org.xml.sax.SAXParseException; lineNumber: 0; columnNumber: 0; cvc-complex-type.2.4.b: The content of element 'contextRegistration' is not complete. One of '
{registrationMetaData, providingApplication}
' is expected.
It is clearly seen by the received xml that at least the providingApplication is received but XMLValidator is not seeing this.

Also, the schema regarding context registration is:
<xs:complexType name="ContextRegistration">
<xs:sequence>
<xs:element name="entityIdList" type="EntityIdList"
minOccurs="0" maxOccurs="1" />
<xs:element name="contextRegistrationAttributeList" type="ContextRegistrationAttributeList"
minOccurs="0" maxOccurs="1" />
<xs:element name="registrationMetaData" type="RegistrationMetaData"
minOccurs="0" maxOccurs="1" />
<xs:element name="providingApplication" type="xs:anyURI"
minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
And the error regards a missing registrationMetaData field when it is not even mandatory.

Best regards,

Pedro Borges		
pedroborges at onesource.pt

http://onesource.pt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fiware.org/private/fiware-friendly-testing/attachments/20141127/aea6da40/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: part2.09040405.03060202 at onesource.pt
Type: application/octet-stream
Size: 1728 bytes
Desc: not available
URL: <https://lists.fiware.org/private/fiware-friendly-testing/attachments/20141127/aea6da40/attachment.obj>


More information about the Fiware-friendly-testing mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy