修改 接收 检查申请的接口
parent
7ced139ed2
commit
e8df67dcd0
Binary file not shown.
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Services\SoapService;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class SoapServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
$this->app->singleton(SoapService::class, function () {
|
||||
// 这里替换为你的SOAP服务的WSDL地址
|
||||
$wsdlUrl = 'http://yijiyuyue//aa.wsdl';
|
||||
return new SoapService($wsdlUrl);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
namespace App\Services;
|
||||
|
||||
class SoapService
|
||||
{
|
||||
protected $client;
|
||||
|
||||
public function __construct($wsdlUrl)
|
||||
{
|
||||
$options = [
|
||||
'trace' => 1,
|
||||
'exceptions' => true,
|
||||
];
|
||||
|
||||
$this->client = new SoapClient($wsdlUrl, $options);
|
||||
}
|
||||
|
||||
public function callSoapMethod($methodName, array $params = [])
|
||||
{
|
||||
try {
|
||||
return $this->client->__soapCall($methodName, $params);
|
||||
} catch (\SoapFault $e) {
|
||||
// 处理错误
|
||||
\Log::error('SOAP Fault: ' . $e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
Loading…
Reference in New Issue