metro-jax-ws icon indicating copy to clipboard operation
metro-jax-ws copied to clipboard

Not helpful exception is thrown when SEI implemenation returns invalid object

Open Tomas-Kraus opened this issue 3 years ago • 0 comments

Consider this output model:

<xs:element name="Projects">
	<xs:complexType>
		<xs:sequence>
			<xs:element name="Project" type="tns:Project" minOccurs="0"
					maxOccurs="unbounded" />
			</xs:sequence>
		</xs:complexType>
	</xs:element>

<xs:complexType name="Project">
		<xs:attribute name="itemId" type="tns:itemId" use="required" />
		<xs:attribute name="itemRevisionId" type="tns:itemRevisionId"
			use="required" />
		<xs:attribute name="uid" type="tns:uid" use="required" />
		<xs:attribute name="keyword" type="tns:keyword" />
		<xs:attribute name="objectName" type="tns:objectName" />
		<xs:attribute name="owningGroup" type="tns:owningGroup" />

	</xs:complexType>

It happens to me that the source where I obtain the data for response was missing the revision id and uid. A SOAP fault was issued but virtually no information about the cause and even worse thing has spit out to the logs:

<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" />
  <S:Body>
    <S:Fault xmlns:ns4="http://www.w3.org/2003/05/soap-envelope">
      <faultcode>S:Server</faultcode>
      <faultstring>org.xml.sax.SAXParseException</faultstring>
    </S:Fault>
  </S:Body>
</S:Envelope>

This must be improved when the returned model does not adhere to @SchemaValidation

Affected Versions

[2.2.8]

Source: https://github.com/javaee/metro-jax-ws/issues/1155 Author: glassfishrobot

Tomas-Kraus avatar Jun 02 '22 17:06 Tomas-Kraus