soap - Compilation error in scalaxb generated code (xmlprotocol.scala) - found: Boolean, required: Option[Boolean] -


i'm getting compilation error in xmlprotocol.scala generated latest scalaxb (1.1.2) large wsdl file:

[info] compiling 10 scala sources /aw-scalaxb-test/target/scala-2.10/classes... [error] /aw-scalaxb-test/target/scala-2.10/src_managed/main/sbt-scalaxb/aw/xmlprotocol.scala:630: type mismatch; [error]  found   : boolean [error]  required: option[boolean] [error]         p2.headoption map { scalaxb.fromxml[boolean](_, scalaxb.elemname(node) :: stack) } getorelse { scalaxb.fromxml[boolean](scala.xml.text("false"), scalaxb.elemname(node) :: stack) }, [error]                                                                                                                                    ^ [error] 1 error found [error] (compile:compile) compilation failed 

here corresponding piece of code (the error on first "p2.headoption map" line):

... (scalaxb.elemname(none, "historylastdate"))) ^^      { case p1 ~ p2 ~ p3 ~ p4 ~ p5 ~ p6 ~ p7 ~ p8 ~ p9 ~ p10 => aw.checkaccountrequestsequence2(p1.niloption map { scalaxb.fromxml[int](_, scalaxb.elemname(node) :: stack) },     p2.headoption map { scalaxb.fromxml[boolean](_, scalaxb.elemname(node) :: stack) } getorelse { scalaxb.fromxml[boolean](scala.xml.text("false"), scalaxb.elemname(node) :: stack) },     p3.niloption map { scalaxb.fromxml[string](_, scalaxb.elemname(node) :: stack) }, ... 

the error seems strange me since there several similar constructions in code around. of them generated wrong?

can give me hint wrong here?

original wsdl , code in github project: https://github.com/alboko/aw-scalaxb-test

after investigation, believe bug in handling "default=" attributes in elements like:

<xsd:element name="parseitineraries" type="xsd:boolean" nillable="true" default="false"> 

scalaxb generates

p2.headoption map {        scalaxb.fromxml[boolean](_, scalaxb.elemname(node) :: stack)  } getorelse {        scalaxb.fromxml[boolean](scala.xml.text("false"), scalaxb.elemname(node) :: stack)  } 

which causes compilation error. if remove default attribute, generates

p2.niloption map { scalaxb.fromxml[boolean](_, scalaxb.elemname(node) :: stack) } 

which compiles without issues.

created issue #245 scalaxb in github. @eed3si9n suspects bug in scalaxb.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -