We help IT Professionals succeed at work.
Get Started

I am trying to create a PHP soap client. Following is my soap request XML Schema

Dhanish pk
Dhanish pk asked
on
877 Views
Last Modified: 2016-10-01
I am trying to create a PHP soap client. Following is my soap request XML Schema

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:req="http://olp.bank.com/payement/service/olppaymentmanager/req">
   <soapenv:Header/>
   <soapenv:Body>
      <req:initiatePaymentDetailsReq>
         <olpIdAlias>****</olpIdAlias>
         <merchantId>****</merchantId>
         <merchantRefNum>234324</merchantRefNum>
         <paymentAmount>200</paymentAmount>
         <paymentCurrency>SAR</paymentCurrency>
         <dynamicMerchantLandingURL></dynamicMerchantLandingURL>
         <dynamicMerchantFailureURL></dynamicMerchantFailureURL>
      </req:initiatePaymentDetailsReq>
   </soapenv:Body>
</soapenv:Envelope>

Open in new window



following is my var_dump($client->__getFunctions()) output

array(1) { [0]=> string(95) "initiatePaymentDetailsRes executeRB_OLP_INITIATE_PAYMENT(initiatePaymentDetailsReq $parameters)" } 

Open in new window


can anyone help me to write PHP client for above soap request ? I am trying since 2 weeks.and I am failed. getting error

PHP code

include 'initiatePaymentDetailsReq.php';

$wsdl = dirname(__FILE__).'/librb/RB_OLP_INITIATE_PAYMENT.wsdl';

$endpoint       = 'https://b2b.bank.com/soap?service=RB_OLP_INITIATE_PAYMENT';
$local_cert = dirname(__FILE__)."/key1.pem";
$passphrase = "*****";
$options = array(
    'location'      => $endpoint,
    'keep_alive'    => true,
    'trace'         => true,
    'local_cert'    => $local_cert,
    'passphrase'    => $passphrase,
    'cache_wsdl'    => WSDL_CACHE_NONE,
    'exceptions' => 0

);

try{

        $client = new SoapClient($wsdl,$options); 

    } catch (SoapFault $E) { 
        echo $E->getMessage();
    }
    if ($client) {                                '
$in=new StdClass();


$in->olpIdAlias='****';
      $in->merchantId='***';
        $in->merchantRefNum='12344';
          $in->paymentAmount='100';
            $in->paymentCurrency='SAR';
                $in->dynamicMerchantLandingURL='';
                    $in->dynamicMerchantFailureURL='';


                    //$response = $client->__soapCall('executeRB_OLP_INITIATE_PAYMENT',array($req_params));
               $response = $client->executeRB_OLP_INITIATE_PAYMENT($req_params);
                      var_dump($response);


    }

Open in new window

OUTPUT
Fault occurred in processing, detail provided
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 10 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE