You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+15-9Lines changed: 15 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -7,31 +7,37 @@ The latest version 1.x is not backwards-compatible.
7
7
It is necessary to update scripts to function properly with the new version.
8
8
```
9
9
10
+
Use [v1.2.0](https://github.com/softlayer/softlayer-api-php-client/releases/tag/v1.2) for older PHP versions. [v2.0.0](https://github.com/softlayer/softlayer-api-php-client/releases/tag/v2.0.0) for php 8.1 or higher.
11
+
12
+
[PHP 8.0 removed XMLRPC](https://php.watch/versions/8.0/xmlrpc) as a built in extension. As such, it is no longer required as part of the composer file in this project. The XmlRpcClient still exists here if you need it, but we assume most users are using the SoapClient. If there are any issues with this [Let us know on github](https://github.com/softlayer/softlayer-api-php-client/issues)
13
+
10
14
## Overview
11
15
12
16
The SoftLayer API PHP client classes provide a simple method for connecting to and making calls from the SoftLayer API and provides support for many of the SoftLayer API's features. Method calls and client management are handled by the PHP SOAP and XML-RPC extensions.
13
17
14
-
Making API calls using the `\SoftLayer\SoapClient`or `\SoftLayer\XmlRpcClient` classes is done in the following steps:
18
+
Making API calls using the `\SoftLayer\SoapClient` is done in the following steps:
15
19
16
-
1. Instantiate a new `\SoftLayer\SoapClient` or `\SoftLayer\XmlRpcClient` object using the `\SoftLayer\SoapClient::getClient()` or `\SoftLayer\XmlRpcClient::getClient()` methods. Provide the name of the service that you wish to query, an optional id number of the object that you wish to instantiate, your SoftLayer API username, your SoftLayer API key, and an optional API endpoint base URL. The client classes default to connect over the public Internet. Enter `\SoftLayer\SoapClient::API_PRIVATE_ENDPOINT` or `\SoftLayer\XmlRpcClient::API_PRIVATE_ENDPOINT` to connect to the API over SoftLayer's private network. The system making API calls must be connected to SoftLayer's private network (eg. purchased from SoftLayer or connected via VPN) in order to use the private network API endpoints.
17
-
2. Define and add optional headers to the client, such as object masks and result limits.
18
-
3. Call the API method you wish to call as if it were local to your client object. This class throws exceptions if it's unable to execute a query, so it's best to place API method calls in try / catch statements for proper error handling.
20
+
1. Instantiate a new `\SoftLayer\SoapClient` object using the `\SoftLayer\SoapClient::getClient()` method. Provide the name of the service that you wish to query, an optional id number of the object that you wish to instantiate, your SoftLayer API username, your SoftLayer API key, and an optional API endpoint base URL. The client classes default to connect over the public Internet.
21
+
2. Use `\SoftLayer\SoapClient::API_PRIVATE_ENDPOINT` to connect to the API over SoftLayer's private network. The system making API calls must be connected to SoftLayer's private network (eg. purchased from SoftLayer or connected via VPN) in order to use the private network API endpoints.
22
+
3. Define and add optional headers to the client, such as object masks and result limits.
23
+
4. Call the API method you wish to call as if it were local to your client object. This class throws exceptions if it's unable to execute a query, so it's best to place API method calls in try / catch statements for proper error handling.
19
24
20
25
Once your method is executed you may continue using the same client if you need to connect to the same service or define another client object if you wish to work with multiple services at once.
21
26
22
-
The most up to date version of this library can be found on the SoftLayer github public repositories: [http://github.com/softlayer/](http://github.com/softlayer/) . Please post to the SoftLayer forums [Stack Overflow](https://stackoverflow.com) or open a support ticket in the SoftLayer customer portal if you have any questions regarding use of this library. If you use Stack Overflow please tag your posts with “SoftLayer” so our team can easily find your post.
27
+
The most up to date version of this library can be found on the SoftLayer github public repositories: [https://github.com/softlayer/softlayer-api-php-client](https://github.com/softlayer/softlayer-api-php-client) . Any issues using this library, please open a [Github Issue](https://github.com/softlayer/softlayer-api-php-client/issues)
23
28
24
29
## System Requirements
25
30
26
-
The `\SoftLayer\SoapClient` class requires at least PHP 5.3.0 and the PHP SOAP enxtension installed. The `\SoftLayer\XmlRpcClient` class requires PHP at least PHP 5 and the PHP XML-RPC extension installed.
31
+
The `\SoftLayer\SoapClient` class requires at least PHP 8.0.0 and the PHP SOAP enxtension installed and enabled (`extension=soap` in the php.ini file).
32
+
Since [php 8.0 has removed xmlrpc extension](https://php.watch/versions/8.0/xmlrpc) you will need to manually install this library to use the `\SoftLayer\XmlRpcClient`. If you are using an earlier version of php that still includes ext-xml, please use v1.2.0 of this library.
27
33
28
-
A valid API username and key are required to call the SoftLayer API. A connection to the SoftLayer private network is required to connect to SoftLayer's private network API endpopints.
34
+
A valid API username and key are required to call the SoftLayer API. A connection to the SoftLayer private network is required to connect to SoftLayer's private network API endpopints. See [Authenticating to the SoftLayer API](https://sldn.softlayer.com/article/authenticating-softlayer-api/) for how to get these API keys.
29
35
30
36
## Installation
31
37
32
38
Install the SoftLayer API client using [Composer](https://getcomposer.org/).
thrownew \Exception('There was an error querying the SoftLayer API: ' . $e->getMessage());
203
200
}
@@ -225,9 +222,10 @@ public function __call($functionName, $arguments = null)
225
222
* @param string $username An optional API username if you wish to bypass SoapClient's built-in username.
226
223
* @param string $username An optional API key if you wish to bypass SoapClient's built-in API key.
227
224
* @param string $endpointUrl The API endpoint base URL you wish to connect to. Set this to SoapClient::API_PRIVATE_ENDPOINT to connect via SoftLayer's private network.
225
+
* @param bool $trace Enabled SOAP trace in the client object.
0 commit comments