Active IQ Unified Manager Discussions

Issue with "group-set-options" api.

kathick
2,796 Views

Hello,

I'm using Oncommand version: 5.1

I'm trying to set the options for a existing group via perl script and end up in following error.

"Extra content at the end of the document".

I tried the same thing with ZEDI and apitest and it works perfectly fine.

Here is the code snip.

  my $group_opt_elem = NaElement->new("group-set-options");

  $group_opt_elem->child_add_string("group-name-or-id", "s_test5");

  my $group_info_elem = NaElement->new("group-option-info");

  $group_opt_elem->child_add($group_info_elem);

  $group_info_elem->child_add_string("chargeback-rate", "10");

  print $group_opt_elem->sprintf();

  my $group_opt_out = $self->{dfm}->invoke($group_opt_elem);

  print $group_opt_out->sprintf();

$group_opt_elem->sprintf() and $group_opt_out->sprintf() gave the following XML

 

  <group-set-options>

        <group-name-or-id>s_test5</group-name-or-id>

        <group-option-info>

                <chargeback-rate>10</chargeback-rate>

        </group-option-info>

</group-set-options>

<results reason="Extra content at the end of the document " errno="13001" status="failed"></results>

XML generated by ZEDI (Works fine)

  <group-set-options>

    <group-name-or-id>

    s_test5

    </group-name-or-id>

    <group-option-info>

      <chargeback-rate>10</chargeback-rate>

    </group-option-info>

  </group-set-options>

 

What am i doing wrong? Appreciate your help on this.

Thanks,

Karthick 

1 REPLY 1

kathick
2,796 Views

Got it working. I have to replace "invoke" with "invoke_elem"

my $group_opt_out = $self->{dfm}->invoke($group_opt_elem);  This should be replaced by

my $group_opt_out = $self->{dfm}->invoke_elem($group_opt_elem);

Public