When connecting a BICEPSClient with a BICEPSDevice we get an XmlPullParserException on the client if the last node of an xml tree is empty.
This examples explains:
<MetaData>
<Manufacturer>manu</Manufacturer>
<ModelName>model</ModelName>
<ModelNumber>12345</ModelNumber>
<SerialNumber></SerialNumber>
</MetaData>
If SerialNumber is empty an XmlPullParserException occurs. The same ecxeption is thrown if writing an xml like this:
<MetaData>
<Manufacturer>manu</Manufacturer>
<ModelName>model</ModelName>
<ModelNumber></ModelNumber>
</MetaData>
No exception is thrown if all nodes contain a string.
Stacktrace on the client
Don't be confused of the position the exception complains about (<d:availability>1</). That's not the relevant position.</d:availability>
org.xmlpull.v1.XmlPullParserException: expected START_TAG or END_TAG not TEXT (position: TEXT seen ...<d:availability>1</... @1:2392)
at org.xmlpull.mxp1.MXParser.nextTag(MXParser.java:1083)
at org.ws4d.java.io.xml.AbstractElementParser.nextTag(AbstractElementParser.java:368)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.parse1(DefaultSOAP2ParameterValueConverter.java:368)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.handleComplexType(DefaultSOAP2ParameterValueConverter.java:201)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.parse0(DefaultSOAP2ParameterValueConverter.java:135)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.handleComplexType(DefaultSOAP2ParameterValueConverter.java:213)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.parse0(DefaultSOAP2ParameterValueConverter.java:135)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.handleComplexType(DefaultSOAP2ParameterValueConverter.java:213)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.parse0(DefaultSOAP2ParameterValueConverter.java:135)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.handleComplexType(DefaultSOAP2ParameterValueConverter.java:213)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.parse0(DefaultSOAP2ParameterValueConverter.java:135)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2ParameterValueConverter.parseParameterValue(DefaultSOAP2ParameterValueConverter.java:54)
at com.draeger.medical.mdpws.communication.protocol.soap.generator.MDPWSSOAP2ParameterValueConverter.parseParameterValue(MDPWSSOAP2ParameterValueConverter.java:99)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2MessageGenerator.deliverBody(DefaultSOAP2MessageGenerator.java:297)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2MessageGenerator.deliver(DefaultSOAP2MessageGenerator.java:560)
at com.draeger.medical.mdpws.communication.protocol.soap.generator.MDPWSSOAP2MessageGenerator.deliver(MDPWSSOAP2MessageGenerator.java:297)
at org.ws4d.java.communication.protocol.soap.generator.DefaultSOAP2MessageGenerator.deliverMessage(DefaultSOAP2MessageGenerator.java:166)
at org.ws4d.java.communication.protocol.soap.SOAPRequest$1.handle(SOAPRequest.java:235)
at org.ws4d.java.communication.protocol.http.HTTPClient$StreamConsumerThread.run(HTTPClient.java:1164)
at org.ws4d.java.concurrency.DefaultThreadPool$WorkerThread.run(DefaultThreadPool.java:303)</d:availability>
Thanks for reporting.
I am trying to reproduce the reported bug, but I have problems with it.
I assume that the Metadata you showed is from a HydraMDSDescriptor. If I look into the generated XML it should look like this:
Even when I am setting the serial number of the metadata to an empty list.
So my question is: How did you get to the XML that is processed? Would be great to see the code and maybe the complete message.
Code sniipet how the MetaData is produced:
Yes, it's a HydraMDSDescriptor. I use an xml file device description. Do you use java for creating a device? Maybe the error occurs only when using xml.
Maybe you know the "openSDC_Konnektor" from "Uni_Rostock-KarlStorz-ORNET rundumSorglosPaket". That's the device I'm talking about.
This is my xml file:
Could you attach it as a file?
BTW Which openSDC version is it? Beta04?
Last edit: Stefan Schlichting 2014-12-05
I'm sorry, I haven't seen the "add attachments" link.
It is Beta04.
I will give it a try with the example file.
Will be fixed in Beta05.