Make it String, why is it an Object in the first place?
@user3572079 You can't change the schema but you can customize, for instance using jaxb:javaType, see the update.
How you can fix that. You have align the type of the property with the type of the data. There's quite a number of ways to achieve that:
However, to keep things consistent, I cast the string to Object so
that it matches the method's parameter type.
JAXB exports xsi:type if your data specifies other type than your model. In your case, you set a string, but the field is Object. So your data has a different type than your model. The behaviour is correct.
Thx for that. I'll have a look at your update
thx for confirming my understanding of what's happening. Unfortunately, I can't change the type from Object to String as the XSD has been supplied to me (I did play about the method and changed it to accept String and the xsi:type goes way like you've said). Any good links to your second suggestion or does that involve changing the JAXB classes too? I'm using Eclipselink MOXy BTW. Is there some sort of feature that I can use? When I tried to cast the String to Object I was clutching at straws but with no luck! ;)