Forum Discussion
StainlessSteelR
Nimbostratus
Feb 04, 2004LBMethod
Hi there,
I'm trying to create a pool using the SOAP call 'create' in Java. The method signature from the iControl docs mentions the parameter lb_method which seems to want the LBMethod class.
void create(
in SessionCredentials creds, <== CORBA Specific
in String pool_name,
in LBMethod lb_method,
in IPPortDefinition[] members
);
However, it doesn't seem to exist in the ITCMLocalLB package. I'm using the code below, but I get an invalid argument error message from the SOAP call. (I'm passing the lb_method parameter as an Integer instead of the LBMethod class.)
String urn = "urn:iControl:ITCMLocalLB/Pool";
_call.setTargetObjectURI(urn);
_call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
_call.setSOAPMappingRegistry(_soap_registry);
_call.setMethodName("create"); //
IPPortDefinition[] ips = pool.getNodeIPs();
Vector params = new Vector();
params.addElement(new Parameter("pool_name", String.class, pool.getName(), null));
params.addElement(new Parameter("lb_method", Integer.class, "0", null));
params.addElement(new Parameter("members", IPPortDefinition[].class, ips, null));
_call.setParams(params);
Anybody got any ideas??
Cheers,
Stuart
- StainlessSteelR
Nimbostratus
Ok, now I'm getting a 'No Seralizer' error for the LBMethod class. So I'm guessing the classes in the support.SOAP.java.shared.ITCMLocalLB package are serializable and the classes in the com.f5.ITCM.ITCMLocalLB are not. - StainlessSteelR
Nimbostratus
Hey Joe, cheers for the reply.String urn = "urn:iControl:ITCMLocalLB/Pool"; _call.setTargetObjectURI(urn); _call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); _call.setSOAPMappingRegistry(_soap_registry); _call.setMethodName("create"); // IPPortDefinition[] ips = pool.getNodeIPs(); Vector params = new Vector(); params.addElement(new Parameter("pool_name", String.class, pool.getName(), null)); params.addElement(new Parameter("lb_method", LBMethod.class, LBMethod.LB_METHOD_ROUND_ROBIN, null)); params.addElement(new Parameter("members", IPPortDefinition[].class, ips, null)); _call.setParams(params);
- Sorry I didn't catch this sooner, I haven't been in the java/SOAP code for quite a while...
... Integer LB_METHOD_ROUND_ROBIN = 0; Integer LB_METHOD_RATIO = 1; Integer LB_METHOD_FASTEST = 2; Integer LB_METHOD_RATIO_MEMBER = 3; Integer LB_METHOD_LEAST_CONN_MEMBER = 4; Integer LB_METHOD_OBSERVED_MEMBER = 5; Integer LB_METHOD_PREDICTIVE_MEMBER = 6; Integer LB_METHOD_OBSERVED_NODE_ADDR = 7; Integer LB_METHOD_PREDICTIVE_NODE_ADDR = 8; Integer LB_METHOD_DYNAMIC_RATIO = 9; ... params.addElement(new Parameter("lb_method", Integer.class, LB_METHOD_ROUND_ROBIN, null)); ...
- StainlessSteelR
Nimbostratus
Ok, so I've just found it. I've been importingimport support.SOAP.java.shared.*; import support.SOAP.java.shared.ITCMCommon.*; import support.SOAP.java.shared.ITCMLocalLB.*;
import com.f5.ITCM.ITCMLocalLB.LBMethod;
- Great. Please let us know what kind of application you are working on. Understanding what our customers are doing help us make better products for the future!
- The com.f5.* classes are for our CORBA clients so they won't do you much good if you are going the SOAP route. All the serializers should be included in the support/SOAP/java/shared directory. The LocalLBPool.java sample code illustrates how to query the lb_method for pool. Remember to use the SOAPMappingRegistry implementation we distribute in the shared directory to make sure that the namespaces are correctly matched to the serializer types.
private iControlSOAPMappingRegistry smr = new iControlSOAPMappingRegistry(); . . . call.setSOAPMappingRegistry(smr);
Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects