Forum Discussion

Ian_McKenna_113's avatar
Ian_McKenna_113
Icon for Nimbostratus rankNimbostratus
May 18, 2006

why is ProfilePersistence- create not working?

Hi it's me again,

 

 

I am trying to create a Persistence Profile, using:

 

 

--------------------------------------------

 

my $ProfileCreate = SOAP::Lite

 

-> uri('urn:iControl:LocalLB/ProfilePersistence')

 

-> proxy("$sProtocol://$sHost:$sPort/iControl/iControlPortal.cgi");

 

eval { $ProfileCreate->transport->http_request->header

 

(

 

'Authorization' =>

 

'Basic ' . MIME::Base64::encode("$sUID:$sPWD", '')

 

); };

 

my $sName = "testprof";

 

my $sMode = "0";

 

my $soapResponse = $ProfileCreate->create(

 

SOAP::Data->name( profile_names => [$sName] ),

 

SOAP::Data->name( modes => [$sMode])

 

);

 

&checkResponse($soapResponse);

 

print "Persistence Profile Created !\n";

 

----------------------------------------------------

 

 

this is not working. I am receiving the

 

------------------------------------------------------

 

Exception: Common::OperationFailed

 

primary_error_code : 16908342 (0x01020036)

 

secondary_error_code : 0

 

error_string : 01020036:3: The requested persistence profile (persist) was not found.

 

--------------------------------------------------------

 

 

exception. This is a bit confusing, because I want to create it in the first place.

 

Any clue what I am doing wrong?

 

 

Ian

1 Reply

  • I'll have to look into that message as I agree it's not very intuitive.

     

     

    As for your code, you are close. You'll need to pass the string literal value for the PersistenceMode parameter. In 4.x, enums were represented by their numeric values. In 9.x we moved to the string values as we found it more intuitive.

     

     

    In your code, you were passing in the mode of value 0 or (PERSISTENCE_MODE_NONE). Are you sure that is what you wanted to do? If so, this should work:

     

     

    my $sName = "testprof";
    my $sMode = "PERSISTENCE_MODE_NONE";
    my $soapResponse = $ProfileCreate->create(
      SOAP::Data->name( profile_names => [$sName] ), 
      SOAP::Data->name( modes => [$sMode])
    );

     

     

    Not sure why you'd want to create a persistence profile of type none, but that's how it's done. To create a cookie persistence profile, use this:

     

     

    my $sName = "testprof";
    my $sMode = "PERSISTENCE_MODE_COOKIE";
    my $soapResponse = $ProfileCreate->create(
      SOAP::Data->name( profile_names => [$sName] ), 
      SOAP::Data->name( modes => [$sMode])
    );

     

     

    -Joe