Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0 M1
    • Fix Version/s: 1.0 M2
    • Component/s: None
    • Labels:
      None
    • Environment:
      WinXp, Java5

      Description

      I've created a web service and i get a validation error in the log file.

      DEBUG webservice.CreateDataTypesRequestEndpoint - Marshalling [[email protected]] 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:key>123</ns2:key>
      <ns2:firstName>Fritz</ns2:firstName>
      <ns2:lastName>Meier</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" >

      <complexType name="CasDataType" >
      <sequence>
      <element name="key" type="long" nillable="false" minOccurs="1" maxOccurs="1"/>
      </sequence>
      </complexType>

      <complexType name="AddressDataType">
      <complexContent>
      <extension base="tns:CasDataType">
      <sequence>
      <element name="firstName" nillable="true" minOccurs="0" type="string"/>
      <element name="lastName" nillable="true" minOccurs="0" type="string"/>
      </sequence>
      </extension>
      </complexContent>
      </complexType>

      <complexType name="ArrayOfCasDataTypes">
      <sequence>
      <element name="casDataType" type="tns:CasDataType" nillable="false" minOccurs="1" maxOccurs="unbounded"/>
      </sequence>
      </complexType>

      <element name="createDataTypesRequest" type="tns:ArrayOfCasDataTypes"/>

      <element name="createDataTypesResponse" type="tns:ArrayOfCasDataTypes"/>

      </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")));

        Attachments

          Activity

            People

            • Assignee:
              arjen.poutsma Arjen Poutsma
              Reporter:
              res1st Ingo
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: