0
I managed, via PHP to connect to a Webservice via SOAP, but I can not caputrar the return data. I made a var_dump
in the return variable, and what is displayed on the screen follows below:
object(stdClass)[2]
public 'BuscaSMPResult' =>
object(stdClass)[3]
public 'MensagensErro' =>
object(stdClass)[4]
public 'RetornoMensagem' =>
object(stdClass)[5]
...
public 'TransacaoOk' => boolean false
public 'SMP' => null
How can I capture this data?
Edit
Text returned when using print_r
in place ofvar_dump
:
stdClass Object
(
[InsereSMPResult] => stdClass Object
(
[MensagensErro] => stdClass Object
(
[RetornoMensagem] => stdClass Object
(
[Codigo] => 1001
[Mensagem] => É necessário informar o Token
)
)
[TransacaoOk] =>
[MensagensAviso] => stdClass Object
(
)
[MensagensSucesso] => stdClass Object
(
)
[AnoSMP] => 0
[IdSMP] => 0
[NumeroSMP] => 0
)
)
echo($Sponse->Inserts Presult->Messagenserro->Returnname->Code); //So it doesn’t work?
– Don't Panic
It is returning an object, it would not be something like this: Whereas the return is in $date seeking to obtain the value of Code: $codigo = $data->Inserts;
– Leandro Paiva
@Everson returns empty
– Lucas Torres
@Lucas Torres It is necessary to inform the Token
– Hugo Rutemberg