cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
717
Views
0
Helpful
1
Replies

Best practices for AXL connection handling

Wolfy
Level 1
Level 1

Hi,

 

I am developing a Java application, which communicates via AXL using various requests.

The app generates AXLPort objects on startup stores them in the memory and uses the appropriate one every time a request needs to be sent. Since we have quite a few Cisco clusters (CUCMs and SMEs) to communicate with and one AXLPort object is ~30MB, this amount of data uses a significant amount of memory.

That made me wonder if maybe there is a better way to handle the AXL connections. Is there a "Best practices" doc somewhere for this or can somebody give me some advice how could I enhance this?

 

This is how the objects are generated, and the ClusterConnect objects are stored is HashMaps.

	public ClusterConnect(String host, String port, String appUser, String password) {
		axlPortCUCM = new AXLAPIService().getAXLPort();
		axlPortIMP = new AXLAPIService().getAXLPort();
		this.host = host;
		this.port = port;
		this.appUser = appUser;
		this.password = password;
		init();
	}

	private void init() {
		String validatorUrlHost = "https://" + host + ":" + port + "/axl/";
		((BindingProvider) axlPortCUCM).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, validatorUrlHost);
		((BindingProvider) axlPortCUCM).getRequestContext().put(BindingProvider.USERNAME_PROPERTY, appUser);
		((BindingProvider) axlPortCUCM).getRequestContext().put(BindingProvider.PASSWORD_PROPERTY, password);
	}

Best regards,

Balázs

1 Reply 1

dstaudt
Cisco Employee
Cisco Employee

A few thoughts:

- Not sure what the impact would be, but can you redo the 

.getRequestContext().put()

steps dynamically using the specific address/credentials each time you make a request, therefore sharing a single object?

- It is possible to manually prune the AXL WSDL/XSD to remove references to operations and objects your app doesn't use.  This can reduce the footprint of the resulting stub by an order of magnitude, but requires some knowledge of WSDL/XSD schemas in order to prune correctly

- If the actual AXL operations you use are a reasonably small number, it may be easier to just interact with AXL as an HTTP+XML interface (vs. going the full compile-the-WSDL route,)  building/parsing the XML requests/responses from a set of templates as XML doms (or just string substitution) and sending via simple HTTP request.