Skip to content

Commit

Permalink
fixes asFault is not a member of Throwable. fixes #264
Browse files Browse the repository at this point in the history
  • Loading branch information
eed3si9n committed Jun 16, 2014
1 parent dbc1715 commit 822a8a3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 13 additions & 4 deletions cli/src/main/scala/scalaxb/compiler/wsdl11/GenSource.scala
Expand Up @@ -340,6 +340,9 @@ trait {interfaceTypeName} {{
case "Any" => "x"
case x => "x.asFault[%s]".format(x)
}
def faultTypeName: String =
if (soap12) "scalaxb.Fault[_]"
else "scalaxb.Soap11Fault[_]"

val opImpl = (op.xoperationtypeoption, config.async) match {
case (DataRecord(_, _, XOnewayoperationSequence(input)), true) =>
Expand All @@ -361,11 +364,14 @@ trait {interfaceTypeName} {{
// "def %s(%s): Option[scalaxb.Fault[%s]]".format(op.name, arg(input), faultsToTypeName(faults))
"""soapClient.requestResponse(%s,
| %s, defaultScope, %s, %s, %s).transform({ case (header, body) =>
| %s }, { x => %s })""".stripMargin.format(
| %s }, {
| case x: %s => %s
| case x => x
| })""".stripMargin.format(
bodyString(op, input, binding, soapBindingStyle),
headerString(op, input, binding, soapBindingStyle), address, quotedMethod, actionString,
outputString(output, binding, op, soapBindingStyle, soap12),
faultString(faults))
faultTypeName, faultString(faults))

case (DataRecord(_, _, XRequestresponseoperationSequence(input, output, faults)), false) =>
// "def %s(%s): Option[scalaxb.Fault[%s]]".format(op.name, arg(input), faultsToTypeName(faults))
Expand All @@ -383,11 +389,14 @@ trait {interfaceTypeName} {{
// "def %s(%s): Either[scalaxb.Fault[Any], %s]".format(op.name, arg(input), paramTypeName)
"""soapClient.requestResponse(%s,
| %s, defaultScope, %s, %s, %s).transform({ case (header, body) =>
| %s }, { x => %s })""".format(
| %s }, {
| case x: %s => %s
| case x => x
| })""".format(
bodyString(op, input, binding, soapBindingStyle),
headerString(op, input, binding, soapBindingStyle), address, quotedMethod, actionString,
outputString(output, binding, op, soapBindingStyle, soap12),
faultString(faults))
faultTypeName, faultString(faults))

case (DataRecord(_, _, XSolicitresponseoperationSequence(output, input, faults)), false) =>
// "def %s(%s): Either[scalaxb.Fault[Any], %s]".format(op.name, arg(input), paramTypeName)
Expand Down
6 changes: 4 additions & 2 deletions notes/1.2.1.markdown
@@ -1,6 +1,8 @@
[264]: https://github.com/eed3si9n/scalaxb/issues/264
[265]: https://github.com/eed3si9n/scalaxb/issues/265
[@romainreuillon]: https://github.com/romainreuillon

## SOAP bug fixes

- Fixes xs:AnyType handling. [#265][265]

- Fixes `xs:AnyType` handling. [#265][265]
- Fixes `asFault` not `Throwable` error. [#264][264] reported by [@romainreuillon][@romainreuillon]

0 comments on commit 822a8a3

Please sign in to comment.