title: WSDL XSD and soappy
body: <p>I have the following WSDL and XSD</p>
  
  <pre><code>from SOAPpy import WSDL
  import os
  
  # you'll need to configure these two values;
  # see http://www.google.com/apis/
  WSDLFILE = os.path.join(os.path.dirname(__file__), "getiwsAesPayment.wsdl") 
  
  _server = WSDL.Proxy(WSDLFILE)
  
  
  print _server
  </code></pre>
  
  <p>Which gives me the error:</p>
  
  <pre><code>   schema.load(reader)
    File "/home/gregory/.virtualenvs/casadeal/src/soappy/SOAPpy/wstools/XMLSchema.py", line 1205, in load
      tp.fromDom(childNode)
    File "/home/gregory/.virtualenvs/casadeal/src/soappy/SOAPpy/wstools/XMLSchema.py", line 1322, in fromDom
      raise SchemaError, 'namespace of schema and import match'
  SOAPpy.wstools.XMLSchema.SchemaError: namespace of schema and import match
  </code></pre>
  
  <p>Apparently it may come from the fact that the targetNamespace are the same for wsdl and xsd ?</p>
  
  <p>WSDL</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;definitions name="getiwsAesPayment" targetNamespace="http://ws.AMANTY.m2t.biz/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.AMANTY.m2t.biz/" xmlns="http://schemas.xmlsoap.org/wsdl/"&gt;
    &lt;types&gt;
      &lt;xsd:schema&gt;
        &lt;xsd:import namespace="http://ws.AMANTY.m2t.biz/" schemaLocation="getiwsAesPayment.xsd"/&gt;
      &lt;/xsd:schema&gt;
    &lt;/types&gt;
    &lt;message name="getiwsaespayment"&gt;
      &lt;part name="parameters" element="tns:getiwsaespayment"&gt;
      &lt;/part&gt;
    &lt;/message&gt;
    &lt;message name="getiwsaespaymentResponse"&gt;
      &lt;part name="parameters" element="tns:getiwsaespaymentResponse"&gt;
      &lt;/part&gt;
    &lt;/message&gt;
    &lt;portType name="getiwsAesPayment"&gt;
      &lt;operation name="getiwsaespayment"&gt;
        &lt;input message="tns:getiwsaespayment"&gt;
      &lt;/input&gt;
        &lt;output message="tns:getiwsaespaymentResponse"&gt;
      &lt;/output&gt;
      &lt;/operation&gt;
    &lt;/portType&gt;
    &lt;binding name="getiwsAesPaymentPortBinding" type="tns:getiwsAesPayment"&gt;
      &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/&gt;
      &lt;operation name="getiwsaespayment"&gt;
        &lt;soap:operation soapAction=""/&gt;
        &lt;input&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/input&gt;
        &lt;output&gt;
          &lt;soap:body use="literal"/&gt;
        &lt;/output&gt;
      &lt;/operation&gt;
    &lt;/binding&gt;
    &lt;service name="getiwsAesPaymentService"&gt;
      &lt;port name="getiwsAesPaymentPort" binding="tns:getiwsAesPaymentPortBinding"&gt;
        &lt;soap:address location="http://partner.ma:8080/AMANTYWebServicesWAR/getiwsAesPayment"/&gt;
      &lt;/port&gt;
    &lt;/service&gt;
  &lt;/definitions&gt;
  </code></pre>
  
  <p>XSD</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;xs:schema version="1.0" targetNamespace="http://ws.AMANTY.m2t.biz/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.AMANTY.m2t.biz/"&gt;
  
    &lt;xs:element name="commandReg" type="tns:commandReg"/&gt;
  
     .......
     &lt;/xs:schema&gt;
  </code></pre>