Skip to content

Hi everyone! i have a following question: how to set a timeout to soap call??? #210

@sramirezse

Description

@sramirezse

Discussed in #209

Originally posted by sramirezse March 24, 2022
I tried to use withOptions(['connection_timeout' and 'default_socket_timeout' but the response takes much longer and does not throw an error, this is my code:

`try{

        $responseGetOrder = Soap::baseWsdl($this->url)->withOptions([
            'connection_timeout' => 30,
            'default_socket_timeout' => 30,
        ])->getOrder([
            'user' => $this->user,
            'operator' => $this->operator,
            'idProduct' => 'RMP100',
            'numberAccount' => 5511111160,
            // 'numberAccount' => 3334441122,
            // 'numberAccount' => 5511111130,
            'clientFolio' => $serviceAttempt->id,
        ]);
        $responseGetOrderBody = $responseGetOrder->json();
        return $responseGetOrderBody;
    }catch(\Exception $e){
       dd($e);
    }`

this is the time it takes to respond, sorry my bad english
imagen

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions