XFire

aegis fails to unmarshal xml correctly if xsi:type is included in xml

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.2.2
  • Component/s: Aegis Module
  • Labels:
    None
  • Environment:
    Windows XP Pro, XFire 1.2.1
  • Number of attachments :
    4

Description

I have made an XFire code first web-service (yes, I know, document first is best practice).
Aegis fails to unmarshal my XML correctly.
I end up in the correct method with the correct input parameter, but the input-object is not complete according to XML, some attributes are null, and they should have been instantiated. This is the scenario:
I start Tomcat and deploy my ws. I send it some XML and it fails.
Then I modify the XML somewhat (see below), and all is well. Then I send exactly the same XML that failed initially, and now it too works.
The first thing I do in my method is to log the input parameter, and when this error happens the dates and the stations specified in my XML are null.
This is the XML I send initially (SOAP headers and envelope excluded):
<getAdvices xmlns:ns1="http://info.backend.data.nsb.no" xsi:type="ns1:GetAdvices">
<in0 xmlns:ns2="http://jaws.nsb.no" xsi:type="ns2:MultiTravelAdviceRequest">
<ns2:filter xsi:type="xsd:int">2044</ns2:filter>
<ns2:fromDate xsi:type="xsd:dateTime">2006-09-11T06:00:21.946Z</ns2:fromDate>
<ns2:fromStation xsi:type="ns2:Station">
<ns2:abbrev xsi:type="xsd:string">7600100</ns2:abbrev>
</ns2:fromStation>
<ns2:locale xsi:type="xsd:string">NO</ns2:locale>
<ns2:toDate xsi:type="xsd:dateTime">2006-09-17T19:00:21.946Z</ns2:toDate>
<ns2:toStation xsi:type="ns2:Station">
<ns2:abbrev xsi:type="xsd:string">7602234</ns2:abbrev>
</ns2:toStation>
</in0></getAdvices>

Then I change the following two lines from
<ns2:fromDate xsi:type="xsd:dateTime">2006-09-11T06:00:21.946Z</ns2:fromDate>
<ns2:fromStation xsi:type="ns2:Station">
to
<ns2:fromDate>2006-09-11T06:00:21.946Z</ns2:fromDate>
<ns2:fromStation>

(xsi:type definition removed, but only for the first occurence og dateTime and Station)
and now it works. After this I can now send the XML that failed again and it will work ok.

the generated WSDL and complete requests are attached.

Is it a bug in aegis (at least I believe it is Aegis) or am I doing something wrong here?

  1. applicationContext.xml
    15/Sep/06 6:45 PM
    3 kB
    Dag Framstad
  2. JP.wsdl
    15/Sep/06 6:34 PM
    19 kB
    Dag Framstad
  3. request1.xml
    15/Sep/06 6:34 PM
    2 kB
    Dag Framstad
  4. request2.xml
    15/Sep/06 6:34 PM
    1 kB
    Dag Framstad

Activity

Hide
Dag Framstad added a comment -

I forgot to tell that I use no mapping file and that my webservice is almost as simple as some the XFire code-first tutorials that you can find on the net (except somewhat more complex inside, it involves exchanging data with a legacy system etc) and that I inject a pool of beans which contain my service. Spring configuration is attached.

Show
Dag Framstad added a comment - I forgot to tell that I use no mapping file and that my webservice is almost as simple as some the XFire code-first tutorials that you can find on the net (except somewhat more complex inside, it involves exchanging data with a legacy system etc) and that I inject a pool of beans which contain my service. Spring configuration is attached.
Hide
Dan Diephouse added a comment -

OK, thanks, we'll look into this.

Show
Dan Diephouse added a comment - OK, thanks, we'll look into this.
Hide
Dan Diephouse added a comment -

This should be fixed in SVN now and will be included in the 1.2.2 release (which is now in process). Thanks.

Show
Dan Diephouse added a comment - This should be fixed in SVN now and will be included in the 1.2.2 release (which is now in process). Thanks.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: