Viewed   559 times

This works fine on my WAMP server, but doesn't work on the linux master server!?

    $client = new SoapClient('', ['trace' => true]);
    $result = $client->checkVat([
        'countryCode' => 'DK',
        'vatNumber' => '47458714'
catch(Exception $e){
    echo $e->getMessage();

What am I missing here?! :(

SOAP is enabled


SOAP-ERROR: Parsing WSDL: Couldn't load from '' : failed to load external entity ""/taxation_customs/vies/checkVatService.wsdl"

Call the URL from PHP

Calling the URL from PHP returns error

$wsdl = file_get_contents('');
echo $wsdl;


Warning:  file_get_contents( failed to open stream: HTTP request failed! HTTP/1.0 503 Service Unavailable

Call the URL from command line

Calling the URL from the linux command line HTTP 200 is returned with a XML response




For some versions of php, the SoapClient does not send http user agent information. What php versions do you have on the server vs your local WAMP?

Try to set the user agent explicitly, using a context stream as follows:

try {
    $opts = array(
        'http' => array(
            'user_agent' => 'PHPSoapClient'
    $context = stream_context_create($opts);

    $wsdlUrl = '';
    $soapClientOptions = array(
        'stream_context' => $context,
        'cache_wsdl' => WSDL_CACHE_NONE

    $client = new SoapClient($wsdlUrl, $soapClientOptions);

    $checkVatParameters = array(
        'countryCode' => 'DK',
        'vatNumber' => '47458714'

    $result = $client->checkVat($checkVatParameters);
catch(Exception $e) {
    echo $e->getMessage();


It actually seems to be some issues with the web service you are using. The combination of HTTP over IPv6, and missing HTTP User Agent string, seems to give the web service problems.

To verify this, try the following on your linux host:

curl  -A ''  -6

this IPv6 request fails.

curl  -A 'cURL User Agent'  -6

this IPv6 request succeeds.

curl  -A ''  -4
curl  -A 'cURL User Agent'  -4

both these IPv4 request succeeds.

Interesting case :) I guess your linux host resolves to its IPv6 address, and that your version of SoapClient did not add a user agent string by default.

Wednesday, October 12, 2022

Some gochas that I only found through trial and error are some configuration issues, on the server that is running the reporting server service, make sure that in your file rsreportserver.config has been modified to allow for basic authentication. By default, if I'm understanding it correctly, it wants a more trustworthy connection type, but the sdk needs you to allow simple name and passwords to be passed. This means that needs to be added to your authentication methods in the configuration.

so for example,

In C:Program FilesMicrosoft SQL ServerMSRS11.1Reporting ServicesReportServerrsreportserver.config (Different for server and version, but you get the idea.)

        <RSWindowsBasic/> ##you need to add this one##

IIRC you will have to restart the service for this to take effect.

Also, if you are attempting to RenderAs, some of the template files used to pop the headers have space in them towards the bottom that will prevent you from rendering as Excel, PDF, ect unless that has been fixed since I worked on it.

I'm looking through the code you provided, I may be reading it wrong, but it looks like you are trying to explicitly define the report you're after in the execution url. If that is in fact what you are doing, I believe the fix would be to only define the report base you are connecting to so for your example the url should be After that connection is made, you would use the LoadReport2 function to specify which report you need.

Lastly, Where you have the name of the report, it looks like you have a subdirectory called testfolder? if that is still the case, you would need your report name to be "/TestFolder/testClaimHdr" in the call to LoadReport2.

Hope any of that helps.

Wednesday, August 10, 2022

Have you tried SoapClient which is already built into PHP?

There is one tutorial: PHP - Soap Client calling .NET Web service

Here is another one, even though it was created for zend developers it should work fine.

Monday, September 5, 2022

Don't run the XML through SOAPVar, and take advantage of the WSDL option of your web service if you can:


$client = new SOAPClient(
        'location' => 'http://webserviceurl.asmx',
        'trace' => 1,
        'style' => SOAP_RPC,
        'use' => SOAP_ENCODED,

$request = '<item xmlns="rmsItem">

$result = array();

$params = array("infoRequestXml" => $request);

try {
    $result = $client->__soapCall('getAllInfo', array("parameters"=>$params));
} catch (SoapFault $e) {
    echo "SOAP Fault: ".$e->getMessage()."<br />n";

echo "<pre>";
echo htmlspecialchars($client->__getLastRequestHeaders())."n";
echo htmlspecialchars($client->__getLastRequest())."n";
echo "Response:n".htmlspecialchars($client->__getLastResponseHeaders())."n";
echo htmlspecialchars($client->__getLastResponse())."n";
echo "</pre>"; 


Monday, November 28, 2022

The trouble was solved. In fact when I had so errors using WAMP(orange icon) I decided to set it up again.

So I installed the newest version of WAMP but there was no the same php.ini as I used previously and in fact the trouble was that on the php.ini I had to make active the line ;extension=php_openssl.dll

so I just removed the ;character and this line has become like extension=php_openssl.dll

Now it works fine.

Wednesday, August 24, 2022
Only authorized users can answer the search term. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :