How to use php soap instead of nusoap

718 Views Asked by At

I've got an specification web app that uses nusoap extension. But on our server runs php 5.5. I tried to rewrite this example below but its beyond my capabilities...

Here is the script i want to rewrite to use soap in php without nusoap:

<?php

require_once('lib/nusoap.php');

$Client = new nusoap_client( 'https://letsgo-test.org', array( 'encoding'=>'UTF-8' ) );

$Client -> soap_defencoding = 'utf-8';

$Client -> decode_utf8 = FALSE;

$CMsg = array( 'user_name' => 'letsgo', 'user_password' => '123' );
$bClient = $Client->call( 'Login', $CMsg );
$szSession = $bClient[ 'session' ];

$bCPrep = array(
     'rname1' => 'Lets',
     'rname2' => 'Go',
     'rcountry' => 'ORG',
     'rzipcode' => '00-770',
);

$CMsg = array( 'session' => $szSession, 'consign_prep_data' => $bCPrep );
$bClient = $Client->call( 'adePreparingBox_Insert', $CMsg ); 

print_r( $bClient );

$CMsg = array( 'session' => $szSession );

$bClient = $Client->call( 'Logout', $CMsg );

?>

I will be gratefull for any help!!!.

1

There are 1 best solutions below

0
On BEST ANSWER

Yep! I found solution! Its not that hard as i thought,

Some of declarations looks diffrent:

$szSession = $bClient[ 'session' ];
changed to
$szSession = $bClient->session;

instead of "call" you need to use "__soapCall"

So thats what you need to do to free from nusoap.php I guess there are more things to change but its enought for me.

Best Regards!