I'm trying to write some junit tests for a custom serializer for a local knowledge representation language. My KR language includes wrappers for scalar values, so I want to deserialise integer values from the soap body to my KsInt class, rather than java.lang.Integer. My type mapping for wrapped style (using XSD:int) and for SOAP 1.1 passes the tests, but the SOAP 1.2 mapping doesn't. The problem I'm having is that when I set the message context to use SOAP12_CONSTANTS, the namespaces on the soap elements change to the SOAP 1.2 namespace, but the encoded values are in the SOAP 1.1 namespace. An example:
2004-10-03 12:02:26,865 DEBUG [main] encoding.TestNSEncoding (TestNSEncoding.java:119) - Serialised message: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:aMethod soapenv:encodingStyle="http://www.w3.org/2003/05/soap-encoding" xmlns:ns1="urn:testNamespace" xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope">
<ns1:testParam xsi:type="ns2:integer" xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/">42</ns1:testParam>
</ns1:aMethod>
</soapenv:Body>
</soapenv:Envelope>
Since my type mapping is registered in the type mapping registry against encoding Constants.URI_SOAP12_ENC, it doesn't get a chance to deserialize the SOAP 1.1 encoded integer.
I couldn't tell from an admittedly rather fast reading of the W3C soap 1.2 spec whether the encoded values should be in the new SOAP 1.2 namespace or not. Obviously if it's correct that the values are encoded in the xmlsoap.org namespace then I can fix my code to do the right thing. I was just a bit surprised, that's all. Comments welcome.
Btw, this is using Axis 1.2rc1. I was previously using beta 1. My code mostly worked fine, except for RPCParam.getValue() which I had to change to RPCParam.getObjectValue(). Might be something to mention in the release notes, since the compiler doesn't detect the change.
Ian