title: validating SOAP-Request with a SOAPHandler
body: <p>I'm trying to validate a SOAP-Request against the Schemas defined in the WSDL. I'm using a SOAPHandler with a SOAP-Handler-Chain. It works the only problem is that when I'm validating the request, I get this error message:</p>
  
  <pre><code>cvc-complex-type.2.4.a: Invalid content was found starting with element 'v1:latitude'. One of '{"http://schemas.domain.com/wsdl/fuelprice/v1/model":latitude}' is expected.
  </code></pre>
  
  <p>The WSDL looks like this:</p>
  
  <pre><code>&lt;wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
        xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
        mlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
        mlns:http="http://schemas.xmlsoap.org/wsdl/http/"
        xmlns:xs="http://www.w3.org/2001/XMLSchema"
        xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
        xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:tns="http://schemas.domain.com/wsdl/fuelprice/v1"
        xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model"
        xmlns:exception="http://schemas.domain.com/wsdl/fuelprice/v1/exception"
        targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1"&gt;
  &lt;wsdl:types&gt;
      &lt;xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1" elementFormDefault="qualified"&gt;
          &lt;xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" schemaLocation="common.xsd"/&gt;
          &lt;xsi:import namespace="http://schemas.domain.com/wsdl/fuelprice/v1/exception" schemaLocation="exception.xsd"/&gt;
          &lt;xsi:import namespace="http://schemas.xmlsoap.org/soap/envelope/" schemaLocation="http://schemas.xmlsoap.org/soap/envelope/"/&gt;
          &lt;xsi:element name="GetAreaFuelStationsRequest"&gt;
              &lt;xsi:complexType&gt;
                  &lt;xsi:sequence&gt;
                      &lt;xsi:element name="area" type="model:Area"/&gt;
                  &lt;/xsi:sequence&gt;
                  &lt;xsi:attribute name="provider" type="xsi:string" use="optional"/&gt;
                  &lt;xsi:attribute name="prices" type="xsi:boolean" use="required"/&gt;
              &lt;/xsi:complexType&gt;
          &lt;/xsi:element&gt;
  </code></pre>
  
  <p>The XSD:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xsi:schema xmlns:xsi="http://www.w3.org/2001/XMLSchema" xmlns:model="http://schemas.domain.com/wsdl/fuelprice/v1/model" targetNamespace="http://schemas.domain.com/wsdl/fuelprice/v1/model" elementFormDefault="qualified"&gt;
  &lt;xsi:complexType name="FuelStation"&gt;
      &lt;xsi:complexType name="Area"&gt;
          &lt;xsi:sequence&gt;
              &lt;xsi:element name="center" type="model:GeoLocation"/&gt;
              &lt;xsi:element name="radius" type="xsi:float"/&gt;
          &lt;/xsi:sequence&gt;
      &lt;/xsi:complexType&gt;
      &lt;xsi:complexType name="GeoLocation"&gt;
          &lt;xsi:sequence&gt;
              &lt;xsi:element name="latitude" type="xsi:double"/&gt;
              &lt;xsi:element name="longitude" type="xsi:double"/&gt;
          &lt;/xsi:sequence&gt;
          &lt;xsi:attribute name="ellipsoid" type="xsi:string" use="required"/&gt;
      &lt;/xsi:complexType&gt;
  </code></pre>
  
  <p>The source code fragment:</p>
  
  <pre><code>    try {
          context.getMessage().getSOAPPart().getEnvelope();
          schemas = getSchemas(new URL(wsdlURI.toString().concat(wsdl)));
          schema = factory.newSchema(schemas);
          validator = schema.newValidator();
          validator.validate(new DOMSource(xml));
      }
  </code></pre>
  
  <p>A request:</p>
  
  <pre><code>&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://schemas.domain.com/wsdl/fuelprice/v1" xmlns:mod="http://schemas.domain.com/wsdl/fuelprice/v1/model"&gt;
     &lt;soapenv:Header/&gt;
     &lt;soapenv:Body&gt;
        &lt;v1:GetAreaFuelStationsRequest provider="ep1" prices="true"&gt;
           &lt;v1:area&gt;
              &lt;mod:center ellipsoid="false"&gt;
                   &lt;v1:latitude&gt;49.8385&lt;/v1:latitude&gt;
                   &lt;v1:longitude&gt;8.5014&lt;/v1:longitude&gt;
              &lt;/mod:center&gt;
              &lt;mod:radius&gt;10&lt;/mod:radius&gt;
           &lt;/v1:area&gt;
        &lt;/v1:GetAreaFuelStationsRequest&gt;
     &lt;/soapenv:Body&gt;
  &lt;/soapenv:Envelope&gt;
  </code></pre>
  
  <p>Can anybody see what is wrong here? I have set </p>
  
  <pre><code>elementFormDefault="qualified"
  </code></pre>
  
  <p>but it did not work.</p>