You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've created a web service and i get a validation error in the log file.
DEBUG webservice.CreateDataTypesRequestEndpoint - Marshalling [javax.xml.bind.JAXBElement@1873ad9] to response payload
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: UndeclaredPrefix: Cannot resolve 'ns2:AddressDataType' as a QName: the prefix 'ns2' is not declared.
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: cvc-elt.4.1: The value 'ns2:AddressDataType' of attribute 'http://www.w3.org/2001/XMLSchema-instance,type' of element 'ns2:casDataType' is not a valid QName.
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: UndeclaredPrefix: Cannot resolve 'ns2:AddressDataType' as a QName: the prefix 'ns2' is not declared.
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: cvc-attribute.3: The value 'ns2:AddressDataType' of attribute 'xsi:type' on element 'ns2:casDataType' is not valid with respect to its type, 'QName'.
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: cvc-complex-type.2.4.d: Invalid content was found starting with element 'ns2:firstName'. No child element is expected at this point.
The following code is my SOAP response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header />
SOAP-ENV:Body
<ns2:createDataTypesResponse xmlns:ns2="http://springws.cas.de">
<ns2:casDataType
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:AddressDataType">
ns2:key123</ns2:key>
ns2:firstNameFritz</ns2:firstName>
ns2:lastNameMeier</ns2:lastName>
</ns2:casDataType>
</ns2:createDataTypesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Ingo opened SWS-35 and commented
I've created a web service and i get a validation error in the log file.
DEBUG webservice.CreateDataTypesRequestEndpoint - Marshalling [javax.xml.bind.JAXBElement@1873ad9] to response payload
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: UndeclaredPrefix: Cannot resolve 'ns2:AddressDataType' as a QName: the prefix 'ns2' is not declared.
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: cvc-elt.4.1: The value 'ns2:AddressDataType' of attribute 'http://www.w3.org/2001/XMLSchema-instance,type' of element 'ns2:casDataType' is not a valid QName.
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: UndeclaredPrefix: Cannot resolve 'ns2:AddressDataType' as a QName: the prefix 'ns2' is not declared.
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: cvc-attribute.3: The value 'ns2:AddressDataType' of attribute 'xsi:type' on element 'ns2:casDataType' is not valid with respect to its type, 'QName'.
ERROR endpoint.PayloadValidatingInterceptor - XML validation error on response: cvc-complex-type.2.4.d: Invalid content was found starting with element 'ns2:firstName'. No child element is expected at this point.
The following code is my SOAP response:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header />
SOAP-ENV:Body
<ns2:createDataTypesResponse xmlns:ns2="http://springws.cas.de">
<ns2:casDataType
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="ns2:AddressDataType">
ns2:key123</ns2:key>
ns2:firstNameFritz</ns2:firstName>
ns2:lastNameMeier</ns2:lastName>
</ns2:casDataType>
</ns2:createDataTypesResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
My XSD looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<schema
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="qualified"
targetNamespace="http://springws.cas.de"
xmlns:tns="http://springws.cas.de" >
</schema>
This code says that my xml is valid:
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants. W3C_XML_SCHEMA_NS_URI);
Schema schema = factory.newSchema(new File("schema.xsd"));
Validator validator = schema.newValidator();
validator.validate(new StreamSource(new File("payload.xml")));
Affects: 1.0 M1
The text was updated successfully, but these errors were encountered: