Skip to content
Advertisement

How do you make a SoapCall using the PHP Soap class client

I am attempting to make a SOAP call in PHP using the PHP Soap Client class. I managed to connect to the WDSL file however it isn’t accepting my parameters. Here are all the necessary information needed for this call. When I enter the following:

JavaScript

I get:

JavaScript

After reading the answer from: How to make a PHP SOAP call using the SoapClient class I have attempted the following:

JavaScript

I’ve also tried inputting “Credentials” as just an array instead of a class as some other answers have suggested like so:

JavaScript

It doesn’t seem to matter what I input for the parameters when I call $client->GetCourseInformation, as long as I provide a parameter in the structure of an array it always gives me the same output which is:

JavaScript

Using Postman I’ve been able to get the expected output so that leads me to believe that I am not providing a certain parameter. Lastly here is the body I provide in Postman to get the expected output with content type being text/xml:

JavaScript

Is there something I’m not providing? Or does this problem have something to do with the API itself?

Advertisement

Answer

This question has been solved. The answer was in the body provided in Postman.

JavaScript

The RQ was never provided so it didn’t know how to read the provided parameter. To fix this we simply have to change this:

JavaScript

To this:

JavaScript

This was a very specific question but I hope this helps someone in the future.

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