Hi Dinko and other readers,
i created a Eclipse project with a web service (server) and a client
(junit test case).
It shows the class cast exception, because it creates an DataObject
instead of an Appointment.
My test project with all libraries (and the WAR) can be download at
http://blackberry.cas.de/JAXBMappingError.zip
It includes ANT targets to generate the server and run the client.
I also have the bug posted at:
https://jaxb.dev.java.net/issues/show_bug.cgi?id=197
I hope someone can debug my small application.
Cheers,
Ingo
Dinko Tenev schrieb:
> Hi,
>
> On 7/21/06, Ingo Siebert <ingo.siebert_at_cas.de> wrote:
>> Hi Dinko!
>>
>> >> <ns2:createObjectResponse xmlns:ns2="http://schema.eim.de"
>> >> xmlns:ns3="http://faults.eim.de">
>> >> <ns2ataObject xmlnssi="http://www.w3.org/2001/XMLSchema-instance"
>> > [...]
>> >
>> > This doesn't look right -- I guess you need "xmlns:xsi" here.
>>
>> Your are right, i copied it from a forum post, but the question is still
>> without answer. The forum converted :x of xmlns:xsi to a smily and
>> destroyed the xml code. :(
>> The same problem with "xmlns:Data...", :D was also a smily. That's the
>> correct XML code:
>>
>> <ns2:createObjectResponse xmlns:ns2="http://schema.eim.de"
>> xmlns:ns3="http://faults.eim.de">
>> <ns2:DataObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:type="ns2:Appointment">
>> <ns2:id xsi:nil="true"/>
>> <ns2:keyword xsi:nil="true"/>
>> <ns2:startDate xsi:nil="true"/>
>> <ns2:endDate xsi:nil="true"/>
>> </ns2:DataObject>
>> </ns2:createObjectResponse>
>>
>>
>> Do you have any idea what's wrong?
>> I have some cases in which the "type" attribute is working, but some
>> cases where the type attribute is ignored. I doesn't see a system
>> behind it.
>
> I'm out of particular suggestions, but if the above is the case, then
> maybe it would help to scrutinize the differences between the cases
> that work and those that don't.
>
>
> Cheers,
>
> Dinko