1
I have to send an Access Token to the webservice, this token should be sent in an XML, like this:
POST /webslaptime_deploy/websLapTime.asmx HTTP/1.1
Host: 187.17.175.49
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://mylaptime.com/ListarTodosOsProdutos"
<?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:Header>
<ValidationSoapHeader xmlns="http://mylaptime.com/">
<DevToken>string</DevToken>
</ValidationSoapHeader>
</soap:Header>
<soap:Body>
<ListarTodosOsProdutos xmlns="http://mylaptime.com/" />
</soap:Body>
</soap:Envelope>
I have tried several ways, through php SOAP, through Curl sending the same typed XML and nothing. Always give this error.
Devtoken is correct, I checked a thousand times.
These are my failed attempts.
Utilizing Array
$seg = array(
"Header" => array(
"ValidationSoapHeader" => array(
"DevToken" => "DEV TOKEN AQUI"
),
),
"Body" => array(
"ListarTodosOsProdutos" => array()
)
);
$client = new SoapClient('http://IP/webslaptime_deploy/websLapTime.asmx?WSDL');
$function = "ListarTodosOsProdutos";
$options = array('location' => 'http://IP/webslaptime_deploy/websLapTime.asmx');
$result = $client->__soapCall($function, $seg, $options);
Using OBJ
$seg = new StdClass;
$seg->Header = new StdClass;
$seg->Header->ValidationSoapHeader = new StdClass;
$seg->Header->ValidationSoapHeader->DevToken = "DEV TOKEN AQUI";
$seg->Body = new StdClass;
$seg->Body->ListarTodosOsProdutos = new StdClass;
$client = new SoapClient('http://IP/webslaptime_deploy/websLapTime.asmx?WSDL');
$function = "ListarTodosOsProdutos";
$options = array('location' => 'http://IP/webslaptime_deploy/websLapTime.asmx');
$result = $client->__soapCall($function, $seg, $options);
The endpoint you are trying to consume has some authentication factor (basic, certified...)
– Homer Simpson
I have no idea, the webservice has no documentation. XML and devToken have been passed
– Igor Cacerez