Forum Discussion

haeoraki_127471's avatar
haeoraki_127471
Icon for Nimbostratus rankNimbostratus
Apr 09, 2004

get_availability() and get_state()?

get_availability and get_state method exists in iControl-4.5\iControl-4.5\sdk\support\java\ITCM\lib\ITCM.jar file, which is for CORBA.

 

 

I couldn't find any get_availability and get_state method at iControl-4.5\iControl-4.5\sdk\support\SOAP directory.

 

 

If I work with SOAP, can't I use get_availability and get_state methods? If not, why can't I find get_availability and get_state there?
  • As you noticed, the CORBA method bindings in the file sdk/support/java/ITCM/lib/ITCM.jar. CORBA is a tightly coupled language where you need strong bindings on the client and the server. SOAP, on the other had, is very loosely coupled. The method signatures are defined in the WSDL description files(sdk/support/wsdl) and depending on your client language, there may or may not be bindings for them created to help the toolset. Perl and Apache SOAP do not use client bindings while VS.NET does. It's up to the toolset to generate those bindings from the WSDL documents.

     

     

    You'll be able to find reference applications for the ITCMLocalLB::get_state() method in the LocalLBNode sample application included in the following directories of the SDK:

     

     

    /sdk/support/SOAP/perl/LocalLB/

     

    /sdk/support/SOAP/java/LocalLB/

     

    /sdk/support/SOAP/DOTNET/C/console/LocalLB/LocalLBNode/

     

    /sdk/support/SOAP/DOTNET/VB/console/LocalLB/LocalLBNode/

     

     

    -Joe
  • I couldn't find any reference applications for the get_state() and get_availability() method at iControl-4.5\iControl-4.5\sdk\support\SOAP\java.

     

     

    I work with SOAP and use java language. If I do, is the toolset needed to generate those bindings from the WSDL documents?

     

     

    Please give me some articles related this problem.
  • Apache SOAP is not strongly bound on the client. It relies on attrbutes to the "Call" object to set method names. As I mentioned in my last message, the LocalLBNode.java file contains a reference to the "get_state()" method. This sample used a wrapper method to retrieve attributes of the Node.

    The getProperty method in this class is overloaded to call mulitple property accessors. Look in the method for getNodeState for the line this.getProperty("state", Integer.class);

    I'm not too happy with the format of this sample application because it's use of overloading the property method makes it a bit more difficult to read. I'm going to look into making this application a bit more uniform like the other ones. In the meantime, here is a snippet of how to use the get_state() method:

    . 
     . 
     . 
     Call call; 
     Vector params = new Vector(); 
     URL urii; 
     String uri_ns; 
     IPPortDefinition nodeDef = new IPPortDefinition("10.10.10.10", 80); 
      
     uri = new URL("https://bigip_address/iControl/iControlPortal.cgi"); 
     uri_ns = new String("urn:iControl:ITCMLocalLB/Node"); 
      
     // Set Call Attributes 
     params.addElement(new Parameter("node_def", IPPortDefinition.class, nodeDef, null)); 
     call.setParams(params); 
      
     call.setMethodName("get_state"); 
      
     // Invoke Method 
     Response soapResponse = call.invoke(uri, uri_ns); 
      
     // Extract Results 
     Integer result = (Integer)soapResponse.getReturnValue().getValue(); 
     if ( 1 == result.longValue() ) 
     { 
         System.out.println("State : ENABLED\n"); 
     } 
     else if ( 0 == result.logValue() ) 
     { 
         System.out.println("State : DISABLED\n"); 
     } 
     . 
     . 
     . 
     

    Hope this helps..

    -Joe