I successfully integrated Scalaxb into a project last week and, as posted previously, I'm really happy with the result.
Only two problems came up during the entire integration, and though I was ultimately able to resolve both of them - I thought Scalaxb could have provided better error messaging and that I should feedback with specific examples.
Apologies if it sounds like I'm nitpicking, I think everyone involved should be very proud that the following were the only problems I could find with Scalaxb.
I was getting an empty element returned by our SOAP server for an optional field. According to
I'm fine with Scalaxb exploding, however it took me a while to diagnose why from the following stack
[info] scalaxb.ParserFailure: java.lang.NumberFormatException: Zero length BigInteger
[info] at scalaxb.package$.fromXML(scalaxb.scala:15)
[info] at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30$$anonfun$apply$29$$anonfun$apply$30.apply(xmlprotocol.scala:818)
[info] at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30$$anonfun$apply$29$$anonfun$apply$30.apply(xmlprotocol.scala:818)
[info] at scala.Option.map(Option.scala:145)
[info] at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30$$anonfun$apply$29.apply(xmlprotocol.scala:818)
[info] at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30$$anonfun$apply$29.apply(xmlprotocol.scala:818)
[info] at scala.Option.map(Option.scala:145)
[info] at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30.apply(xmlprotocol.scala:818)
[info] at venus.paris.generated.XMLProtocol$DefaultSyndicationrequestProductionFormat$$anonfun$parser$30.apply(xmlprotocol.scala:815)
[info] at scala.util.parsing.combinator.Parsers$Success.map(Parsers.scala:136)
An error which indicates which field had the problem would have saved me from trawling through hundreds of fields in my data and removing them by trial and error.
2) Error messaging around multiple schemas
Another problem that is very well documented on the website but equally confusing when encountered in the wild is,
It was cool the way Scalaxb attempted to resolve namespace conflicts by arbitrarily assigning unique type names to generated code. We didn't even realise that we had namespace conflicts until we ran our code on CI and discovered that it was arbitrarily assigning _different_ unique type names to generated code (because it read the XSDs in a different order).
The compilation failures as a result were difficult to figure out.
It would have been better if Scalaxb had either,
1) refused to generate code when it found namespace conflicts and suggested that we add packages
2) made sure that it read XSD files in the same order regardless of the operating system (we saw different XSD file read order on Max/Linux).
Two tiny niggling errors with a great product,
Thanks
Caoilte