Hi,
I am trying to connect with Soap using certificate but getting error:
Fatal error: Uncaught SoapFault exception: [HTTP] Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'. in /home/runner/public_html/test/soap.php:37 Stack trace: #0 [internal function]: SoapClient->doRequest('<?xml version="...', 'http://api3.lev...', 'http://www.leve...', 1, 0) #1 /home/runner/public_html/test/soap.php(37): SoapClient->call('LoginUser', Array) #2 /home/runner/public_html/test/soap.php(37): SoapClient->LoginUser(Object(stdClass)) #3 {main} thrown in /home/runner/public_html/test/soap.php on line 37
Here is code
include("wsdl_proxy_generator.php");
$params->AWSAccessKeyId = $wsdl_key;
$params->Request->userID = 'Books';
$params->Request->password = 'php5';
//$this->_soapClient->setSoapVersion(SOAP_1_1);
//response.setContentType("text/xml");
$soap_ver = array('soap_version' => 'SOAP_1_1');
$loc_cer = array('local_cert' => '1lot.prod.api.leverate.com.cer');
//$amazon = WSDLProxyGenerator::createSoapClient('http://api3.leverate.com:8087/mex', $connect);
//$amazon = WSDLProxyGenerator::createSoapClient('http://api3.leverate.com:8087/mex', 'ManagementService');
// application/soap+xml; charset=utf-8
//$amazon = WSDLProxyGenerator::createSoapClient("http://api3.leverate.com:8087/mex", array('local_cert' => "1lot.prod.api.leverate.com.cer", 'passphrase' => "veryhardpassphrase", 'soap_version' => SOAP_1_2));
$context = array('http' => array('header' => 'Content-type: application/soap+xml; charset=utf-8'), $soap_ver, $loc_cer);
//$context = array('header' => 'Content-type: application/soap+xml; charset=utf-8');
//$context = array('header' => 'Content-type: application/soap+xml; charset=utf-8');
$amazon = WSDLProxyGenerator::createSoapClient("http://api3.leverate.com:8087/mex", $context);
$result = $amazon->LoginUser($params);
$res=$result->LoginResult;
print_r($res);
I have try number of things but same error even i remove certificate and give key and even try without certificate and key same error all the time.
I am getting help from this tutorial
http://www.phpbuilder.com/columns/adam_delves20060606.php3?page=2
any help will be appreciated.
Thanks