hai all,

i am working on shopping cart project, i need globalpay integration . i got the sample code and run in my localhost it shows me error this.

Warning: SoapClient::__construct() [function.SoapClient---construct]: I/O warning : failed to load external entity "" in C:\wamp\www\exampls\PHP Web Service Sample (Credit Card) 4.0.0\PHP Web Service Sample (Credit Card) 4.0.0\globalpay.inc.php on line 36

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't load from '' in C:\wamp\www\exampls\PHP Web Service Sample (Credit Card) 4.0.0\PHP Web Service Sample (Credit Card) 4.0.0\globalpay.inc.php:36 Stack trace: #0 C:\wamp\www\exampls\PHP Web Service Sample (Credit Card) 4.0.0\PHP Web Service Sample (Credit Card) 4.0.0\globalpay.inc.php(36): SoapClient->__construct('https://certapi...') #1 C:\wamp\www\exampls\PHP Web Service Sample (Credit Card) 4.0.0\PHP Web Service Sample (Credit Card) 4.0.0\globalpay.inc.php(143): sendCreditCardRequest('YOUR_USERNAME', 'YOUR_PASSWORD', 'Sale', '400300012345678...', '1215', '', 'John Doe', '1.00', '', '', '30329', '123 Corporate S...', '123', '') #2 C:\wamp\www\exampls\PHP Web Service Sample (Credit Card) 4.0.0\PHP Web Service Sample (Credit Card) 4.0.0\globalpay.inc.php(150): showCreditCardSaleResponse() #3 {main} thrown in C:\wamp\www\exampls\PHP Web Service Sample (Credit Card) 4.0.0\PHP Web Service Sample (Credit Card) 4.0.0\globalpay.inc.php on line 36

i enabled soap server in php.ini.

can any have the idea about this error please help.
thanxs,

Dani AI

Generated

Brief summary and practical checklist for (and anyone hitting the same problem)

The behaviour described (SOAP initially failing to load a WSDL over HTTPS, then — after enabling SOAP — seeing an SSL/TLS protocol error) points to an HTTPS handshake or certificate-chain problem rather than a SOAP API bug. Typical root causes are: the PHP build lacks usable OpenSSL support, PHP cannot validate the remote certificate (no CA bundle configured), a proxy/firewall is blocking or rewriting TLS, or a TLS version/cipher mismatch between client and server. See how SoapClient consumes a WSDL and accepts a stream context for TLS options. PHP SoapClient manual.

Checklist — run these in order

  • Confirm OpenSSL is present and active in the same PHP used by Apache (check phpinfo()). If OpenSSL is missing or disabled, enable the extension in php.ini and restart the server. PHP OpenSSL installation / phpinfo guidance (also use phpinfo() to verify).

  • Verify the WSDL is reachable from the machine running PHP. Use a browser, curl, or OpenSSL’s diagnostic client to inspect the TLS handshake and certificate chain; that will show protocol version and any certificate errors. Examples: curl https://... or openssl s_client -connect host:443 -servername host. OpenSSL s_client docs.

  • If certificate verification fails, provide PHP with a CA bundle (cacert.pem). The official Mozilla-derived bundle is available from the cURL CA extract page; point PHP’s OpenSSL/cURL settings at it (openssl.cafile / curl.cainfo) or supply it per-request. Download cacert.pem and OpenSSL/php.ini settings.

  • Force a modern TLS method or control verification via a stream context passed to SoapClient. Example pattern (adjust paths and constants for the PHP/OpenSSL version in use):

$opts = [
  'ssl' => [
    'verify_peer'       => true,
    'verify_peer_name'  => true,
    'cafile'            => 'C:\\wamp\\php\\extras\\ssl\\cacert.pem',
    'crypto_method'     => STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT,
  ],
];
$context = stream_context_create($opts);
$client = new SoapClient('https://your-wsdl-url?wsdl', ['stream_context' => $context, 'trace' => 1]);

(See PHP’s SSL context options and the SoapClient stream_context option.) SSL context options · SoapClient options.

Notes and cautions

  • Do not disable peer verification (verify_peer = false) in production — it defeats TLS security.
  • If the remote server requires TLS 1.2+/specific ciphers and the local OpenSSL is too old, upgrade PHP/OpenSSL or use an environment that supports modern TLS.
  • A quick fallback for debugging: download the WSDL locally and point SoapClient at the file (watch out for remote schema imports). If problems persist, the most useful diagnostics are the phpinfo() output (PHP and OpenSSL versions), the client-side curl/openssl s_client output, and whether a corporate proxy/firewall is present.

hai all,

I solved half of problem by changing settings in pph.ini file.

but i am geting one problem

Warning: SoapClient::__construct() [function.SoapClient---construct]: SSL: fatal protocol error in C:\wamp\www\exampls\PHP Web Service Sample (Credit Card) 4.0.0\PHP Web Service Sample (Credit Card) 4.0.0\globalpay.inc.php on line 37

do you have any idea please help me.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.