10-18-2019 06:08 AM
I have an php applican which is used to associate Users to Lines on a phone
This is used in an custom tab in jabber so everyone can decide if Jabber will show if a user is "on the phone" or not
We used an axlapi.wsdl from CUCM 8.5 for the last years which was working fine until we made an Update from CUCM to Version 11.5
Now only updateDeviceProfile is working but updatePhone is not
Here is the Client i defined to use in php to call the axl api
And this is the part where i call updatePhone and updateDeviceProfile and tell the api which parameters should be used
The syntax is completely the same except of the owne uer which can only be set for the phone.
I had a look into the axl logs of cucm
The log for updateDeviceProfile looks good:
But for updatePhone the complete line part is missing
I used the same code to make these calls against a CUCM 10.5 using an old axlapi.wsdl and everything was fine.
After changing the axlapi.wsdl to Version 10.5, 11.5 or 12.5 i hade the same error again
To check if the AXL API is working fine i used an C# application where i can send my own XML towards CUCM.
If i do so everything is workign fine, too.
It seems that the wsdl might be buggy
Has anyonene else ran into this issue?
Does anyone have a php application using updatePhone and can proof my error?
Solved! Go to Solution.
10-18-2019 11:46 AM
I believe this may be a problem in the PHP SoapClient implementation:
- In AXL 8.5, <lines> is a simple element:
- In AXL 10.5+, <lines> is enclosed in an <xsd:choice>, as there is now an option to instead provide (one of) <addLines> or <removeLines>:
- <add/removeLines> are marked as minOccurs="0" - it appears that PHP interprets this to mean that anything (including not being present) is 'valid' and so assumes that the first part of the <xsd:choice> is desired (which encloses <add/removeLines> )
- As a result, with the WSDL as-is, SoapClient will never let you select the second <xsd:choice> option, which is the <lines> element. The AXL log seems to confirm that, as there is no <lines> element in the request
- I believe the WSDL itself is valid (or at least arguably so), and it does work fine with many other WSDL consumers, and a quick search indicates there may be multiple issues extant with PHP and <xsd:choice>. If it is possible to try with the latest/greatest PHP and/or SoapClient versions, perhaps something has been fixed recently
Possible workarounds might include:
- This SO discussion seems to offer a possible solution with changing minOccurs="1" in the 11.5 WSDL itself: https://stackoverflow.com/questions/38616019/soapclient-does-not-generate-correct-request
- Modify your code logic to use <add/removeLines> (remove old line, add new one) instead of <lines>(which replaces the lines list with whatever you provide, e.g. the new line)
- Surgery on the 11.5 WSDL to remove the <xsd:choice> element altogether, and replace with just the <lines> element (be sure to use the 11.5 version)
- Abandon SoapClient altogether and manipulate the XML yourself :/
10-18-2019 11:46 AM
I believe this may be a problem in the PHP SoapClient implementation:
- In AXL 8.5, <lines> is a simple element:
- In AXL 10.5+, <lines> is enclosed in an <xsd:choice>, as there is now an option to instead provide (one of) <addLines> or <removeLines>:
- <add/removeLines> are marked as minOccurs="0" - it appears that PHP interprets this to mean that anything (including not being present) is 'valid' and so assumes that the first part of the <xsd:choice> is desired (which encloses <add/removeLines> )
- As a result, with the WSDL as-is, SoapClient will never let you select the second <xsd:choice> option, which is the <lines> element. The AXL log seems to confirm that, as there is no <lines> element in the request
- I believe the WSDL itself is valid (or at least arguably so), and it does work fine with many other WSDL consumers, and a quick search indicates there may be multiple issues extant with PHP and <xsd:choice>. If it is possible to try with the latest/greatest PHP and/or SoapClient versions, perhaps something has been fixed recently
Possible workarounds might include:
- This SO discussion seems to offer a possible solution with changing minOccurs="1" in the 11.5 WSDL itself: https://stackoverflow.com/questions/38616019/soapclient-does-not-generate-correct-request
- Modify your code logic to use <add/removeLines> (remove old line, add new one) instead of <lines>(which replaces the lines list with whatever you provide, e.g. the new line)
- Surgery on the 11.5 WSDL to remove the <xsd:choice> element altogether, and replace with just the <lines> element (be sure to use the 11.5 version)
- Abandon SoapClient altogether and manipulate the XML yourself :/
10-21-2019 11:43 PM
Instead of updating the line i just added it again with the new parameters i want to set.
Works now for me.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide