bizna
bizna

Reputation: 712

PHP SoapClient showing empty values when there is XML content

I am trying to get all the properties (GetAllProperties) of a certain job (inJobID). All the simple strings and digits show up properly, but the XML entities are just omitted, as if they are not there.

When echoing '$jobObj->__getLastResponse()' then the XML is there, but for some reason it disappears when trying to retrieve it.

The code is very basic:

$params->inUsername ='TheUser';
$params->inPassword ='ThePassword';
$params->inJobID = 184;
$jobObj = new SoapClient('http://SERVERNAME/job_ssp.asmx?wsdl', array('trace' => 1));

$Props = $jobObj->GetAllProperties($params);
print_r ($Props-> GetAllPropertiesResult);

This is an example of an output:

stdClass Object
(
    [GetAllPropertiesResult] => stdClass Object
        (
            [Property] => Array
                (
                    [0] => stdClass Object
                        (
                            [m_Name] => jobID
                            [m_Value] => 184
                        )

                    [2] => stdClass Object
                        (
                            [m_Name] => userID
                            [m_Value] => 2
                        )

                    [21] => stdClass Object
                        (
                            [m_Name] => jobParams
                            [m_Value] => 
                        )
                )
        )
)

The jobParams is always displayed as empty.

This is how it starts: <?xml version='1.0' encoding='utf-16'?>

There is probably something extremely basic that I am missing here, but right now I am utterly baffled.

Help please?

Addition: When using var_dump it shows that there are 3,579 characters in that string, but still does not show them:

[21]=> object(stdClass)#29 (2) { ["m_Name"]=> string(9) "jobParams" ["m_Value"]=> string(3579) "" }

Upvotes: 0

Views: 190

Answers (1)

Alex Kapustin
Alex Kapustin

Reputation: 2459

echo htmlspecialchars(print_r ($Props-> GetAllPropertiesResult, 1));

Upvotes: 1

Related Questions