notfalsedev / laravel-soap

A soap client wrapper for Laravel
MIT License
634 stars 122 forks source link

error ARERR [149] A user name must be supplied in the control record #185

Open afieyudha opened 4 years ago

afieyudha commented 4 years ago

i have issue when use header with auth and get this messages ARERR [149] A user name must be supplied in the control record

this is my code

` $namespace = 'http://remedy-sit.telkomsigma.co.id/arsys/WSDL/public/10.210.30.74/HPD_IncidentInterface_WS?WSDL'; $name = 'AuthenticationInfo'; $data = array('userName' => 'xxx', 'password' => 'xxx', 'authentication'=>'', 'locale'=>'', 'timeZone'=>'');

    $this->soapWrapper->add('CreateSession', function ($service) use ($namespace,$name,$data){
    $service
        ->wsdl('http://remedy-sit.telkomsigma.co.id/arsys/WSDL/public/10.210.30.74/HPD_IncidentInterface_WS?WSDL')
        ->trace(true)
        ->header($namespace,$name,$data)
        ->options([
            'user_agent' => 'PHPSoapClient',      // Add this as options
            'userName' => 'xxx',
            'password' => 'xxx'
        ]);
    });

    $response = $this->soapWrapper->call('CreateSession.HelpDesk_Query_Service', [
    'Incident_Number' => 'INC000000012600',
    ]);

    var_dump($response);

    exit;`
pythondev1 commented 4 years ago

Your options are wrong, remove them and it should work. see https://www.php.net/manual/en/soapclient.soapclient.php

mosharaf13 commented 3 years ago

@afieyudha did you solve this problem ? facing it now.