Forum Discussion

anoopadr_5344's avatar
anoopadr_5344
Icon for Nimbostratus rankNimbostratus
Jun 16, 2008

Unable to set values on a http profile

Hi,

 

 

I am trying to create a new http profile and enable the insert_xforwarded_for_header_mode for that profile.

 

 

Using the methods,

 

 
 String[] newProfile = new String[]{profileName}; 
 localLBProfileHttpBindingStub.create(newProfile); 
 localLBProfileHttpBindingStub.set_insert_xforwarded_for_header_mode(newProfile, modes); 
 

 

the new profile is created, but the xff header is not set even though the modes has value LocalLBProfileMode.PROFILE_MODE_ENABLED.

 

The xff header is set to the same as its parent http profiles value by default.

 

 

How can I enable this from the java code.

 

 

thanks,

 

AJ

3 Replies

  • Are you saying that the code works and the checkbox is set in the GUI, but the xff header isn't getting inserted into the http request to your web servers?

     

     

    If that's the case, then have you verified that you've applied this http profile to your virtual server? If so and it's still not working, this this really isn't a question on the API but you might need to get in touch with product support to see why the feature on the device isn't working.

     

     

    Now, if you are saying that the checkbox isn't getting set in the GUI, then what are you specifying for the default_flag value in the ProfileMode structure? Try setting that to 0.

     

     

    LocalLBProfileProfileModemode = new LocalLBProfileProfileMode(); 
     mode.default_flag = 0; 
     mode.value = LocalLBProfileMode.PROFILE_MODE_ENABLED; 
     LocalLBProfileProfileMode [] modes = new LocalLBProfileProfileMode[]{mode}; 
      
     LocalLBProfileHttpBindingStub.set_insert_xforwarded_for_header_mode(newProfile, modes);

     

     

    I haven't tested this in Java, so I apologize in advance for any syntax errors.

     

     

    -Joe
  • Great! That default flag needs to be set to false if you want to override the default behavior.

     

     

    -Joe
  • Hi. Where to see this property in GUI? Is it applicable for SSL profile also?