Axis appears to be ignoring minOccurs="0"
-----------------------------------------
Key: AXIS-2166
URL: http://issues.apache.org/jira/browse/AXIS-2166
Project: Apache Axis
Type: Bug
Versions: 1.2.1
Environment: Linux, Tomcat 5
Reporter: John Baker
Attachments: serviceRequest.wsdl, stdout_20050804.zip
I am using a WSDL file supplied to be by a third party and I suspect it doesn't
quite reflect what their .NET server is returning in the SOAP messages. I am
getting this exception:
java.io.IOException: Non nillable element 'requestCategoryCode' is null.
at
org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.
java:215)
at
org.apache.axis.encoding.SerializationContext.serializeActual(Seriali
zationContext.java:1426)
at
org.apache.axis.encoding.SerializationContext.serialize(Serialization
Context.java:914)
at
org.apache.axis.encoding.SerializationContext.serialize(Serialization
Context.java:702)
at
org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.
java:230)
at
org.apache.axis.encoding.SerializationContext.serializeActual(Seriali
zationContext.java:1426)
at
org.apache.axis.encoding.SerializationContext.serialize(Serialization
Context.java:914)
So looking at (an extract of) the XML received by Axis:
<AdministrationDetails><ComplaintTypeCode>PESTM</ComplaintTypeCode><ComplaintTypeText>Mice</ComplaintTypeText><AllocatedToCode>CRMTES</AllocatedToCode>
<AllocatedToText>CRMTestOfficer</AllocatedToText><HowReceivedCode>CC</HowReceivedCode><HowReceivedText>CallCentre</HowReceivedText><TimeReceived>2005-08-04T0
6:52:03.0000000+01:00</TimeReceived><StatusCode>REC</StatusCode><StatusText>Received</StatusText><AreaTeamCode>E</AreaTeamCode><AreaTeamText>Eastern
AreaTeam</AreaTeamText></AdministrationDetails>
As you can see, RequestCategoryCode is not in the XML extract. Yet it is
defined like this in the WSDL:
<xs:element name="RequestCategoryCode" type="uni:CNCODE_CodeValue"
minOccurs="0" nillable="true">
Now given I can't provide a test case, I've supplied the WSDL and the XML being
returned from the .NET server.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira