Installation Add the package via Composer:
composer require bigfoot/ecircle-bundle:dev-master
Ensure dev-master is used, as this is the only available version.
Configuration
Add the required parameters to config/packages/bigfoot_ecircle.yaml (or app/config.yml in older Laravel versions):
bigfoot_ecircle:
client:
wsdl_url: 'http://webservices.ecircle-ag.com/soap/ecm.wsdl'
request:
account_1:
realm: 'http://your-ecircle-url.com'
user: 'your_username'
passwd: 'your_password'
First Use Case Subscribe a member by email:
use Bigfoot\Bundle\EcircleBundle\Services\BigfootEcircleClient;
$client = $container->get('bigfoot_ecircle.client');
$client->subscribeMemberByEmail('user@example.com', 123);
Service Integration
Inject BigfootEcircleClient into your services via Laravel's container:
public function __construct(BigfootEcircleClient $ecircleClient) {
$this->ecircleClient = $ecircleClient;
}
Options Classes
For complex requests, create dedicated *Options classes (e.g., SubscribeMemberByEmailOptions) in src/Bigfoot/Bundle/EcircleBundle/Options/. Mirror the Ecircle API method parameters exactly.
Session Management Ensure session initialization before calling methods:
if (!$this->ecircleClient->getSessionId()) {
$this->ecircleClient->connect();
}
Error Handling Wrap calls in try-catch blocks to handle SOAP exceptions:
try {
$this->ecircleClient->subscribeMemberByEmail($email, $groupId);
} catch (\Exception $e) {
Log::error("Ecircle error: " . $e->getMessage());
}
Member Management Use the bundle to automate member subscriptions, updates, or deletions via Ecircle’s SOAP API.
Batch Processing Loop through a collection of emails/groups and process them sequentially:
foreach ($members as $member) {
$this->ecircleClient->subscribeMemberByEmail($member->email, $member->groupId);
}
Event Triggers
Hook into Laravel events (e.g., registered) to sync users with Ecircle:
public function handle(Registered $event) {
$this->ecircleClient->subscribeMemberByEmail($event->user->email, 1);
}
Deprecated Package
Session Handling
$this->sessionId before calling methods. Uninitialized sessions throw exceptions.WSDL URL Changes
Namespace Conflicts
Options/, Services/). Customize paths in Resources/config/services.xml if needed.No Built-in Logging
$client->setDebug(true); // If available; otherwise, log manually.
SOAP Errors
ini_set('soap.wsdl_cache_enabled', '0');
Configuration Issues
realm, user, and passwd in config/packages/bigfoot_ecircle.yaml. Typos here will cause silent failures.Method Parameters
*Options classes match Ecircle’s API exactly (case-sensitive, required fields).Custom Methods
Extend BigfootEcircleClient to add unsupported Ecircle methods:
public function customMethod($param1, $param2) {
$options = new CustomMethodOptions();
$options->param1 = $param1;
// ... map other params ...
return $this->client->__soapCall('CustomMethod', [$options]);
}
Middleware Add middleware to validate Ecircle responses or retry failed requests:
$client->getKernel()->pushMiddleware(function ($event) {
if ($event->hasError()) {
// Retry logic or fallback
}
});
Testing Mock the SOAP client in tests:
$mock = $this->createMock(\SoapClient::class);
$client = new BigfootEcircleClient($mock, $config);
How can I help you explore Laravel packages today?