The request is definitely wrong: > <result> > <taskType>OBSERVE</taskType> > <timestamp>2009-02-10T10:17:04.024+0300</timestamp> > <ns2:ExtScanResult>
But the schema says: <xs:element minOccurs="0" name="extScanResult" nillable="true" > type="tns:ExtScanResult"/> The element name should be "extScanResult" and unqualified. Dan On Tue February 10 2009 5:12:18 am Kirill R. wrote: > Hello everyone, > > (crossposted this in JAXB impl support forum at java.net because I'm not > sure where this > question belongs) > > Tough problem here, no idea how to tackle it: > > I'm running a web service using CXF (2.1.3, JAXB impl 2.1.7) and JAX-WS > annotated classes. > During processing of an incoming request, some fields which are present in > the request end up > being null in the resulting POJO passed to the web method of service > implementation. > > For the request below (sent by both the actual client of our service and by > SoapUI with some > modifications based on a wild guess - redundant namespace prefixes or the > cryptic xs:string > in the end removed), debugging revealed that content of every element > inside ExtScanResult > is discarded (the condition in StAXStreamConnector.handleCharacters isn't > met) and, as a result, > the entire extScanResult field ends up being null as all of its own fields > are null. > > deviceId, port, taskType and timestamp are assigned correct values, but not > the other fields. > > SOAP/WSDL exceprts with comments below: > > Request: > > <?xml version="1.0" encoding="UTF-16"?> > <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> > <S:Body> > <ns2:result xmlns:ns2="http://acme.com"> > <deviceId>2</deviceId> > <port>1</port> > <result> > <taskType>OBSERVE</taskType> > <timestamp>2009-02-10T10:17:04.024+0300</timestamp> > <ns2:ExtScanResult> > <channelId>R47</channelId> > <channelType>SECAM</channelType> > <ns2:AnalogResult> > <videoLevel>1.27</videoLevel> > <primaryAudioLevel>128.27</primaryAudioLevel> > > <videoToPrimaryAudioRatio>127.0</videoToPrimaryAudioRatio> > <secondaryAudioLevel>INF</secondaryAudioLevel> > > <videoToSecondaryAudioRatio>INF</videoToSecondaryAudioRatio> > > <videoSignalToNoiseRatio>0.0</videoSignalToNoiseRatio> > > <maxDeltaBetweenAdjacentVideo>0.0</maxDeltaBetweenAdjacentVideo> > </ns2:AnalogResult> > <xs:string > xmlns:xs="http://www.w3.org/2001/XMLSchema"/> </ns2:ExtScanResult> > </result> > </ns2:result> > </S:Body> > </S:Envelope> > > Schema: > > Web method request wrapper > > <xs:complexType name="result"> > <xs:sequence> > <xs:element minOccurs="0" name="deviceId" type="xs:string"/> > <xs:element name="port" type="xs:int"/> > <xs:element minOccurs="0" name="result" > type="tns:MeasurementTaskResult"/> > </xs:sequence> > </xs:complexType> > > and the types it references > > <xs:complexType name="MeasurementTaskResult"> > <xs:sequence> > <xs:element name="taskType" type="xs:string"/> > <xs:element name="timestamp" type="xs:string"/> > <xs:element maxOccurs="unbounded" minOccurs="0" > name="quickScanResult" nillable="true" type="tns:ScanResultItem"/> > <xs:element minOccurs="0" name="extScanResult" nillable="true" > type="tns:ExtScanResult"/> > </xs:sequence> > </xs:complexType> > > <xs:complexType name="ExtScanResult"> > <xs:sequence> > <xs:element minOccurs="0" name="channelId" type="xs:string"/> > <xs:element minOccurs="0" name="channelType" type="xs:string"/> > <xs:element minOccurs="0" name="analogResult" nillable="true" > type="tns:AnalogResult"/> > <xs:element minOccurs="0" name="digitalMeasurementMode" > nillable="true" type="xs:string"/> > <xs:element minOccurs="0" name="digitalLevelsResult" > nillable="true" type="tns:DigitalLevelsResult"/> > <xs:element minOccurs="0" name="digitalQAMResult" > nillable="true" type="tns:DigitalQAMResult"/> > </xs:sequence> > </xs:complexType> > > <xs:complexType name="AnalogResult"> > <xs:sequence> > <xs:element name="videoLevel" type="xs:float"/> > <xs:element name="primaryAudioLevel" type="xs:float"/> > <xs:element name="videoToPrimaryAudioRatio" type="xs:float"/> > <xs:element name="secondaryAudioLevel" type="xs:float"/> > <xs:element name="videoToSecondaryAudioRatio" type="xs:float"/> > <xs:element name="videoSignalToNoiseRatio" type="xs:float"/> > <xs:element name="maxDeltaBetweenAdjacentVideo" > type="xs:float"/> > </xs:sequence> > </xs:complexType> > > So is there something wrong with the schema generated by CXF, or the > request? Or is the problem elsewhere? > > I can post the JAX-WS annotated Java classes used by our service if it is > necessary, but the other party's > client for our web service was developed using this schema, not our Java > code. -- Daniel Kulp [email protected] http://www.dankulp.com/blog
