logo       

NuSOAP does not return XML attribute to array: msg#00087

php.nusoap.general

Subject: NuSOAP does not return XML attribute to array

Hi All,

 

I have a web service running to get phone details from Cisco AXL. But NuSOAP doesn’t seem to parse the complex XML response attribute into the array. For example :

<device ctiid="1580890216" uuid="{28F325B6-A872-47B3-80D3-8034554F5F5A}"></device>

I wont be able to get the value for the ctiid and the uuid. Please see below:

Response

HTTP/1.1 200 OK
Content-Type: text/xml
Content-Length: 2817
 
<SOAP-ENV:Envelope  xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body>
<axl:getPhoneResponse  xmlns:axl="http://www.cisco.com/AXL/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.cisco.com/AXL/1.0 http://G1-CCM1-MCS7835/CCMApi/AXL/V1/axlsoap.xsd">
<return>
<device  xsi:type="axl:XIPPhone" ctiid="1580890216" uuid="{28F325B6-A872-47B3-80D3-8034554F5F5A}">
<name>SEP00036BC38X00</name>
<description>Hello</description>
<product>Cisco 7960</product>
<model>Cisco 7960</model>
<class>Phone</class>
<protocol>Cisco-station</protocol>
<lines>
<line  uuid="{468AA98A-380D-4805-B7E4-F277BD05FE01}" index="1">
<label>Hello</label>
<display>Hello World</display>
<dirn  uuid="{44D0EAC2-68EC-4C27-9270-E3D8D6DF5AAD}"></dirn>
<ringSetting>Use System Default</ringSetting>
<consecutiveRingSetting>Use System Default</consecutiveRingSetting>
</line>
</lines>
<speeddials></speeddials>
<addOnModules></addOnModules>
<deviceSecurityMode>Use System Default</deviceSecurityMode>
</device>
</return>
</axl:getPhoneResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

 

When doing print_r() I get the following:

 

Array
(
    [device] => Array
        (
            [name] => SEP00036BC38X00
            [description] => Hello
            [product] => Cisco 7960
            [model] => Cisco 7960
            [class] => Phone
            [protocol] => Cisco-station
            [lines] => Array
                (
                    [line] => Array
                        (
                            [label] => Hello
                            [display] => Hello World
                            [dirn] => 
                            [ringSetting] => Use System Default
                            [consecutiveRingSetting] => Use System Default
                        )
 
                )
 
            [speeddials] => 
            [addOnModules] => 
            [deviceSecurityMode] => Use System Default
        )
 
)

 

Is there a way around this?

 

Thanks,

Chhai

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise