3

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>
3

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

  • Where do i put my URI? It was "catalog" and i changed it to "mydomain.com/catalog" – CaptDragon Mar 4 '11 at 20:13
  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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