Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for Soap11Fault bug when empty detail #450

Merged
merged 1 commit into from Nov 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions cli/src/main/resources/soap11.scala.template
Expand Up @@ -2,15 +2,15 @@ package scalaxb

case class Soap11Fault[+A](original: Any, detail: Option[A], headers: scala.xml.NodeSeq) extends Exception {
def asFault[B: scalaxb.XMLFormat]: Soap11Fault[B] = Soap11Fault(original, detail map {
case x: soapenvelope11.Detail => x.any.head.value match {
case soapenvelope11.Detail(dataRecord :: _, _) => dataRecord.value match {
case node: scala.xml.Node => scalaxb.fromXML[B](node)
case _ => sys.error("unsupported fault: " + toString)
}
case _ => sys.error("unsupported fault: " + toString)
}, headers)
def asNillableFault[B: scalaxb.XMLFormat]: Soap11Fault[Option[B]] = Soap11Fault(original, detail map {
case x: soapenvelope11.Detail => x.any.head.value match {
case node: scala.xml.Node if scalaxb.Helper.isNil(node) => None
case soapenvelope11.Detail(dataRecord :: _, _) => dataRecord.value match {
case node: scala.xml.Node if scalaxb.Helper.isNil(node) => None
case node: scala.xml.Node => Some(scalaxb.fromXML[B](node))
case _ => sys.error("unsupported fault: " + toString)
}
Expand Down
6 changes: 3 additions & 3 deletions cli/src/main/resources/soap11_async.scala.template
Expand Up @@ -3,15 +3,15 @@ import scala.concurrent.Future

case class Soap11Fault[+A](original: Any, detail: Option[A], headers: scala.xml.NodeSeq) extends Exception {
def asFault[B: scalaxb.XMLFormat]: Soap11Fault[B] = Soap11Fault(original, detail map {
case x: soapenvelope11.Detail => x.any.head.value match {
case soapenvelope11.Detail(dataRecord :: _, _) => dataRecord.value match {
case node: scala.xml.Node => scalaxb.fromXML[B](node)
case _ => sys.error("unsupported fault: " + toString)
}
case _ => sys.error("unsupported fault: " + toString)
}, headers)
def asNillableFault[B: scalaxb.XMLFormat]: Soap11Fault[Option[B]] = Soap11Fault(original, detail map {
case x: soapenvelope11.Detail => x.any.head.value match {
case node: scala.xml.Node if scalaxb.Helper.isNil(node) => None
case soapenvelope11.Detail(dataRecord :: _, _) => dataRecord.value match {
case node: scala.xml.Node if scalaxb.Helper.isNil(node) => None
case node: scala.xml.Node => Some(scalaxb.fromXML[B](node))
case _ => sys.error("unsupported fault: " + toString)
}
Expand Down