WFSLayer returns 0 features

2014
0
06-06-2016 02:21 PM
MichaelSchnack
New Contributor II

Having trouble adding a WFS layer with the javascript API.  Specifically the buildRequest seems to create a PropertyName value as ns2 with an empty string which can't be parsed by the server.

var opts = {

  "url": "http://bn00054001/spatialSTORM/spatialSUITE/v7_2_0/wfs",

  "nsLayerName": 'http://www.synchronoss.com/spatialSTORM|CADSymbol',

  "mode": "ondemand",

  "wkid": "4326",

  "version": "2.0.0",

  "showDetails": true,

  "infoTemplate": new InfoTemplate()

};

Request Body below shows empty ns2 string.  PropertyName value also gets literal "ns2".  It also seems that typeNames should have the value of ns1 rather than the literal "ns1":

<?xml version='1.0' encoding='utf-8'?>

<GetFeature

xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'

xmlns:gml='http://www.opengis.net/gml'

xmlns:ogc='http://www.opengis.net/ogc'

xmlns:wfs='http://www.opengis.net/wfs'

xmlns='http://www.opengis.net/wfs/2.0'

xmlns:ns1='http://www.synchronoss.com/spatialSTORM'

xmlns:ns2=''

version='2.0.0' service='WFS' count='100'>

<Query typeNames='ns1:CADSymbol' srsName='EPSG:4326'>

  <ogc:Filter xmlns:ogc='http://www.opengis.net/ogc'>

   <ogc:BBOX>

    <ogc:PropertyName>ns2:</ogc:PropertyName>

    <gml:Box srsName='EPSG:4326'>

      <gml:coordinates>-116.34078010156037,43.59423182567582 -116.06612189843577,43.632760003442755</gml:coordinates>

    </gml:Box>

   </ogc:BBOX>

  </ogc:Filter>

</Query>

</GetFeature>

In the Response Body below,  Line 9, position 12 refers to the empty string for ns2.

<Exception exceptionCode="OperationProcessingFailed" locator="System.Xml"><ExceptionText>Invalid namespace declaration. Line 9, position 12. :    at System.Xml.XmlTextReaderImpl.Throw(Exception e)

Proxy is working ok, and GetCapabilities returns a good response.

I've tried overriding the buildRequest using getFeatureRequest and getFeature URL below.  There is no exception, but no features are returned.

"getFeatureRequest": "<GetFeature xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:gml='http://www.opengis.net/gml' xmlns:ogc='http://www.opengis.net/ogc' xmlns:wfs='http://www.opengis.net/wfs' xmlns='http://www.opengis.net/wfs/2.0' xmlns:sps='http://www.synchronoss.com/spatialSTORM' version='2.0.0' service='WFS'> <Query typeNames='CADSymbol' srsName='EPSG:4326'><ogc:BBOX><ogc:PropertyName></ogc:PropertyName><gml:Box srsName='EPSG:4326'><gml:coordinates>-116.34078010156037,43.59423182567582 -116.06612189843577,43.632760003442755</gml:coordinates></gml:Box></ogc:BBOX></Query></GetFeature>",

"getFeatureUrl": "http://bn00054001/spatialSTORM/spatialSUITE/v7_2_0/wfs?version=2.0.0&request=GetFeature&typenames=CA..."

The URL above does return xml in the browser.

0 Kudos
0 Replies