title: SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://schemas.xmlsoap.org/ws/2004/09/policy' in PHP SoapClient while calling SAP PI
body: <p>I'm trying to implement a Web Service running on an SAP PI system. The WSDL I got looks like this:</p>
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;wsdl:definitions name=&quot;request_SO&quot; targetNamespace=&quot;http://company.ch/orstest/jason_test&quot; xmlns:p1=&quot;http://company.ch/orstest/jason_test&quot; xmlns:wsp=&quot;http://schemas.xmlsoap.org/ws/2004/09/policy&quot; xmlns:wsu=&quot;http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd&quot; xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;&gt;
    &lt;wsdl:documentation /&gt;
    &lt;wsp:UsingPolicy wsdl:required=&quot;true&quot; /&gt;
    &lt;wsp:Policy wsu:Id=&quot;OP_request_SO&quot; /&gt;
    &lt;wsdl:types&gt;
      &lt;xsd:schema targetNamespace=&quot;http://company.ch/orstest/jason_test&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;http://company.ch/orstest/jason_test&quot;&gt;
        &lt;xsd:element name=&quot;request&quot; type=&quot;request&quot; /&gt;
        &lt;xsd:element name=&quot;response&quot; type=&quot;response&quot; /&gt;
        &lt;xsd:complexType name=&quot;request&quot;&gt;
          &lt;xsd:annotation&gt;
            &lt;xsd:appinfo source=&quot;http://sap.com/xi/VersionID&quot;&gt;a8b7948ac2e211e2b2380000001f0d6a&lt;/xsd:appinfo&gt;
          &lt;/xsd:annotation&gt;
          &lt;xsd:sequence&gt;
            &lt;xsd:element name=&quot;body&quot; type=&quot;xsd:string&quot; /&gt;
          &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
        &lt;xsd:complexType name=&quot;response&quot;&gt;
          &lt;xsd:annotation&gt;
            &lt;xsd:appinfo source=&quot;http://sap.com/xi/VersionID&quot;&gt;bf49af09c36c11e299790000001f0d6a&lt;/xsd:appinfo&gt;
          &lt;/xsd:annotation&gt;
          &lt;xsd:sequence&gt;
            &lt;xsd:element name=&quot;body&quot; type=&quot;xsd:string&quot; /&gt;
          &lt;/xsd:sequence&gt;
        &lt;/xsd:complexType&gt;
      &lt;/xsd:schema&gt;
    &lt;/wsdl:types&gt;
    &lt;wsdl:message name=&quot;request&quot;&gt;
      &lt;wsdl:documentation /&gt;
      &lt;wsdl:part name=&quot;request&quot; element=&quot;p1:request&quot; /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:message name=&quot;response&quot;&gt;
      &lt;wsdl:documentation /&gt;
      &lt;wsdl:part name=&quot;response&quot; element=&quot;p1:response&quot; /&gt;
    &lt;/wsdl:message&gt;
    &lt;wsdl:portType name=&quot;request_SO&quot;&gt;
      &lt;wsdl:documentation /&gt;
      &lt;wsdl:operation name=&quot;request_SO&quot;&gt;
        &lt;wsdl:documentation /&gt;
        &lt;wsp:Policy&gt;
          &lt;wsp:PolicyReference URI=&quot;#OP_request_SO&quot; /&gt;
        &lt;/wsp:Policy&gt;
        &lt;wsdl:input message=&quot;p1:request&quot; /&gt;
        &lt;wsdl:output message=&quot;p1:response&quot; /&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:portType&gt;
    &lt;wsdl:binding name=&quot;request_SOBinding&quot; type=&quot;p1:request_SO&quot;&gt;
      &lt;soap:binding style=&quot;document&quot; transport=&quot;http://schemas.xmlsoap.org/soap/http&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; /&gt;
      &lt;wsdl:operation name=&quot;request_SO&quot;&gt;
        &lt;soap:operation soapAction=&quot;http://sap.com/xi/WebService/soap1.1&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; /&gt;
        &lt;wsdl:input&gt;
          &lt;soap:body use=&quot;literal&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; /&gt;
        &lt;/wsdl:input&gt;
        &lt;wsdl:output&gt;
          &lt;soap:body use=&quot;literal&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; /&gt;
        &lt;/wsdl:output&gt;
      &lt;/wsdl:operation&gt;
    &lt;/wsdl:binding&gt;
    &lt;wsdl:service name=&quot;request_SOService&quot;&gt;
      &lt;wsdl:port name=&quot;HTTP_Port&quot; binding=&quot;p1:request_SOBinding&quot;&gt;
        &lt;soap:address location=&quot;http://qa1100ap601.company.car.web:50000/XISOAPAdapter/MessageServlet?senderParty=&amp;amp;senderService=BS_ORS&amp;amp;receiverParty=&amp;amp;receiverService=&amp;amp;interface=request_SO&amp;amp;interfaceNamespace=http://company.ch/orstest/jason_test&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; /&gt;
      &lt;/wsdl:port&gt;
      &lt;wsdl:port name=&quot;HTTPS_Port&quot; binding=&quot;p1:request_SOBinding&quot;&gt;
        &lt;soap:address location=&quot;https://qas.soa.subcompany.company.ch/XISOAPAdapter/MessageServlet?senderParty=&amp;amp;senderService=BS_ORS&amp;amp;receiverParty=&amp;amp;receiverService=&amp;amp;interface=request_SO&amp;amp;interfaceNamespace=http://company.ch/orstest/jason_test&quot; xmlns:soap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; /&gt;
      &lt;/wsdl:port&gt;
    &lt;/wsdl:service&gt;
  &lt;/wsdl:definitions&gt;
  </code></pre>
  <p>My PHP file looks like this (nothing more in it currently):</p>
  <pre class="lang-php prettyprint-override"><code>&lt;?php 
  $client = new SoapClient('test.wsdl');
  ?&gt;
  </code></pre>
  <p>When I'm running my script, I get the following error thrown:</p>
  <blockquote>
  <p>Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Unknown required WSDL extension 'http://schemas.xmlsoap.org/ws/2004/09/policy' in /srv/www/htdocs/wsdl.php:2 Stack trace: #0 /srv/www/htdocs/wsdl.php(2): SoapClient-&gt;SoapClient('test.wsdl') #1 {main} thrown in /srv/www/htdocs/wsdl.php on line 2</p>
  </blockquote>
  <p>I tried searching for the error on Google and Stack Overflow, and also checked the comments on php.net, but I can't seem to figure out what I'd have to change in order to get this service running. I also tried to open the WSDL extension URL, it seems to exist.</p>
  <p>Can someone throw me a bone here? I tried removing the extension URL, that results in the following error:</p>
  <blockquote>
  <p>Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Unexpected WSDL element  in /srv/www/htdocs/wsdl.php:2 Stack trace: #0 /srv/www/htdocs/wsdl.php(2): SoapClient-&gt;SoapClient('test.wsdl') #1 {main} thrown in /srv/www/htdocs/wsdl.php on line 2</p>
  </blockquote>