Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I can't seem to add a WFS layer like this. It works when i copy all this code locally but as soon as i change the values to point to my own layer within my own GeoServer

this is the response viewed in firebug:

Could not locate {http://www.mydomain.com/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=catalog:dataSAR}dataSAR in catalog

This is the relevant part of my javascript:

    var wfs = new OpenLayers.Layer.Vector("WFS", {
        strategies: [new OpenLayers.Strategy.BBOX()],
        protocol: new OpenLayers.Protocol.WFS({
            url: "http://www.mydomain.com/geoserver/wfs",
            featurePrefix:"catalog",
            featureType: "dataSAR",
            featureNS: "http://www.mydomain.com/geoserver/wfs/DescribeFeatureType?version=1.1.0&typename=catalog:dataSAR",
            geometryName: "bounds"

        }),
        styleMap: new OpenLayers.StyleMap({
            strokeWidth: 3,
            strokeColor: "#333333"
        })
    })

    map.addLayers([basemap, wfs]);
    map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

And this is what my DescribeFeature (featureNS) looks like:

  <?xml version="1.0" encoding="UTF-8" ?> 
- <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:catalog="catalog" xmlns:cite="http://www.opengeospatial.net/cite" xmlns:cstars="cstars" xmlns:demo="demo" xmlns:geointcomp="geointcomp" xmlns:gml="http://www.opengis.net/gml" xmlns:gn="http://geonetwork-opensource.org" xmlns:osm="osm" xmlns:test="test" xmlns:topp="http://www.openplans.org/topp" elementFormDefault="qualified" targetNamespace="catalog">
  <xsd:import namespace="http://www.opengis.net/gml" schemaLocation="http://www.mydomain.com:80/geoserver/schemas/gml/3.1.1/base/gml.xsd" /> 
- <xsd:complexType name="dataSARType">
- <xsd:complexContent>
- <xsd:extension base="gml:AbstractFeatureType">
- <xsd:sequence>
  <xsd:element maxOccurs="1" minOccurs="0" name="id" nillable="true" type="xsd:int" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="type" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="name" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="altId" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="arcId" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="startDate" nillable="true" type="xsd:dateTime" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="endDate" nillable="true" type="xsd:dateTime" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="boundsText" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="acqLocation" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="bounds" nillable="true" type="gml:GeometryPropertyType" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="arcLocation" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="procLocation" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="procVersion" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="procLevel" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="dataFormat" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="sensingMode" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="beamCount" nillable="true" type="xsd:int" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="beamId" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="beamMnemonic" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="polarisationMode" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="polarisationChannels" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="antennaLookDirection" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="flightDir" nillable="true" type="xsd:string" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="orbitNum" nillable="true" type="xsd:int" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="incidenceAngleVariable" nillable="true" type="xsd:decimal" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="minimumIncidenceAngle" nillable="true" type="xsd:decimal" /> 
  <xsd:element maxOccurs="1" minOccurs="0" name="maximumIncidenceAngle" nillable="true" type="xsd:decimal" /> 
  </xsd:sequence>
  </xsd:extension>
  </xsd:complexContent>
  </xsd:complexType>
  <xsd:element name="dataSAR" substitutionGroup="gml:_Feature" type="catalog:dataSARType" /> 
  </xsd:schema>
share|improve this question

1 Answer 1

up vote 3 down vote accepted

You need the actual URI/URL for your workspace. From your DescribeFeature Schema it looks like "catalog" which is weird. The other option is to go to the workspace menu in the UI and look there

enter image description here

share|improve this answer
    
Where do i put my URI? It was "catalog" and i changed it to "mydomain.com/catalog"; –  CaptDragon Mar 4 '11 at 20:13
    
Duh: ofcourse as my featureNS Thanks! –  CaptDragon Mar 4 '11 at 20:17
1  
so, can you please paste your code in order to understand better the modifies you did? thank you –  Michele 2 May 7 '12 at 17:00

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.