nitiphone2021 Posted May 22, 2021 Share Posted May 22, 2021 Dear All. Now I am trying to send Soap to server by PHP code I install composer and require soapclient but on my PHP code is fail This is my command for composer composer require phpro/soap-client This is PHP code file name testSendSMS.php require_once 'vendor/autoload.php'; $operator = "http://ltcservice..com:5577/Services.asmx?WSDL"; $privateKey = "BDX89Cxfpp"; $headerSMS = "TEST"; // TEST $userid = "BDX"; $txtTel ="2059545445659"; $newRegCode_exp = rand(); $messageBody = "Test SMS"; //$serverIP = $_SERVER['REMOTE_ADDR']; $serverIP = "172.28.17.61"; $trans_id = "BDX".rand(); //$trans_id = "123456"; $data = $serverIP.$trans_id; $messageBody = $serverIP.$trans_id; echo '<br/>'.$data. " >=> " . exec("java -jar encrypt.jar ".$data." ".$privateKey, $key); echo '<br/>'.$key[1]. " >=> " . exec("java -jar decrypt.jar ".$key[1]." ".$privateKey, $output); echo '<br/> encrypt result >=> '.$key[0]; if($key[0]=="OK"){ $header = array('userid' => $userid, 'trans_id' => $trans_id, 'key' => $key[1], ); echo '<br/>'; print_r($header); $client = new SoapClient($operator); $msg = array( 'msisdn' => $txtTel, 'message' => $messageBody, 'headerSMS' => $headerSMS, 'header' => $header, ); $requestmsg = array('msg'=>$msg); echo '<br/>'; print_r($msg); $data = $client->SendSMS($requestmsg); echo '<br/>'; print_r($data); } Error Fatal error: Uncaught Error: Class 'SoapClient' not found in C:\xampp\htdocs\sms\SEND_SMS\testSendSMS.php:27 Stack trace: #0 {main} thrown in C:\xampp\htdocs\sms\SEND_SMS\testSendSMS.php on line 27 Quote Link to comment https://forums.phpfreaks.com/topic/312770-send-soap-by-php-composer-fail-load-class/ Share on other sites More sharing options...
gw1500se Posted May 22, 2021 Share Posted May 22, 2021 You need to install SoapClient separately. It is not normally installed by default. You don't specify what OS you are using but in Linux you need to do either: sudo apt-get install php-soap or sudo yum install php-soap depending on your flavor of *NIX. Quote Link to comment https://forums.phpfreaks.com/topic/312770-send-soap-by-php-composer-fail-load-class/#findComment-1586724 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.