Internal Server Error (unexpected null value for literal data)
Here is a slightly different version of an error, that took me more than a blink off an eye to recognize.
Unlike in my previous post, the error is coming from the server, wrapped in a soap:fault.
<env:Body>
<env:Fault>
<faultcode>env:Server</faultcode>
<faultstring>Internal Server Error (unexpected null value for literal data)</faultstring>
</env:Fault>
</env:Body>
The root cause is the same -- a serialization error, but this time on the implementation of the service instead of the client proxy. Remember that all the parts of the schema not marked as nullable or optional must have a value. And you have the same options to handle this:
Hope this will save some time, some day, to some of you...
Unlike in my previous post, the error is coming from the server, wrapped in a soap:fault.
<env:Body>
<env:Fault>
<faultcode>env:Server</faultcode>
<faultstring>Internal Server Error (unexpected null value for literal data)</faultstring>
</env:Fault>
</env:Body>
The root cause is the same -- a serialization error, but this time on the implementation of the service instead of the client proxy. Remember that all the parts of the schema not marked as nullable or optional must have a value. And you have the same options to handle this:
- change your XML Schema, so that it's aligned with your code.
- add code in the generated JavaBean, so that you have default value set
- remember to always use all the setter when instantiating a new Java object that will be included in the response (this is error prone, so it's why I like #2 better).
Hope this will save some time, some day, to some of you...
Comments