Generic Axis method execution...

Is it possible to send a generic Axis service call to iControl? Perhaps someone can help me find my problem. I am basically adapting a “get_pool_status” to 9.x. What I am getting is:

13:16:36,220 ERROR [STDERR] AxisFault

faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client

faultSubcode:

faultString: Unknown method “{urn:iControl:ITCMGlobalLB/Pool}:get_enabled_state”

faultActor:

faultNode:

faultDetail:

{WebServices - Axis}stackTrace:Unknown method “{urn:iControl:ITCMGlobalLB/Pool}:get_enabled_state”

at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)

at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)

at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)

at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)

at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)

My code is as follows:

String endpoint = “https://” + host + “:443/iControl/iControlPortal.cgi”;

Service service = new Service();

Call call = (Call) service.createCall();

call.setTargetEndpointAddress(new java.net.URL(endpoint));

if (f5update)

{

call.setOperationName(new QName(“urn:iControl:ITCMGlobalLB/Pool”, “get_enabled_state”));

call.setUsername(user);

call.setPassword(passwd);

call.addParameter(“pool_name”, XMLType.SOAP_ARRAY, ParameterMode.IN);

call.setReturnType(XMLType.SOAP_ARRAY);

Integer[] reply = (Integer[]) call.invoke(new Object[] { pool });

result = (reply[1] == 1);

}

I tried building the iControl sdk, but ran into numerous errors due to “enum” being used as a variable, and I’m on JDK 1.5. Is there a known way around this?

Vince

Ok. I found my first issue and that is the parameter name “pool_name” instead of “pool_names”. Still no dice. Still battling with this. Any ideas?

The error “Unknown method” is the main indicator here. First, I’m assuming you are looking at GlobalLB Pools, Not LocalLB Pools. Either way, there is a get_enabled_state() method for each. The real problem you have is with the namespace “ITCMGlobalLB”. The “ITCM” prefix was for v4.x. For v9.x, it’s just GlobalLB.

call.setOperationName(new QName("urn:iControl:GlobalLB/Pool", "get_enabled_state"));

Oh, and you need to name the parameters correctly. This method takes a Array of Strings with the name of “pool_names”

Is there is a reason you aren’t using the iControl Java Library built on top of Axis? It’s available as a download from the iControl Assembly DevCentral Lab project. It basically wrapps all the compiled WSDL proxy code into a very easy to use interface.

-Joe

The only reason is lack of awareness of the iControl Assembly Lab project. F5 integration is just a small aspect of my project and the Lab area just wasn’t my first stop. I am migrating from 4.x code which used generic WS calls and there isn’t much to those either. But you have to get them exactly right. I do prefer the Assembly Lab API. It was very easy to integrate (15 minutes) and solved my problems exceptionally well. You’re a lifesaver Joe. Thanks.

Vince

Glad to help! There are certain situations where users want full control of the iControl code and can’t have another .jar included so that’s why I asked. The whole reason I wrote the java library was mailing self-serving in that it greatly reduces the number of questions asked regarding namespace prefixing and parameter packing which is a major pain if doing by hand.

Feel free to post anything else that comes up and we’ll see what we can do to help out.

-Joe