Namespaces with soap


I have a problem. I have to access the following service:

POST /ws/emision.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://DCX/Emision/ConsultaSumaAseguradaVehiculos"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
    <UserCredentials xmlns="http://DCX/Emision/">
    <ConsultaSumaAseguradaVehiculos xmlns="http://DCX/Emision/">

and it returns me: The server did not recognize the value of the SOAPAction HTTP header: link .

The code implemented:

 $opts = array(
        'ssl' => array('ciphers'=>'RC4-SHA', 'verify_peer'=>false, 'verify_peer_name'=>false)
    $params = array (
        'encoding' => 'UTF-8', 
        'verifypeer' => false, 
        'verifyhost' => false, 
        'soap_version' => 'SOAP_1_1', 
        'trace' => 1, 'exceptions' => 1, 
        'connection_timeout' => 180, 
        'stream_context' => stream_context_create($opts) ,
        'xmlns' => 'http://DCX/Emision/',

    $apiauth =array('IdUsuario'=>'','Password'=>'');
    $wsdl    = "";
    $leyenda = 'http://DCX/Emision/' ;


 $header  = new SoapHeader($leyenda, 'UserCredentials', $apiauth);

    $soap = new SoapClient($wsdl); 


    $response = $soap->__soapCall('ConsultaSumaAseguradaVehiculos', array($params)); 

I do not understand what the problem is. I was reviewing and apparently it is well implemented. I appreciate the collaboration they can make.

asked by CLAUDIO DOME 13.11.2018 в 15:54

1 answer


You are trying to access a web service with SOAP and you are passing a SOAPAction parameter in the HTTP request that does not match what the service expects.

Validate that you are using the correct one, it could be that the web service has made some modification like changing the namespace (namespace of the service).

I recommend that you perform tests on SOAPUI or another one since they will show you the SOAPAction that is in use.


answered by 13.11.2018 в 16:26