Warning: SoapClient::SoapClient(http://www.w3.org/2005/05/xmlmime): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required <p>I have simple script connection call using PHP 5.2.10 to a Web service working with SOAP 1.2. </p> <p>The same PHP installation is able to connect via Web service to another web server working with SOAP 1.1 without issues. In addition, the web services using 1.2 is working fine with another two servers using almost the same hard code.</p> <p>However, every time I am using SOAP 1.2 on this server with PHP 5.2.10 I got the bellow error if I run the script from a batch file:</p> <pre><code>Warning: SoapClient::SoapClient(http://www.w3.org/2005/05/xmlmime): failed to open stream: HTTP request failed! HTTP/1.1 401 Authorization Required in C: \NewSimpleConnectionTest.php on line 10 </code></pre> <p>If the script is running via Eclipse PHP with PHP 5.2 on a different computer, it does not have any error so the hard code seems fine, user and password are correct too because it is used on the others servers and on the Eclipse test:</p> <p>My script is this: </p> <pre><code>&lt;?php $_endpoint = "http://server:8080/serverv/ServerAPI"; $_username = "userServer"; $_password = "123ABC!"; try { $client = new SoapClient($_endpoint."?WSDL", array('location' =&gt; $_endpoint, 'login' =&gt; $_username, 'password' =&gt; $_password, 'trace' =&gt; 1, 'features' =&gt; SOAP_USE_XSI_ARRAY_TYPE + SOAP_SINGLE_ELEMENT_ARRAYS, 'soap_version' =&gt; SOAP_1_2)); echo 'Connected to Web Services.'; }catch(Exception $e){ echo 'Failure to connect to WebServices.'; } ?&gt; </code></pre> <p>This is the information in the SOAP and XML phpinfo.</p> <pre><code>SimpleXML Simplexml support =&gt; enabled Revision =&gt; $Revision: 1.151.2.22.2.46 $ Schema support =&gt; enabled soap Soap Client =&gt; enabled Soap Server =&gt; enabled Directive =&gt; Local Value =&gt; Master Value soap.wsdl_cache =&gt; 1 =&gt; 1 soap.wsdl_cache_dir =&gt; /tmp =&gt; /tmp soap.wsdl_cache_enabled =&gt; 1 =&gt; 1 soap.wsdl_cache_limit =&gt; 5 =&gt; 5 soap.wsdl_cache_ttl =&gt; 86400 =&gt; 86400 </code></pre> <p>Any idea about what is missing or the problem on this PHP version to work with SOAP 1.2 in that server?</p> <p>Thanks in advance!!</p>