I'm looking to get access to a specific API (found here: ), however this is a SOAP api and I've never worked with SOAP. So I install this package: and I try a test call. It looks like this:
$response = Soap::baseWsdl(')
->call('validator', [
'text' => $text,
'lang' => 'en',
]);
dd($response);
however I already know this is going to fail because I have no idea what to put into the ->call('')
and as expected I get the response:
#response: GuzzleHttp\Psr7\Response {#1715 -reasonPhrase: "Bad Request"
Help?
2 Answers
Answer: This is not a SOAP API. That's embarrassing. The title of the documentation was "CSS Validator Web Service API SOAP 1.2" so I had assumed it was going to be a SOAP API. But no, the SOAP part is just a reference to returning XML.
According to the documentation you provided.
You have to set the output to either 'application/soap+xml' or 'soap12'
$response = Soap::baseWsdl(')
->call('validator', [
'uri' => $text,
'lang' => 'en',
'output' => 'application/soap+xml'
]);
dd($response);