web service - PHP - Beginner

0

I'm starting to study PHP and need some help. I need to consume a web service , but I can not. Could someone help me?

I have wsdl: = link which requests the following structure:

SOAP request

<?xml version="1.0" encoding="utf-8"?"
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
   <PEDIDO>STRING</PEDIDO>
</soap:Body>
</soap:Envelope>

SOAP Request Response

<?xml version="1.0" encoding="utf-8"?"
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
   <CRET>STRING</CRET>
</soap:Body>
</soap:Envelope>

I have tried several models on the net and I am not guessing, I am very grateful for your help.

    
asked by anonymous 24.02.2018 / 20:08

1 answer

1

Resolved:

$client = new SoapClient('http://200.171.223.154:98/wstelegram/wstelegram.apw?wsdl');

$function = 'RETTELEGRAM';

$arguments= array('RETTELEGRAM'=>array(
    'PEDIDO' => 'w'
));

$options = array('location' => 'http://200.171.223.154:98/wstelegram/wstelegram.apw');


$result = $client->__soapCall($function, $arguments, $options);

echo 'Response: ';

return($result->RETTELEGRAMRESULT);
    
24.02.2018 / 22:08