Error in getting response in SOAP

<?php
//require ('lib/nusoap.php');
//Content-Type:"text/xml; charset=utf-8";

$wsdl = "http://example.svc?wsdl";
$client = new SoapClient($wsdl,array('trace' => 1,'soap_version'   => SOAP_1_2));

$security = array(
'UserName' => array(
    'UserName'=>'user',
    'Password'=>'c@321!',
    'SupportInteractive'=>false
 )
);

$header = new SoapHeader($wsdl,'RequestorCredentials',$security,false);
$client->__setSoapHeaders($header);


$params = array();
$params['UniqueIdentifier'] = "PD-81";
$params['RequestSource'] = "CD";
try {
    $ret = $client->GetSanctionStatus($params);
	//header('Content-Type: text/xml; ');
    //print_r($ret->__getLastRequest());
     print_r($ret);
}catch(Exception $e){
  echo $e->getMessage();
}

?>
<?php
print "<pre>\n"; 
print "Request: \n".htmlspecialchars($client->__getLastRequest()) ."\n"; 
print "Response: \n".htmlspecialchars($client->__getLastResponse())."\n"; 
print "</pre>"; 
?>

ERROR: Cannot process the message because the content type ‘application/soap+xml; charset=utf-8; action=“http://tempuri.org/IReceiveSanctionContract/GetSanctionStatus”’ was not the expected type ‘text/xml; charset=utf-8’.

plz help me

you have the wrong content-type header. SOAP expects application/soap+xml, not just text/xml

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.