Dear all,
I'd like to add some wfs stores to my Geoserver (I'm using the 2.1 version).

The wsf servers I'm trying to connect are those listed here:  http://geoserver.org/display/GEOS/Available+WMS+and+WFS+servers
In particular I have successful added the following wfs stores:
 http://www.bsc-eoc.org/cgi-bin/bsc_ows.asp?version=1.0.0&service=WFS&request=GetCapabilities
and
 http://map.ns.ec.gc.ca/MapServer/mapserv.exe?map=/mapserver/services/envdat/config.map&service=WFS&version=1.0.0&request=GetCapabilities

but I can't publish any layer because in any case I have the following error:
Could not list layers for this store, an error occurred retrieving them: null

I have also tried to connect to these stores by Java code (using rest and geotools 2.7.1 api)
Here follow a fragment of my code:

        ...
        Map connectionParameters = ....
        DataStore data = "" connectionParameters );
        String typeNames[] = data.getTypeNames();
        for (int i = 0; i < typeNames.length; i++) {
            FeatureSource<SimpleFeatureType, SimpleFeature> source = data.getFeatureSource(typeNames[i]);
            URL url = "" URL (source.getInfo().getSchema().toString());
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            Schema schema = SchemaFactory.getInstance(url.toURI(), conn.getInputStream());
            //the method getJsonLayerWfs return the json representing the feature type to publish
            String json =getJsonLayerWfs(workspaceName, dataStoreName, schema);
            String uri = "http://192.168.11.228:8080/geoserver/rest/workspaces/enggis/datastores/wfsStore/featuretypes/";
            geoserverPoster.getWorkspaceClient().createPostEntity(uri, json, "text/json");
        }
        ...


Using this code on the capabilities urls earlier mentioned I'm able to get the feature type description (and the schema) and so create the corresponding json for each feature type in that wfs server.
But the code fails when executing "createPostEntity" which returns an internal server error (status code 500), and by this point of view, I have the same behavior when using the geoserver web client interface. The difference is that, in this case, in the datastore folder located under the GEOSERVER_DATA_DIR, I can found the file "featureType.xml" describing the feature type but not the file "layer.xml" because the operation fails.

In this case which could be the failure reason? And how can I avoid this kind of situation?

Thanks,

Marianna Borriello
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to