nigelm / broadworks_ocip

Broadworks OCI-P API
Other
16 stars 12 forks source link

Command fails for request with empty parameter #19

Closed jezzp closed 1 year ago

jezzp commented 1 year ago

Description

Attempting to clear the locationDiallingCode field in Group Profile.

What I Did

>>> api.command(
            "GroupModifyRequest",
            service_provider_id=entId,
            group_id=groupId,
            location_dialing_code="")

Results in BroadWorks returning error: [Error 6004] OCI XML Request validation error - string length (0) is less than minLength facet (1) for LocationDialingCode

This is the XML being produced:

>>> gmr = api.get_command_object("GroupModifyRequest",service_provider_id="XXXXXX", group_id="YYYYYYY", location_dialing_code="")
>>> gmr.build_xml_()
`b'<?xml version=\'1.0\' encoding=\'ISO-8859-1\'?>\n<BroadsoftDocument xmlns="C" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" protocol="OCI"><sessionId xmlns="">5e64eaa7-8964-43e1-a278-4d0e3cfd71cd</sessionId><command xmlns="" xsi:type="GroupModifyRequest"><serviceProviderId>XXXXXXX</serviceProviderId><groupId>YYYYYYYY</groupId><locationDialingCode></locationDialingCode></command></BroadsoftDocument>'

XML should for the locationDialingCode should look like this: <locationDialingCode xsi:nil="true"/>

jezzp commented 1 year ago

Apologies, I've realised I need to include the following: from null_object import Null