eed3si9n/scalaxb — Issue #140: move namespaces from the envelope to the body
Author: dportabella
Created: 2012-02-21 14:00:53+00:00
State: open

It seems that there is a bug in some web service frameworks, such Apache CXF,
that in some cases, it fails to parse the body if the namespaces are declared only in the soap envelope node.

See: SOAP re-declaring qname inside body
http://stackoverflow.com/questions/8819989/soap-re-declaring-qname-inside-body

scalaxb is declaring all the namespaces in the envelope node,
and even if this is correct,
it might be better to declare the namespaces inside the body (which is also correct)
as a workaround to these buggy common web services frameworks.

I modified scalaxb locally as follows and it works ok now for me with Apache CXF:

in soap11.scala, replace:

val merged = scalaxb.toScope(((Some("soap11") -> SOAP_ENVELOPE11_URI) :: scalaxb.fromScope(scope)).distinct: _*)
val r = in map { scalaxb.toXML(_, Some(SOAP_ENVELOPE11_URI), Some("Envelope"), merged) match {

by

val soapScope = scalaxb.toScope((Some("soap11") -> SOAP_ENVELOPE11_URI));
val r = in map { scalaxb.toXML(_, Some(SOAP_ENVELOPE11_URI), Some("Envelope"), soapScope) match {