Forum Discussion

jwilnerzon_4845's avatar
jwilnerzon_4845
Icon for Nimbostratus rankNimbostratus
Apr 09, 2010

Adding new Zone Files using iControl problem

Hi!

 

I am having problems creating new Zones (zonefiles) using iControl (JAVA). It seems to me that I am to use the method:

 

 

add_zone_file (Management.Zone.add_zone_file)

 

 

and my code basically looks like this trying to add the test.se domain:

 

 

ManagementZoneBindingStub stub = (ManagementZoneBindingStub) new ManagementZoneLocator().getManagementZonePort(new URL(connectUrl));

 

 

ManagementZoneInfo zone_info = new ManagementZoneInfo();zone_info.setZone_type(ManagementZoneType.MASTER); zone_info.setZone_name("test.se.");

 

zone_info.setView_name("external");

 

 

ManagementZoneInfo[] mzi = new ManagementZoneInfo[]{zone_info}; stub.add_zone_file(mzi, new String[]{"test.se."}, new boolean[]{false});

 

 

I know that the communcation is working (authentication etc.), but when I run this particular code I get the exception:

 

java.io.IOException: Non nillable element 'zone_file' is null.

 

 

From what I can tell in the SDK, this is how it should be done, or am I wrong? I am a bit confused about the second parameter, src_file_names, I am not sure of what it means. I have tried testing using "db.external.test.se" and others, but nothing seems to work. Could you please clarify on how this should be done?

 

 

Thanks in advance for your help on this important matter,

 

 

/Jonas