2

I ll appreciate the help with this request soap using curl in php.

My Code:

$soap_request  = "<?xml version=\"1.0\"?>\n";
  $soap_request .= '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/" 
xmlns:atma="http://schemas.datacontract.org/2004/07/Atma.Plugin.Misc.ServiceAPI.DTOs.Re quest"> 
   <soapenv:Header/> 
   <soapenv:Body> 
      <tem:Login> 
         <!--Optional:--> 
         <tem:login> 
            <!--Optional:--> 
            <atma:Senha>123456</atma:Senha> 
            <!--Optional:--> 
            <atma:Usuario>user@email.com</atma:Usuario> 
         </tem:login> 
      </tem:Login> 
   </soapenv:Body> 
</soapenv:Envelope> ';

  $header = array(
    "Content-type: text/xml;charset=\"utf-8\"",
    "Accept: text/xml",
    "Cache-Control: no-cache",
    "Pragma: no-cache",
    "Content-length: ".strlen($soap_request),
  );

  $soap_do = curl_init();
  curl_setopt($soap_do, CURLOPT_URL, "http://homolog.snd.com.br/Plugins/Atma.Plugin.Misc.ServiceAPI/Controllers/ServiceAPIEndpoint.svc?wsdl" );
  curl_setopt($soap_do, CURLOPT_CONNECTTIMEOUT, 10);
  curl_setopt($soap_do, CURLOPT_TIMEOUT,        10);
  curl_setopt($soap_do, CURLOPT_RETURNTRANSFER, true );
  curl_setopt($soap_do, CURLOPT_SSL_VERIFYPEER, false);
  curl_setopt($soap_do, CURLOPT_SSL_VERIFYHOST, false);
  curl_setopt($soap_do, CURLOPT_POST,           true );
  curl_setopt($soap_do, CURLOPT_POSTFIELDS,     $soap_request);
  curl_setopt($soap_do, CURLOPT_HTTPHEADER,     $header);

  if(curl_exec($soap_do) === false) {
    $err = 'Curl error: ' . curl_error($soap_do);
    curl_close($soap_do);
    print $err;
  } else {
    $xml = curl_exec($soap_do);
    $err = curl_error($soap_do);
    curl_close($soap_do);
    print_r($err);
    print_r($xml);
    print 'Operation completed without any errors';
  }

The error is:

The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).

Sourav Ghosh
  • 1,964
  • 4
  • 33
  • 43
Marcelo
  • 61
  • 5
  • This has been answered here https://stackoverflow.com/questions/5487791/contractfilter-mismatch-at-the-endpointdispatcher-exception – Marc Pereira Oct 17 '19 at 14:42

0 Answers0