i'm developing a website in PHP and want to integrate it with SAP B1, my question is can anyone show me how to connect to web services(B1WS) with DI Server using PHP?
Thank you
i'm developing a website in PHP and want to integrate it with SAP B1, my question is can anyone show me how to connect to web services(B1WS) with DI Server using PHP?
Thank you
I don't know B1WS but i can say you how to connect a web service, you must use the soap object in PHP, or better i use that... usually a connection, where pathWsdl is the link of the wsdl inside the project and the $url is the the url of the webService...Once you are connected every wsdl has some operations that can be called, and every operation usually need some parameters in input and gives an output....here the connection:
$connessione = new SoapClient($pathWsdl,array (
"login" => $user,
'password' => $pass,
"trace" => true,
"connection_timeout"=> 15,
) );
$connessione ->__setLocation($url);
To call the operation once you are connected
//chiamiamo l'operazione e gli passiamo i parametri
$rispostaRichiestaOperazione = $connessione->__soapCall($operazioneRichiesta, array(
"parametriOperation" => $parametriOperation
));
Where operationRichiesta is the operation that can be call inside the wsdl and $parametriOperation is usually an array of parameters that you must define reading the wsdl for that operation that you are calling, every wsdl can have differents operations with differents input params, the keys of the array has the same name of the name attributes inside the wsdl, and you must see if you need an array or a simple string from the wsdl, for sure you must have the wsdl description and code to can do the right call because if you wrong to write a name(key of array) the call goes in error. $rispostaRichiestaOperazione is usually an stdClass that you can convert in array... Hope this help a little...
';var_dump(get_class_methods('SoapClient'));print''; look also at the manual: http://php.net/manual/en/soapclient.setlocation.php – May 09 '18 at 13:54