繁体   English   中英

Laravel SOAP 请求电话

[英]Laravel SOAP request call

我正在寻找访问特定的 API(在此处找到: https://jigsaw.w3.org/css-validator/manual.html#api ),但这是一个 SOAP api,我从未使用过 SOAP . 所以我安装了这个 package: https://coderedd.github.io/laravel-soap/我尝试了一个测试调用。 它看起来像这样:

    $response = Soap::baseWsdl('https://jigsaw.w3.org/css-validator/validator')
        ->call('validator', [
            'text' => $text,
            'lang' => 'en',
        ]);

    
    
    dd($response);
    

但是我已经知道这会失败,因为我不知道要在 ->call('') 中放入什么

正如预期的那样,我得到了回应:

#response: GuzzleHttp\Psr7\Response {#1715 -reasonPhrase: "Bad Request"

帮助?

根据您提供的文档。 https://jigsaw.w3.org/css-validator/manual.html#api

您必须将 output 设置为“application/soap+xml”或“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);

回答:这不是SOAP API,尴尬。 文档的标题是“CSS Validator Web Service API SOAP 1.2”所以我假设它会是 SOAP API。但是不,SOAP 部分只是对返回 88.4288 的引用 SOAP

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM