we have soapclient connection problem. please check below xml and my php code and advice us. when we run in soap ui working well when are trying to run in local server not working.
working SoapUI XML request:
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Header>
<wsse:Security
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsu:Timestamp wsu:Id="TS-2">
<wsu:Created>2017-07-03T09:38:05.550Z</wsu:Created>
<wsu:Expires>2017-07-03T09:48:05.550Z</wsu:Expires>
</wsu:Timestamp>
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>xxxxxxx</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxxxxxxx</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<ns2:methodname
xmlns:ns2="http://ws.oprs.xxxxx.com/">
<arg0>
<actualClientIP>xxxxxx</actualClientIP>
<agentPanCard>xxxxxx</agentPanCard>
<userAuthKey>xxxxx</userAuthKey>
<userId>xxxxx</userId>
</arg0>
</ns2:methodname>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
above xml working fine in soap ui tool.
please check my php code.
private function apiMethodCall($url, $headerAuth, $className, $inputParams){
$soapClient = new SoapClient($url, $headerAuth);
$result = $soapClient->__soapCall($className, array($inputParams));
return $result;}
public function funcationName(){
$className = "methodname";
$headerAuth = array("UsernameToken"=>array("Timestamp"=>array("Created"=>"2017-07-03T09:40:00.550Z","Expires"=>"2017-07-03T09:50:00.550Z"),"UsernameToken"=>array("Username"=>"XXXXXX", "Password"=>"xxxxxxx")));
$inputParams =Array("arg0"=> Array("actualClientIP"=>"xxxxxx","agentPanCard"=>"xxxxxx","userAuthKey"=>"xxxxxxx","userId"=>"xxxxxx"));
$arr_chart = $this->apiMethodCall("http://xxxxxxxxxxxxx?wsdl", $headerAuth, $className, $inputParams);
print_r($arr_chart);
}
getting Below error
Fatal error: Uncaught SoapFault exception: [Client] looks like we got no XML document in
SoapClient->__soapCall('methodname', Array)