Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Salesforce Bundle Laravel Package

comsave/salesforce-bundle

View on GitHub
Deep Wiki
Context7

Getting Started

Install via Composer:

composer require vendor/package-name

The package now enforces the use of the new SOAP client (introduced in v3.4.5). Ensure your config/package.php (or equivalent) is updated to reflect this change. The minimal setup remains:

use Vendor\Package\Facades\SoapClient;

$client = SoapClient::create(['wsdl' => 'your_wsdl_url']);
$response = $client->call('methodName', ['args']);

First use case: Replace legacy SoapClient calls with the package’s wrapper to leverage the new client under the hood. Check the migration guide for legacy client deprecation steps.


Implementation Patterns

Forced New SOAP Client

The package now mandates the use of the new SOAP client (likely ext-soap v8+ or a custom wrapper). Update your service layer to:

  1. Inject the package’s client instead of raw SoapClient:
    public function __construct(private SoapClient $soapClient) {}
    
  2. Leverage built-in helpers for common tasks (e.g., WSDL caching, fault handling):
    $client = SoapClient::withWsdlCache()->create(['wsdl' => 'url']);
    
  3. Extend the client via traits or decorators if needed:
    use Vendor\Package\Traits\SoapClientExtensions;
    
    class CustomClient extends SoapClient {
        use SoapClientExtensions;
    }
    

Workflow Integration

  • Request/Response Handling: Use the package’s call() method with typed arguments for better validation:
    $response = $soapClient->call('GetUser', ['id' => 123], UserResponse::class);
    
  • Error Handling: The new client throws Vendor\Package\Exceptions\SoapException with structured data. Catch and log:
    try {
        $soapClient->call('FaultyMethod');
    } catch (SoapException $e) {
        logger()->error('SOAP Error', ['code' => $e->getCode(), 'details' => $e->getDetails()]);
    }
    

Gotchas and Tips

Breaking Changes

  • Legacy SoapClient Deprecation: Direct use of PHP’s native SoapClient will fail if the package’s client is forced globally. Update DI bindings:
    // Old (deprecated)
    $client = new \SoapClient('wsdl');
    
    // New
    $client = SoapClient::create(['wsdl' => 'wsdl']);
    
  • Configuration Overrides: If the package auto-configures the client, ensure your config/services.php doesn’t conflict:
    'soap' => [
        'client' => Vendor\Package\SoapClient::class, // Force new client
    ],
    

Debugging Tips

  • Enable SOAP Traces: Use the package’s debug mode:
    $client = SoapClient::debug()->create(['wsdl' => 'url']);
    
  • WSDL Validation: The new client validates WSDL schemas stricter. If you encounter SchemaValidationException, check your WSDL for:
    • Missing targetNamespace.
    • Deprecated SOAP 1.0 constructs.

Extension Points

  • Custom Headers: Extend the client via decorators:
    $client = SoapClient::decorate(function ($client) {
        $client->setHeaders(['Authorization' => 'Bearer token']);
        return $client;
    })->create(['wsdl' => 'url']);
    
  • Middleware: Add request/response middleware:
    SoapClient::middleware([
        new \Vendor\Package\Middleware\LoggingMiddleware(),
    ]);
    
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor