marcinn

WFSToFeatureClass - Java

Discussion created by marcinn on Dec 5, 2011
Latest reply on May 4, 2012 by TomLUX
Hello,
I've got a problem with execute WFSToFeatureClass Tool in Java. My code looks like below:

For Geoprocessor:
 
GeoProcessor gp = new GeoProcessor();
gp.addToolbox("C:/Program Files/ArcGIS/ArcToolBox/Toolboxes/Conversion Tools.tbx");

WFSToFeatureClass wfs = new WFSToFeatureClass();
wfs.setInputWFSServer("http://10.10.22.102:8399/arcgis/services/ITSNTP_ITSPROD/MapServer/WFSServer");
wfs.setWFSFeatureType("GITSLUPEK");
wfs.setOutPath("C:\\test3.gdb");
wfs.setOutName("Slupek");
                  
gp.execute(wfs, null);


The same code and parameters works corectly for Python Script.
The same code with another tool works corectly in Java.

For GeoTools:
ToolboxWorkspaceFactory factory = new ToolboxWorkspaceFactory();
IToolboxWorkspace toolboxWorkspace = new IToolboxWorkspaceProxy(factory.openFromFile("C:/Program Files/ArcGIS/ArcToolBox/Toolboxes", 0));
IGPToolbox toolbox = toolboxWorkspace.openToolbox("Conversion Tools.tbx");
IGPTool tool = toolbox.openTool("WFSToFeatureClass");
                    
Array values = new Array();
                    
GPString inputWFS = new GPString();
GPString inputFeature = new GPString();
GPString outputLoc = new GPString();
GPString outputFeature = new GPString();
                    
inputWFS.setValue("http://10.10.22.102:8399/arcgis/services/ITSNTP_ITSPROD/MapServer/WFSServer");
inputFeature.setValue("GITSlupek");
outputLoc.setValue("C:\\test3.gdb");
outputFeature.setValue("Slupek");
                    
values.add(inputWFS);
values.add(inputFeature);
values.add(outputLoc);
values.add(outputFeature);
                    
tool.execute(values, null, null, null);


Any one could tell me why it doesnt works?
I've got, in case of geoprocessor, this error:
AutomationException: 0x80004005 - Unspecified error
at com.esri.arcgis.geoprocessing.GeoProcessor.execute(Unknown Source)

Outcomes