Validation of the Curp in sat

1

Does anyone know of a webservice or how to post to validate if curp is correct? or failing to obtain all the information of the curp ?

Searching the internet I found this

http://consultas.curp.gob.mx/CurpSP/curp1.do?strCurp=' . $curp . '&strTipo=B')

doing a post like that, but it just shows me Invalid path /curp1 was requested

I do it using Postman and it's the answer, if I do it in php I get the blank answer.

    
asked by Chriz CR 18.10.2017 в 20:24
source

2 answers

1

I found this league sailing, I hope and it serves you.

link ,

Look here is an example in PHP of how to consume the Web Service:

<?php
$peticion = '<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:ValidateMexico">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:Curp soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
     <return xsi:type="urn:CurpReq">
        <user xsi:type="xsd:string">prueba</user>
        <password xsi:type="xsd:string">sC}9pW1Q]c</password>
        <Curp xsi:type="xsd:string">LOOA531113HTCPBN07</Curp>
     </return>
      </urn:Curp>
   </soapenv:Body>
</soapenv:Envelope>';
    $header = array(
        'Content-type: text/xml;charset="utf-8"',
        'Accept-Encoding: gzip, deflate',
        'SOAPAction: "urn:ValidateMexico#Curp"',
        'Connection: Keep-Alive',
        'Content-length: '.strlen($peticion),
    );
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, 'http://187.160.251.219/ws/index.php');
    curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36');
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($curl, CURLOPT_FRESH_CONNECT, 1);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
    curl_setopt($curl, CURLOPT_POSTFIELDS, $peticion);
    curl_setopt($curl, CURLOPT_ENCODING, $peticion);
    $re = curl_exec($curl);
curl_close($curl);
$doom = new \DOMDocument();
$doom->loadXML($re);
$estatus = $doom->getElementsByTagName('Response')->item(0)->nodeValue;
if ($estatus=='correct') {
        echo 'Curp: '.  $doom->getElementsByTagName('Curp')->item(0)->nodeValue ."<br/>";
        echo 'Paterno: '.$doom->getElementsByTagName('Paterno')->item(0)->nodeValue."<br/>";
        echo 'Materno: '.$doom->getElementsByTagName('Materno')->item(0)->nodeValue."<br/>";
        echo 'Nombre: '.$doom->getElementsByTagName('Nombre')->item(0)->nodeValue."<br/>";
}else{
    echo "Error";
}

? >

    
answered by 23.08.2018 в 16:03
0

There is the webservice of nubarium.com , which works with REST. It has a cost but it is very economical. Basically you send a JSON with the following form:

{
   "curp" : "XXXXXXXXXXXXXXXXXX"
}

And it returns all the information of the curp, including the PDF.

    
answered by 24.01.2018 в 19:41