-
-
Save akalongman/56484900eaf19b18cfbd to your computer and use it in GitHub Desktop.
ini_set('soap.wsdl_cache_enabled', 0); | |
ini_set('soap.wsdl_cache_ttl', 900); | |
ini_set('default_socket_timeout', 15); | |
$params = array('param1'=>$param1); | |
$wsdl = 'http://service_url/method?WSDL'; | |
$options = array( | |
'uri'=>'http://schemas.xmlsoap.org/soap/envelope/', | |
'style'=>SOAP_RPC, | |
'use'=>SOAP_ENCODED, | |
'soap_version'=>SOAP_1_1, | |
'cache_wsdl'=>WSDL_CACHE_NONE, | |
'connection_timeout'=>15, | |
'trace'=>true, | |
'encoding'=>'UTF-8', | |
'exceptions'=>true, | |
); | |
try { | |
$soap = new SoapClient($wsdl, $options); | |
$data = $soap->method($params); | |
} | |
catch(Exception $e) { | |
die($e->getMessage()); | |
} | |
var_dump($data); | |
die; |
The method($params) is just an example of a soap operation, you decalre the method name according to the soap operation on the soap server.
Hi, i try and i got this error
An error occurred when verifying security for the message.
Can you help me?
My code:
$wsdl='https://asansordenetim.sanayi.gov.tr/IBstbAsansorDenetimServis.svc?wsdl';
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 900);
ini_set('default_socket_timeout', 15);
$options = array(
'uri'=>'http://schemas.xmlsoap.org/wsdl/soap/',
'style'=>SOAP_RPC,
'use'=>SOAP_ENCODED,
'soap_version'=>SOAP_1_1,
'cache_wsdl'=>WSDL_CACHE_NONE,
'connection_timeout'=>15,
'trace'=>true,
'encoding'=>'UTF-8',
'exceptions'=>true,
'username'=>'**********',
'password'=>'***********',
);
try {
$soap = new SoapClient($wsdl, $options);
$data = $soap->TumIlleriSorgulama();
}
catch(Exception $e) {
die($e->getMessage());
}
var_dump($data);
die;
I am facing some problems with php soap client programming. If you have some spare time can you do review my problem in the following link https://stackoverflow.com/questions/48621226/how-can-i-break-the-web-services-returned-message-into-array. Thank you.
@burakkaraoglu what is the error? explain, please
maybe, $optiosn array finish comma ','
"'password'=>'***********',
);"
Regards.
Hello,
Culd you tell how can I send back a xml to wsdl?
I used this "PHP soap client example" above to get records from a wsdl and work well, but now I have to send back to ws a xml to mark each record as processed in order to avoid a new receivings from the same record.
The documentation of wsdl says:
method: AlterarSituacaoControleFluxoAbastecimentoAuth
request parameters:
user: string
password: string
xml : xml
How can I send this? Could you post a simple example, please?
Thanks in advance.
Server was unable to process request. ---> The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
i am having above error. any idea what is the wrong. if you want i can send you code also
Can you please share how to update a value over soap and php?
Voici un exemple avec php
try {
$urlexemple = 'http://webservices.oorsprong.org/websamples.countryinfo/CountryInfoService.wso?WSDL';
$arrContextOptions=array("ssl"=>array( "verify_peer"=>false, "verify_peer_name"=>false,'crypto_method' => STREAM_CRYPTO_METHOD_TLS_CLIENT));
$options = array('soap_version'=>SOAP_1_2,'exceptions'=>true,'trace'=>1,'cache_wsdl'=>WSDL_CACHE_NONE,'stream_context' => stream_context_create($arrContextOptions));
$soapclient = new SoapClient($urlEdg, $options);
// parametre
$paramexemple=array('sCountryISOCode'=>$request->devise);
$response =$soapclient->FullCountryInfo($paramexemple);
$array = json_decode(json_encode($response), true);
return $array;
} catch (Throwable $e) {
return $e->getMessage();
}
Where you declare the param1 variable? It through an exception.