0

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)

The Hungry Dictator
  • 3,444
  • 5
  • 37
  • 53
  • The error gives you a good hint. You should *catch* that exception as it seems to be required. – DarkCygnus Jul 03 '17 at 15:52
  • Possible duplicate of [How to get rid of "Uncaught SoapFault exception: \[Client\] looks like we got no XML document in..." error](https://stackoverflow.com/questions/2540438/how-to-get-rid-of-uncaught-soapfault-exception-client-looks-like-we-got-no-x) – DarkCygnus Jul 03 '17 at 15:59
  • $response = $soapClient->__soapCall($className, array($inputParams)); getting error Like looks like we got no XML document $response = substr($soapClient->__getLastResponse(), 3); but in last response we are getting response . is this correct. – sravan kumar Jul 04 '17 at 13:13

0 Answers0