I have this code in PHP and I need to do it in React
$consult = new SoapClient('My webPage');
$response = $consult->consultJob($name,$id);
Is there an easy way to do that?
I have this code in PHP and I need to do it in React
$consult = new SoapClient('My webPage');
$response = $consult->consultJob($name,$id);
Is there an easy way to do that?
The PHP SoapClient is a server side action. When you say "do it in React", i'm assuming you mean the browser? So you would not typically do this in the browser directly, but in a nodejs runtime on the server using a package like soap
Their example in the docs:
var soap = require('soap');
var url = 'http://example.com/wsdl?wsdl';
var args = {name: 'value'};
soap.createClientAsync(url).then((client) => {
return client.MyFunctionAsync(args);
}).then((result) => {
console.log(result);
});