PHPackages                             sourcetoad/soapy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. sourcetoad/soapy

ActiveLibrary[API Development](/categories/api)

sourcetoad/soapy
================

A Soap Client built for Laravel.

v3.1.0(1y ago)1294.4k—1.7%1[1 issues](https://github.com/sourcetoad/Soapy/issues)2MITPHPPHP ^8.2||^8.3||^8.4CI passing

Since Nov 26Pushed 1mo ago19 watchersCompare

[ Source](https://github.com/sourcetoad/Soapy)[ Packagist](https://packagist.org/packages/sourcetoad/soapy)[ RSS](/packages/sourcetoad-soapy/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (6)Dependencies (4)Versions (13)Used By (2)

Soapy
-----

[](#soapy)

SOAP is old, but still used. Soapy is modern, but feature limited to fit our use cases.
Heavily inspired by [artisaninweb/laravel-soap](https://github.com/artisaninweb/laravel-soap).

### Install

[](#install)

This package is currently supporting Laravel 11.x and 12.x.

```
composer require sourcetoad/soapy
```

This package will use Laravel Auto Discovery to automatically register the Service Provider.

### Documentation

[](#documentation)

### Options

[](#options)

- **wsdl** - Location to flat file or URL for WSDL.
- **trace** - Whether to expose internal methods on SoapClient.
- **cache** - Flag to use for WSDL cache.
- **location** - Override URL to use for SOAP Requests.
- **uri** - Override namespace to use for SOAP Requests.
- **certificate** - Certificate path for authentication with Server.
- **options** - Array of any settings from [SoapClient#options](https://www.php.net/manual/en/soapclient.soapclient.php#options)
- **classmap** - Array of class maps to map objects -&gt; classes.
- **typemap** - Array of type maps. (Documentation WIP)

#### Example (Class maps)

[](#example-class-maps)

Creating a client and making a request with class maps.

```
$this->client = SoapyFacade::create(function (SoapyCurtain $curtain) {
    return $curtain
        ->setWsdl('https://example.org?wsdl')
        ->setTrace(true)
        ->setOptions([
            'encoding' => 'UTF-8'
        ])
        ->setClassMap([
            'Foo' => Foo::class,
            'FooResponse' => FooResponse::class
        ])
        ->setCache(WSDL_CACHE_MEMORY)
        ->setLocation('https://example.org');
});
```

Presuming you had XML for the expected request like this.

```

    Connor
    true

```

You could produce a matching class to resemble that data.

```
