title: PHP SoapClient __call() exception: DTD are not supported by SOAP
body: <p>This one is killing me... </p>
  
  <p>I'm learning to develop SOAP servers in PHP at the moment, and I'm running into an annoying problem and Google isn't helping much, despite plenty of hits on the problem in question...</p>
  
  <p>After instantiating the SOAP CLIENT using a what I believe to be a good WSDL, the first call to an existing function on the soap server is generating the following Exception:</p>
  
  <pre><code>SoapFault Object
  (
      [message:protected] =&gt; DTD are not supported by SOAP
      [string:private] =&gt; 
      [code:protected] =&gt; 0
      [file:protected] =&gt; /var/www/soapserver/soapServerTestClient.php
      [line:protected] =&gt; 7
      [trace:private] =&gt; Array
          (
              [0] =&gt; Array
                  (
                      [function] =&gt; __call
                      [class] =&gt; SoapClient
                      [type] =&gt; -&gt;
                      [args] =&gt; Array
                          (
                              [0] =&gt; testSoapService
                              [1] =&gt; Array
                                  (
                                      [0] =&gt; TESTSTRING
                                  )
  
                          )
  
                  )
  
              [1] =&gt; Array
                  (
                      [file] =&gt; /var/www/soapserver/soapServerTestClient.php
                      [line] =&gt; 7
                      [function] =&gt; testSoapService
                      [class] =&gt; SoapClient
                      [type] =&gt; -&gt;
                      [args] =&gt; Array
                          (
                              [0] =&gt; TESTSTRING
                          )
  
                  )
  
          )
  
      [faultstring] =&gt; DTD are not supported by SOAP
      [faultcode] =&gt; Client
      [faultcodens] =&gt; http://schemas.xmlsoap.org/soap/envelope/
  )
  </code></pre>
  
  <p>Dumping the __getLastRequest(), __getLastResponse(), __getLastRequestHeaders(), and __getLastResponseHeaders() yield completely EMPTY results, so NOTHING is actually being sent/requested it appears.</p>
  
  <p>Visiting the link to the WSDL returns the WSDL file contents as expected, and I know this works because altering the path to the WSDL returns a <code>SOAP-ERROR: Parsing WSDL: Couldn't load</code> exception, and putting it back to the actual WSDL path generates the exception above.</p>
  
  <p>the soap server code is below, but since there's no request/response I don't think it's the issue:</p>
  
  <blockquote>
    <p>function testSoapService($arg) {
        return ''.$arg.''; }</p>
    
    <p>ini_set("soap.wsdl_cache_enabled",
    "0"); // disabling WSDL cache so you
    can test wsdl changes without hassle;
    comment out when WSDL is set. $server
    = new SoapServer("");
    $server->addFunction("testSoapService");
    $server->handle();</p>
  </blockquote>
  
  <p>Searching google, a mix of people are saying it's either a bad wsdl path (don't think so in this case), or the fact that the server is returning HTML pages of the error variety (404, etc) from the webserver, which I also don't think is the case because the requests/responses are empty.</p>
  
  <p>Here's a copy of the WSDL contents, just in case it's useful:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;wsdl:types&gt;
  
      &lt;schema xmlns:rns="http://soap.jrimer-amp64/" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://soap.jrimer-amp64/" version="1.0" elementFormDefault="unqualified" attributeFormDefault="unqualified"&gt;
          &lt;complexType name="testSoapServiceRequest"&gt;
              &lt;sequence&gt;
                  &lt;element name="testKey" type="string"/&gt;
              &lt;/sequence&gt;
          &lt;/complexType&gt;
          &lt;complexType name="testSoapServiceResponse"&gt;
              &lt;sequence&gt;
                  &lt;element name="result" type="string" minOccurs="1"/&gt;
                  &lt;element name="retStatus" type="rns:returnStatus"/&gt;
              &lt;/sequence&gt;
          &lt;/complexType&gt;
          &lt;complexType name="returnStatus"&gt;
              &lt;sequence&gt;
                  &lt;element name="errorMessage" type="string" minOccurs="0"/&gt;
                  &lt;element name="errorCode" type="string" minOccurs="0"/&gt;
              &lt;/sequence&gt;
              &lt;attribute name="success" type="boolean"/&gt;
          &lt;/complexType&gt;
          &lt;element name="addRouterToCustomerAccountRequest" type="rns:addRouterToCustomerAccountRequest"/&gt;
          &lt;element name="addRouterToCustomerAccountResponse" type="rns:addRouterToCustomerAccountResponse"/&gt;
      &lt;/schema&gt;
  
  &lt;/wsdl:types&gt;
  
  
  &lt;wsdl:service name="XxxxxxSvc"&gt;
  
      &lt;wsdl:port name="XxxxxxSvc-Endpoint0" binding="tns:XxxxxxSvc-Endpoint0Binding"&gt;
          &lt;soap:address location="http://soap.jrimer-amp64"/&gt;
      &lt;/wsdl:port&gt;
  
  &lt;/wsdl:service&gt;
  
  
  &lt;wsdl:portType name="portType"&gt;
  
      &lt;wsdl:operation name="testSoapService"&gt;
          &lt;wsdl:input message="tns:testSoapServiceRequest"/&gt;
          &lt;wsdl:output message="tns:testSoapServiceResponse"/&gt;
      &lt;/wsdl:operation&gt;
  
  &lt;/wsdl:portType&gt;
  
  
  &lt;wsdl:binding name="XxxxxxSvc-Endpoint0Binding" type="tns:portType"&gt;
  
      &lt;soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /&gt;
  
      &lt;wsdl:operation name="testSoapService"&gt;
          &lt;soap:operation style="document" soapAction="http://soap.jrimer-amp64/XxxxxxSvc-SoapServer.php"/&gt;
          &lt;wsdl:input&gt;
              &lt;soap:body use="literal" parts="parameters"/&gt;
          &lt;/wsdl:input&gt;
          &lt;wsdl:output&gt;
              &lt;soap:body use="literal" parts="parameters"/&gt;
          &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
  
  &lt;/wsdl:binding&gt;
  
  
  &lt;wsdl:message name="testSoapServiceRequest"&gt;
      &lt;wsdl:part name="parameters" element="ns0:testSoapServiceRequest"/&gt;
  &lt;/wsdl:message&gt;
  
  
  &lt;wsdl:message name="testSoapServiceResponse"&gt;
      &lt;wsdl:part name="parameters" element="ns0:testSoapServiceResponse"/&gt;
  &lt;/wsdl:message&gt;
  </code></pre>
  
  <p></p>
  
  <p>Any ideas?</p>