Forum Discussion

Jim_Gore_43214's avatar
Jim_Gore_43214
Icon for Nimbostratus rankNimbostratus
Oct 03, 2006

LocalLB.ProfileStream.set_target_string ??

Hello,

 

 

I have the following perl subroutine that I am testing to set the target in a stream profile:

 

 

sub setTarget()

 

{

 

push (@profileName, "ocm_reject_stream");

 

 

$targetValue = "\@test1\@test2\@";

 

$defaultFlag = FALSE;

 

 

$newTarget =

 

{

 

value => $targetValue,

 

default_flag => $defaultFlag

 

};

 

 

$soapResponse = $LocalLBProfileStream->set_target_string

 

(

 

SOAP::Data->name(profile_names => [@profileName]),

 

SOAP::Data->name(targets => [$newTarget])

 

);

 

 

&checkResponse($soapResponse);

 

}

 

 

 

When I run this I don't get any errors but the stream profile's target is not replaced but is reset to nothing.

 

 

Any help would be greatly appreciated!

 

 

Jim

 

 

 

2 Replies

  • Ahh, another perl boolean question. I'll have to put a tech tip up for this one.

     

     

    Perl (or SOAP::Lite) doesn't know how to convert the string "FALSE" to it's boolean equivalent. For some reason it always passes "true" no matter what you pass in. You can verify this with the SOAP::Lite debugging enabled

     

     

    The server code converts the string to a number and defaults to 1 which is true for the default_flag. Since the server thinks the default flag is 1, it ignores the value passed in and sets it to blank.

     

     

    The simple fix is to replace the "FALSE" assignment with a "0" and you should be set.

     

     

    ...
    $newTarget =
    {
      value => $targetValue,
      default_flag => 0
    };

     

     

    -Joe