Download the PHP package camcima/camcima-soap-client without Composer

On this page you can find all versions of the php package camcima/camcima-soap-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package camcima-soap-client

camcima PHP SOAP Client

Overview

This is my attempt to address the shortcommings of the native PHP SOAP Client implementation (\SoapClient).

Usage

Instantiate

The default value of sslVerifyPeer is true, which means that SSL certificate will be verified. If WSDL file is hosted on a server that has an invalid SSL certificate or self-signed certificate, set sslVerifyPeer to false.

cURL Options

This wrapper uses cURL to issue the HTTP requests. It's possible to customize the SOAP request using cURL options.

There are a few cURL options, however, that can't be overwritten as they are essential for the wrapper:

To get the cURL options currently in use:

Use Proxy

If you need to proxy the requests (e.g. debugging), you can use this method to set the proxy host, port and type:

The default hostname, port and type for this methods are localhost, 8888 and CURLPROXY_HTTP, which is the default binding for Fiddler Web Debugging Proxy (http://fiddler2.com/).

Proxy Auth

If your proxy need auth, you can use this method to set proxy username and password:

Authentication

In order to use HTTP Authentication, use SoapClient original login and password options. The cURL client will get it from there.

User Agent

It's possible to customize the User Agent used by the client:

Lower Cased Initial Character

When I was developing an integration with a .NET based web-service, I've noticed the name of the root element of the SOAP request payload always had the first letter lowercased. This didn't hold true for the other inner elements which had always the first letter uppercased, common for class names. I don't know if this is the norm for .NET web-services but, in any case, I've implemented an option that handles this.

The default for this setting is false.

Keep Null Properties

When you pass an object as a SOAP parameter, some of its properties could be null (or not set). The default behavior for this client is to omit these null properties when sending the request. If you need to send all properties, even when null, use this:

The default for this setting is true.

Debug

In order to debug requests and responses, you need to set the debug mode to true and the debug file name and path.

Last Request Communication Log

You can get the HTTP communication log (request and response) from the last request.

Result Class Mapping

PHP native implementation of SOAP client has the ability to map the SOAP return to local classes. Unfortunately it didn't work for me as expected. So I've implemented my own version of result class mapping.

It works in two different flavors:

Using Classmap

You have to build an associative array with the result elements as keys, and the corresponding local classes as values.

The native SOAP client returns all objects as Standard Classes (StdClass) and my mapping function "casts" them to the mapped local classes. This functions is based on the property name that holds the standard class object. This works pretty well in most scenarios, but when there is an array of objects, it needs a special config:

The name of the property which holds the array serves as the marker for the mapping. You also need to prefix this element name with array and use pipe (|) to separate them.

If we get array of simple type like

we need mapping to array, so it will extract data from item attribute (doesn't require SOAP_SINGLE_ELEMENT_ARRAYS feature in SoapClient)

Using Namespace

If all your result classes reside in the same namespace, there is no need to map them individually. You can tell the mapper the namespace your classes live and it will automatically determine the mapping by matching the SOAP result names with the local class names.

Skip Root Object

Sometimes, the webservice will return an object with only one property, so it doesn't make a lot of sense to create a wrapper object just for that. In that case, you can use the skipRootObject parameter in the mapSoapResult method to skip the root object and return the inner property instead.

Improvements

I plan to include new features according to my needs. If you need a special feature you have two options:


All versions of camcima-soap-client with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
lib-curl Version *
ext-libxml Version *
ext-soap Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package camcima/camcima-soap-client contains the following files

Loading the files please wait ....