Requisicação Tracking

 avatar
unknown
php
2 years ago
1.2 kB
6
Indexable
$URL_WSDL = "https://edi.totalexpress.com.br/webservice24.php?wsdl";
		$client = new SoapClient(
		$URL_WSDL,

			array(
				'trace' => 1,
				'cache_wsdl' => WSDL_CACHE_NONE,
				'exceptions' => 0,
				'login' => '******',
				'password' => '*****',
				
				)
				);

		if ($client) {
      
			$xml = '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:ObterTracking">
			<soapenv:Header/>
			<soapenv:Body>
				<urn:ObterTracking soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
				<ObterTrackingRequest>
				<DataConsulta xsi:type="xsd:date">2022-10-03</DataConsulta>
				<horaInicio xsi:type="xsd:nonNegativeInteger"></horaInicio>
				<horaFim xsi:type="xsd:nonNegativeInteger"></horaFim>
			 </ObterTrackingRequest>
		   </urn:ObterTracking>
		</soapenv:Body>
	</soapenv:Envelope>';
	}

		$params = simplexml_load_string($xml);
		$response = $client->ObterTracking($params);
	
		$rawResult = $client->__getLastResponse();

		echo '<pre>';
		var_dump($rawResult);
		echo '</pre>';
		die();
Editor is loading...