notfalsedev / laravel-soap

A soap client wrapper for Laravel
MIT License
633 stars 121 forks source link

SoapFault exception: [HTTP] Could not connect to host #158

Open rochmat007 opened 5 years ago

rochmat007 commented 5 years ago

hello,

i have a problem with soapwrapper and got SoapFault exception: [HTTP] Could not connect to host below my code public function delimaH2HRequest($data,$signature){ try{

   Log::info("delimaH2H Request ".print_r($data,true));
   SoapWrapper::add('transaction',function ($service) {
                $service
                 ->wsdl(env('DELIMA_URL'))
                 ->cache(WSDL_CACHE_NONE)
                 ->trace(true);
              });

      $response=SoapWrapper::call('transaction.billpayment',[
          'inputBillPayment'   =>[
                            'userName'        => $data['userName'],
                'signature'       => $signature,
                'productCode'     => $data['productCode'],
                'merchantCode'    => $data['merchantCode'],
                'terminal'        => $data['terminal'],
                'merchantNumber'  => $data['merchantNumber'],
                'transactionType' => $data['transactionType'],
                'billNumber'      => $data['billNumber'],
                'bit61'           => $data['bit61'],
                'amount'          => $data['amount'],
                'feeAmount'       => $data['feeAmount'],
                'traxId'          => $data['traxId'],
                'timeStamp'       => $data['timeStamp'],
                'mcNoHP'          => '',
                'mcNoeVA'         => '',
                'pin'             => '',
                'changePN'        => '',
                'merchant'        => '',
                'changeAmount'    => ''
            ]
      ]); 

    Log::info('delimaH2H response : '.$response->getBody());

   }catch(\Exception $e){

      Log::error($e);
      return $e->getMessage();
   }

   return $response;
}

log Error :

[2018-11-15 11:17:42] development.ERROR: SoapFault exception: [HTTP] Could not connect to host in /var/www/html/finbox/vendor/artisaninweb/laravel-soap/src/Artisaninweb/SoapWrapper/Client.php:189 Stack trace:

0 [internal function]: SoapClient->__doRequest('<?xml version="...', 'https://demos.f...', 'urn:routeDx2#ro...', 1, 0)

1 /var/www/html/finbox/vendor/artisaninweb/laravel-soap/src/Artisaninweb/SoapWrapper/Client.php(189): SoapClient->__soapCall('billpayment', Array, Array, NULL, Array)

2 /var/www/html/finbox/vendor/artisaninweb/laravel-soap/src/Artisaninweb/SoapWrapper/SoapWrapper.php(137): Artisaninweb\SoapWrapper\Client->SoapCall('billpayment', Array, Array)

3 /var/www/html/finbox/vendor/artisaninweb/laravel-soap/src/Artisaninweb/SoapWrapper/SoapWrapper.php(117): Artisaninweb\SoapWrapper\SoapWrapper->Artisaninweb\SoapWrapper{closure}(Object(Artisaninweb\SoapWrapper\Client))

4 /var/www/html/finbox/vendor/artisaninweb/laravel-soap/src/Artisaninweb/SoapWrapper/SoapWrapper.php(138): Artisaninweb\SoapWrapper\SoapWrapper->client('transaction', Object(Closure))

5 /var/www/html/finbox/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(221): Artisaninweb\SoapWrapper\SoapWrapper->call('transaction.bil...', Array)

6 /var/www/html/finbox/app/MyClass/ApiHandler.php(141): Illuminate\Support\Facades\Facade::__callStatic('call', Array)

TechNov commented 3 years ago

Hi have you solve this issue? i face the same issue