PHP SoapClient Cannot process the message because the content type 'text/xml; -
i cannot connect webservice , send/receive data
error
http,cannot process message because content type 'text/xml; charset=utf-8' not expected type 'application/soap+xml; charset=utf-8'.
code
$parameters = [ 'username' => 12324, 'password' => 432123, 'bill_id' => 153585611140, 'payment_id' => 8560103, ]; $url="https://bill.samanepay.com/checkbill/billstateservice.svc?wsdl"; $method = "verifybillpaymentwithadddata"; $client = new soapclient($url); try{ $info = $client->__call($method, array($parameters)); }catch (soapfault $fault){ die($fault->faultcode.','.$fault->faultstring); }
notice
: not work soap version 1,1 , other resolve sample error in stackoverflow.
you try
$url = "https://bill.samanepay.com/checkbill/billstateservice.svc?wsdl"; try { $client = new soapclient($url, [ "soap_version" => soap_1_2, // soap_1_1 'cache_wsdl' => wsdl_cache_none, // wsdl_cache_memory 'trace' => 1, 'exception' => 1, 'keep_alive' => false, 'connection_timeout' => 500000 ]); print_r($client->__getfunctions()); } catch (soapfault $f) { error_log('error => '.$f); }
to verify method name correct.
there can see method
verifybillpaymentwithadddataresponse verifybillpaymentwithadddata(verifybillpaymentwithadddata $parameters)
next check type verifybillpaymentwithadddata
, if parameter can array. test call method via
$client->verifybillpaymentwithadddata([ 'username' => 12324, 'password' => 432123, 'bill_id' => 153585611140, 'payment_id' => 8560103, ]);
or yours except additional array
$info = $client->__call($method, $parameters);
edit: assuming https://stackoverflow.com/a/5409465/1152471 error on server side, because server sends header not compatible soap 1.2 standard.
maybe have use third party library or simple sockets working.
Comments
Post a Comment