title: Python Spyne - WSDL server - No matching global declaration available for the validation root
body: <p>I am trying to create a soap server with python spyne library. I don't really understand how to configure the server to receive data that is being sent because I get errors.</p>
  
  <p>Please provide me some help, tips and feedback on resolving this issue.</p>
  
  <p>When I post the code pasted below I get:</p>
  
  <pre><code>No matching global declaration available for the validation root.
  </code></pre>
  
  <p>When I use suds to send some data I get: </p>
  
  <pre><code>imp = Import('http://schemas.xmlsoap.org/soap/encoding/',
               location='http://schemas.xmlsoap.org/soap/encoding/')
  
  imp.filter.add('http://localhost:8000/sms/receive/')
  
  client = suds.client.Client('http://localhost:8000/sms/receive/')
  
  print client
  data = dict(id=1231412,
              name="tester",
              operator="nokia",
              to="4879293213",
              text="4879293213",
              numberOfParts=1,
              )
  print client.service.ReceiveSms(data)
  suds.TypeNotFound: Type not found: 'to'
  </code></pre>
  
  <p>This is the query that my soap server will receive.</p>
  
  <pre><code>&lt;env:Header/&gt;
  &lt;env:Body&gt;
      &lt;ns1:ReceiveSms xmlns:ns1="http://com.blablabla.webservice.receiver/webservice"&gt;
      &lt;Sms_1&gt;
          &lt;id&gt;25094332348431&lt;/id&gt;
          &lt;from&gt;48123123123&lt;/from&gt;
          &lt;operator&gt;P4&lt;/operator&gt;
          &lt;to&gt;481231231234&lt;/to&gt;
          &lt;text&gt;test&lt;/text&gt;
          &lt;numberOfParts&gt;1&lt;/numberOfParts&gt;
      &lt;/Sms_1&gt;
  &lt;/ns1:ReceiveSms&gt;
  &lt;/env:Body&gt;
  &lt;/env:Envelope&gt;
  </code></pre>
  
  <p>This is my WSDL:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;definitions targetNamespace="spyne.examples.hello" name="Application"&gt;
      &lt;types&gt;
          &lt;schema targetNamespace="server" elementFormDefault="qualified"&gt;
              &lt;complexType name="ResponseArray"&gt;
                  &lt;sequence&gt;
                      &lt;element name="Response" type="s0:Response" minOccurs="0" maxOccurs="unbounded" nillable="true"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
              &lt;complexType name="Response"&gt;
                  &lt;sequence&gt;
                      &lt;element name="name" type="xs:string" minOccurs="0" nillable="true"/&gt;
                      &lt;element name="text" type="xs:string" minOccurs="0" nillable="true"/&gt;
                      &lt;element name="numberOfParts" type="xs:integer" minOccurs="0" nillable="true"/&gt;
                      &lt;element name="to" type="xs:string" minOccurs="0" nillable="true"/&gt;
                      &lt;element name="operator" type="xs:string" minOccurs="0" nillable="true"/&gt;
                      &lt;element name="id" type="xs:long" minOccurs="0" nillable="true"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
              &lt;element name="Response" type="s0:Response"/&gt;
              &lt;element name="ResponseArray" type="s0:ResponseArray"/&gt;
          &lt;/schema&gt;
          &lt;schema targetNamespace="spyne.examples.hello" elementFormDefault="qualified"&gt;
              &lt;import namespace="server"/&gt;
              &lt;complexType name="ReceiveSmsResponse"&gt;
                  &lt;sequence&gt;
                      &lt;element name="ReceiveSmsResult" type="xs:string" minOccurs="0" nillable="true"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
              &lt;complexType name="ReceiveSms"&gt;
                  &lt;sequence&gt;
                      &lt;element name="Sms_1" type="s0:ResponseArray" minOccurs="0" nillable="true"/&gt;
                  &lt;/sequence&gt;
              &lt;/complexType&gt;
              &lt;element name="ReceiveSms" type="tns:ReceiveSms"/&gt;
              &lt;element name="ReceiveSmsResponse" type="tns:ReceiveSmsResponse"/&gt;
          &lt;/schema&gt;
      &lt;/types&gt;
      &lt;message name="ReceiveSms"&gt;
          &lt;part name="ReceiveSms" element="tns:ReceiveSms"/&gt;
      &lt;/message&gt;
      &lt;message name="ReceiveSmsResponse"&gt;
          &lt;part name="ReceiveSmsResponse" element="tns:ReceiveSmsResponse"/&gt;
      &lt;/message&gt;
      &lt;service name="ReceiverService"&gt;
          &lt;port name="Application" binding="tns:Application"&gt;
              &lt;address location="http://localhost:8000/sms/receive/"/&gt;
          &lt;/port&gt;
      &lt;/service&gt;
      &lt;portType name="Application"&gt;
          &lt;operation name="ReceiveSms" parameterOrder="ReceiveSms"&gt;
              &lt;input name="ReceiveSms" message="tns:ReceiveSms"/&gt;
              &lt;output name="ReceiveSmsResponse" message="tns:ReceiveSmsResponse"/&gt;
          &lt;/operation&gt;
      &lt;/portType&gt;
      &lt;binding name="Application" type="tns:Application"&gt;
          &lt;binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
          &lt;operation name="ReceiveSms"&gt;
              &lt;operation soapAction="ReceiveSms" style="document"/&gt;
              &lt;input name="ReceiveSms"&gt;
                  &lt;body use="literal"/&gt;
              &lt;/input&gt;
              &lt;output name="ReceiveSmsResponse"&gt;
                  &lt;body use="literal"/&gt;
              &lt;/output&gt;
          &lt;/operation&gt;
      &lt;/binding&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>class ReceiverService(ServiceBase):
      @srpc(Array(Response), _returns=Unicode)
      def ReceiveSms(Sms_1):
          print Sms_1
          return Sms_1
  
  
  application = Application([ReceiverService],
      tns='spyne.examples.hello',
      in_protocol=Soap11(validator='lxml'),
      out_protocol=Soap11()
      )
  
  hello_app = csrf_exempt(DjangoApplication(application))
  </code></pre>
  
  <p>XML RESPONSE:</p>
  
  <pre><code>&lt;?xml version='1.0' encoding='UTF-8'?&gt;
  &lt;senv:Envelope 
      xmlns:senv="http://schemas.xmlsoap.org/soap/envelope/"&gt;
      &lt;senv:Body&gt;
          &lt;senv:Fault&gt;
              &lt;faultcode&gt;senv:Client.SchemaValidationError&lt;/faultcode&gt;
              &lt;faultstring&gt;&amp;lt;string&amp;gt;:2:0:ERROR:SCHEMASV:SCHEMAV_CVC_ELT_1: Element '{http://localhost:8000/types/}receiveSms': No matching global declaration available for the validation root.&lt;/faultstring&gt;
              &lt;faultactor&gt;&lt;/faultactor&gt;
          &lt;/senv:Fault&gt;
      &lt;/senv:Body&gt;
  &lt;/senv:Envelope&gt;
  </code></pre>