Laravel Soap Request Call

Laravel Soap Request Call

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);
2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Sarah Jenkins
Author

Sarah Jenkins

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.