skip to Main Content

I’m looking to get access to a specific API (found here: https://jigsaw.w3.org/css-validator/manual.html#api), however this is a SOAP api and I’ve never worked with SOAP. So I install this package: https://codedredd.github.io/laravel-soap/ and I try a test call. It looks like this:

    $response = Soap::baseWsdl('https://jigsaw.w3.org/css-validator/validator')
        ->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: GuzzleHttpPsr7Response {#1715
-reasonPhrase: "Bad Request"

Help?

2

Answers


  1. Chosen as BEST ANSWER

    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.


  2. According to the documentation you provided. https://jigsaw.w3.org/css-validator/manual.html#api

    You have to set the output to either ‘application/soap+xml’ or ‘soap12’

    $response = Soap::baseWsdl('https://www.w3.org/2005/09/css-validator.wsdl')
        ->call('validator', [
            'uri' => $text,
            'lang' => 'en',
            'output' => 'application/soap+xml'
        ]);
    
    
    dd($response);
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search