inteleon/soap-client

Inteleon Soap Client

v1.0.3 2015-02-02 17:23 UTC

This package is not auto-updated.

Last update: 2024-04-13 14:13:13 UTC


README

Extends the native PHP Soap Client with some more options. The class uses cURL to make the requests.

Installation

Run: composer require inteleon/soap-client

How to use

The usage is the same as the native SoapClient class.

Options

Timeouts (milliseconds)

$client->setTimeout(30000); //The maximum number of milliseconds to execute.
$client->setConnectTimeout(30000); //The number of milliseconds to wait while trying to connect.

Connect attempts

$client->setConnectAttempts(2); //Number of connect attempts if connection fails

Verify SSL certificate

$client->setVerifyCertificate(true); //Verify the SSL certificate. WARNING: Turning off CURLOPT_SSL_VERIFYPEER allows man in the middle (MITM) attacks, which you don't want!

HTTP user agent

$client->setUserAgent('Foo');

Custom cURL option

$client->setCurlOption(CURLOPT_XXX, ''); //See http://php.net/manual/en/function.curl-setopt.php

Todo

  • Ability to set timeouts/options on the WSDL fetching. As the native SoapClient seems to do this in the constructor it is hard to overwrite it.
  • More and better tests