exception - PHP SoapClient "Body must be present in a SOAP envelope" error -
i faced strange issue when tried use php soapclient service http://bws.neteven.com/nws/2.
i have setup authentication header. request body should empty. code, used below:
$client = new soapclient("http://bws.neteven.com/nws/2", array("trace" => 1, "exception" => 1)); $auth = array(//the params not valid of course 'method' => 'testconnection', 'login' => 'login', 'seed' => 'seed', 'stamp' => 'stamp', 'signature' => 'signature' ); $client->__setsoapheaders(new soapheader('auth', 'authenticationheader', $auth)); $client->__soapcall('testconnection',array(null)); after used $client->__getlastrequest() see final xml of request. can see header , body params not setup properly. $client->__getlastrequest() outputs plain text this:
methodtestconnectionloginloginseedseedstampstampsignaturesignature which doesn't valid xml. of course soapfault exception text "body must present in soap envelope".
does knows why header , body not wrapped required xml tags?
any issue in code? because saw lots of examples of php soapclient usage same approach. in addition tried few test wsdl services , had valid requests , responses there.
could problem of provided wsdl schema?
or problem of server configuration? use php 5.6.3, php_soap extension enabled.
hope guys can me. thoughts appreciated.
thank you.
the code example found has different url...
http://bws.neteven.com/nws/2 vs http://ws.neteven.com/nws
$client = new soapclient("http://ws.neteven.com/nws", array("trace" => 1, "exception" => 1)); $auth = array(//the params not valid of course 'method' => 'testconnection', 'login' => 'login', 'seed' => 'seed', 'stamp' => 'stamp', 'signature' => 'signature' ); $client->__setsoapheaders(new soapheader('auth', 'authenticationheader', $auth)); $client->__soapcall('testconnection',array(null)); also, can call methods without using __soapcall (even though doing same thing).
$result = $client->echo(array("echoinput" => "returnme")); var_dump($result->echooutput); $result = $client->testconnection(); var_dump($result->testconnectionresult);
Comments
Post a Comment