getting issue in SoapClient request in the laravel 8

Viewed 13

I am trying to make a SOAP request using the PHP soapClient in laravel 8, but unfortunately, I am struggling with this issue.

please check the code for refrence.

thanks

SAMPLE INPUT

POST /wstopupv2/WSTopUp.asmx HTTP/1.1
Host: s2s.oneecpay.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://ECPay/WSTopUp/CheckBalance"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<CheckBalance xmlns="http://ECPay/WSTopUp">
<LoginInfo>
<AccountID>10</AccountID>
<Username>abc</Username>
<Password>password</Password>
<BranchID>1022</BranchID>
</LoginInfo>
</CheckBalance>
</soap:Body>
</soap:Envelope>

Here is my function:

public  function buy_loads ()
{
    $client = new \SoapClient("http://s2s.oneecpay.com/wstopupv2/WSTopUp.asmx?wsdl");
            
    $params = array(
      "LoginInfo" => ['AccountID' => 123, 'Username' => 'abc', 'Password' => 'abc', 
      'BranchID' => 123]
            );

            $response = $client->__soapCall("CheckBalance", array($params));
           
            echo "<pre>";
            print_r($response);
}

Here is the response in the browser

stdClass Object
(
    [CheckBalanceResult] => stdClass Object
        (
            [RemBal] => Invalid Login
        )
)

Please, let me know your suggestions to fix this issue. Thanks again.

0 Answers
Related