Namespaces with soap

0

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

POST /ws/emision.asmx HTTP/1.1
Host: xxx.xxx.xxx.123:8070
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="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>
    <UserCredentials xmlns="http://DCX/Emision/">
      <IdUsuario>string</IdUsuario>
      <Password>string</Password>
    </UserCredentials>
  </soap:Header>
  <soap:Body>
    <ConsultaSumaAseguradaVehiculos xmlns="http://DCX/Emision/">
      <Anio>int</Anio>
      <IdAutoModelo>int</IdAutoModelo>
      <CodigoInfoAuto>string</CodigoInfoAuto>
    </ConsultaSumaAseguradaVehiculos>
  </soap:Body>
</soap:Envelope>

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    = "http://xxx.xxx.xxx.123:8070/ws/emision.asmx?WSDL";
    $leyenda = 'http://DCX/Emision/' ;


    $params=array(
    'Anio'=>2013,
    'IdAutoModelo'=>360685,
    'CodigoInfoAuto'=>'0360685'
    );

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


  try{
    $soap = new SoapClient($wsdl); 


    $soap->__setSoapHeaders($header);       


    $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
source

1 answer

0

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.

Luck.

    
answered by 13.11.2018 в 16:26