Skip to content
Advertisement

Failed to call XML Soap using PHP SoapClient

I’m trying to call SOAP xml using PHP SoapClient. However, I got the error of

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class ” for connect URL ‘null’

This is my code for using SoapClient.

JavaScript

But I have successfully sent a SOAP request to the server using curl. This is my code.

JavaScript

Within the try block, I parse the xml into an array. However, this will only happen if the XML response return the intended data. I want to get the message of the fault string of the XML of this.

JavaScript

Can somebody help me to parse the fault error of the XML or find a way to successfully connect using SoapClient? Thank you.

Advertisement

Answer

I have found a way to get the error message of the xml.

JavaScript

This will then return:

{“faultstring”:”Authentication Failure”,”detail”:”Invalid Credentials”}

This may not be the best solution, but for now this works for me.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement