-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://currencyconverter.kowabunga.net/converter.asmx?WSDL' : failed to load external entity "http://currencyconverter.kowabunga.net/converter.asmx?WSDL" #182
Comments
i got this too :( |
I think this issue could be, because Soap isnt sending the user_agent. I tried to set the user agent in ->options but it still doesnt work. |
sloved |
Could you please tell us at least how you solved it? |
@nguyenhiepvan how did you solved it? |
It has been resolved for me. I just needed to add setlocation and copy the
wsdl url to it.
e.g.
$client->setLocation('http://www.webservicex.net/globalweather.asmx');
…On Thu, 23 Apr 2020, 12:19 pm Nguyễn Văn Hiệp, ***@***.***> wrote:
i got this too :(
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#182 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOO3TRCSRIF2EBEASEFFTODRN7QGPANCNFSM4MLI6KCQ>
.
|
I created this controller <?php
namespace App\Http\Controllers;
use Artisaninweb\SoapWrapper\SoapWrapper;
use App\Soap\Request\GetConversionAmount;
use App\Soap\Response\GetConversionAmountResponse;
class SoapController
{
/**
* @var SoapWrapper
*/
protected $soapWrapper;
/**
* SoapController constructor.
*
* @param SoapWrapper $soapWrapper
*/
public function __construct(SoapWrapper $soapWrapper)
{
$this->soapWrapper = $soapWrapper;
}
/**
* Use the SoapWrapper
*/
public function show()
{
$response = 'empty';
if(isset($this->soapWrapper)){
$this->soapWrapper->add('Currency', function ($service) {
$service
->wsdl('http://currencyconverter.kowabunga.net/converter.asmx?WSDL')
->trace(true)
->options(['user-agent'=>'PHPSoapClient'])
->classmap([
GetConversionAmount::class,
GetConversionAmountResponse::class,
]);
});
$response = $this->soapWrapper->call('Currency.GetConversionAmount', [
new GetConversionAmount('USD', 'EUR', '2014-06-05', '1000')
]);
}
echo $response;
}
} As the documentation mention I created the Request and Response PHP files <?php
namespace App\Soap\Request;
class GetConversionAmount
{
/**
* @var string
*/
protected $CurrencyFrom;
/**
* @var string
*/
protected $CurrencyTo;
/**
* @var string
*/
protected $RateDate;
/**
* @var string
*/
protected $Amount;
/**
* GetConversionAmount constructor.
*
* @param string $CurrencyFrom
* @param string $CurrencyTo
* @param string $RateDate
* @param string $Amount
*/
public function __construct($CurrencyFrom, $CurrencyTo, $RateDate, $Amount)
{
$this->CurrencyFrom = $CurrencyFrom;
$this->CurrencyTo = $CurrencyTo;
$this->RateDate = $RateDate;
$this->Amount = $Amount;
}
/**
* @return string
*/
public function getCurrencyFrom()
{
return $this->CurrencyFrom;
}
/**
* @return string
*/
public function getCurrencyTo()
{
return $this->CurrencyTo;
}
/**
* @return string
*/
public function getRateDate()
{
return $this->RateDate;
}
/**
* @return string
*/
public function getAmount()
{
return $this->Amount;
}
} Response <?php
namespace App\Soap\Response;
class GetConversionAmountResponse
{
/**
* @var string
*/
protected $GetConversionAmountResult;
/**
* GetConversionAmountResponse constructor.
*
* @param string
*/
public function __construct($GetConversionAmountResult)
{
$this->GetConversionAmountResult = $GetConversionAmountResult;
}
/**
* @return string
*/
public function getGetConversionAmountResult()
{
return $this->GetConversionAmountResult;
}
} Then i call it Route::get('/soap',[SoapController::class, 'show']); And I got this error too: I really need to create a SOAP client, I need to create a SOAP client for a BizFlow POC |
I founded a solutionHere is my controller <?php
namespace App\Http\Controllers;
use Artisaninweb\SoapWrapper\SoapWrapper;
use App\Soap\Request\GetConversionAmount;
use App\Soap\Response\GetConversionAmountResponse;
class SoapController
{
/**
* @var SoapWrapper
*/
protected $soapWrapper;
/**
* SoapController constructor.
*
* @param SoapWrapper $soapWrapper
*/
public function __construct(SoapWrapper $soapWrapper)
{
$this->soapWrapper = $soapWrapper;
}
/**
* Use the SoapWrapper
*/
public function show()
{
$response = 'empty';
$opts = array(
'http' => array(
'user_agent'=>'PHPSoapClient'
)
);
$context=stream_context_create($opts);
$wsdl='http://currencyconverter.kowabunga.net/converter.asmx?WSDL';
$o=array(
'stream_context'=>$context,
'cache_wsdl'=>WSDL_CACHE_NONE
);
$a=$this->soapWrapper->add('servicio',function($service){
$service
->wsdl('http://currencyconverter.kowabunga.net/converter.asmx?WSDL')
->trace(true)
->options([
'stream_context'=>stream_context_create([
'http' => array(
'user_agent'=>'PHPSoapClient'
)
]),
'cache_wsdl'=>WSDL_CACHE_NONE
]);
dump($service);
});
$this->soapWrapper->client('servicio',function($client){
echo '<h3>Functions</h3>';
dump($client->getFunctions());
echo'<h3>call</h3>';
dump($client->call('GetCurrencies',[]));
});
/*
if(isset($this->soapWrapper)){
$this->soapWrapper->client(null,function($service){
$service
->wsdl('http://currencyconverter.kowabunga.net/converter.asmx?WSDL')
->options(['user-agent'=>'PHPSoapClient']);
});
$this->soapWrapper->add('Currency', function ($service) {
$service
->wsdl('http://currencyconverter.kowabunga.net/converter.asmx?WSDL')
->trace(true)
->options(['user-agent'=>'PHPSoapClient'])
->classmap([
GetConversionAmount::class,
GetConversionAmountResponse::class,
]);
});
//*$response = $this->soapWrapper->call('Currency.GetConversionAmount', [
new GetConversionAmount('USD', 'EUR', '2014-06-05', '1000')
])
}*/
echo $response;
}
} |
You can close it! $this->soapWrapper->add('servicio',function($service){
$service
->wsdl('http://currencyconverter.kowabunga.net/converter.asmx?WSDL')
->trace(true)
->options([
'stream_context'=>stream_context_create([
'http' => array(
'user_agent'=>'PHPSoapClient'
)
]),
'cache_wsdl'=>WSDL_CACHE_NONE
]);
dump($service);
}); |
Hi, using Laravel 9 and the WSDL url (http://currencyconverter.kowabunga.net/converter.asmx?WSDL) is not available anymore. Also adding |
Please all these are not working, still getting SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://currencyconverter.kowabunga.net/converter.asmx?WSDL' : failed to load external entity "http://currencyconverter.kowabunga.net/converter.asmx?WSDL" |
Updates? Still not working |
Hello sir,
I have used this package but, I am getting above mentioned error when trying to launch it.It seems that there is some issue with my configurations.Could you please help me with this????
The text was updated successfully, but these errors were encountered: