<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19046"></HEAD>
<BODY>
<DIV><SPAN lang=EN-GB>
<P><FONT size=2 face=Arial><SPAN class=621152414-15092011>Hi
Jorge,</SPAN></FONT></P>
<P><FONT size=2 face=Arial><SPAN class=621152414-15092011>I did the steps you
prescribed and - hey presto! - I can see my data. I can pan and zoom as
expected. Everything looks as it should; however...</SPAN></FONT><FONT
size=2 face=Arial><SPAN class=621152414-15092011>I still have a JavaScript
error:</SPAN></FONT></P>
<P><FONT size=2 face=Arial><SPAN class=621152414-15092011>Error:
this.layer.protocol.read is not a function<BR>Source File: <A
href="http://vmfiddich/openlayers-2.10/OpenLayers.js">http://vmfiddich/openlayers-2.10/OpenLayers.js</A><BR>Line:
1817</SPAN></FONT></P>
<P><FONT size=2 face=Arial><SPAN class=621152414-15092011>Any
ideas?</SPAN></FONT></P>
<P><FONT size=2 face=Arial><SPAN class=621152414-15092011>Thanks for your
input!!!</SPAN></FONT></P>
<P><FONT size=2 face=Arial><SPAN
class=621152414-15092011>Robin</SPAN></FONT></P>
<P><FONT size=2 face=Arial><SPAN
class=621152414-15092011>==============================================================</SPAN></FONT></P>
<P>Message: 2</P>
<P>Date: Thu, 15 Sep 2011 00:33:21 -0600</P>
<P>From: Jorge Gustavo <jgr@di.uminho.pt></P>
<P>Subject: Re: [OpenLayers-Users] Unable to see WFS layer created by</P>
<P>GeoServer</P>
<P>To: openlayers-users@lists.osgeo.org</P>
<P>Message-ID: <4E719C31.7020901@di.uminho.pt></P>
<P>Content-Type: text/plain; charset=ISO-8859-1; format=flowed</P>
<P>Hi Robin,</P>
<P>1)</P>
<P>Try to see if this URL works:</P>
<P></SPAN><A
href="http://vmfiddich:8081/geoserver/RobinTest/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=RobinTest:datazones_2001"><U><FONT
color=#0000ff size=2><FONT color=#0000ff size=2><SPAN
lang=EN-GB>http://vmfiddich:8081/geoserver/RobinTest/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=RobinTest:datazones_2001</U></FONT></FONT></SPAN></A></P><FONT
size=2><SPAN lang=EN-GB>
<P>2)</P>
<P>Get the xmlns:RobinTest location from the result, to put the same location in
featureNS</P>
<P>3) Use something like:</P>
<P>var wfs = new OpenLayers.Layer.Vector("Datazones 2001", {</P>
<P>strategies: [new OpenLayers.Strategy.BBOX()],</P>
<P>protocol: new OpenLayers.Protocol.WFS({</P>
<P>version: "1.1.0",</P>
<P>url: "</FONT></SPAN><A href="http://vmfiddich:8081/geoserver/wfs"><U><FONT
color=#0000ff size=2><FONT color=#0000ff size=2><SPAN
lang=EN-GB>http://vmfiddich:8081/geoserver/wfs</U></FONT></FONT></SPAN></A><FONT
size=2><SPAN lang=EN-GB>",</P>
<P>featureType: "datazones_2001",</P>
<P>featureNS: "location from step 2)",</P>
<P>geometryName: "the_geom",</P>
<P>schema: </P>
<P>"</FONT></SPAN><A
href="http://vmfiddich:8081/geoserver/RobinTest/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=RobinTest:datazones_2001"><U><FONT
color=#0000ff size=2><FONT color=#0000ff size=2><SPAN
lang=EN-GB>http://vmfiddich:8081/geoserver/RobinTest/wfs?service=WFS&version=1.0.0&request=DescribeFeatureType&typeName=RobinTest:datazones_2001</U></FONT></FONT></SPAN></A><FONT
size=2><SPAN lang=EN-GB>",</P>
<P>})</P>
<P>});</P>
<P>3.1)</P>
<P>Right now, you don't need to specify a style. OL will use the default style.
Later, when it works, put your own style. Keep it simple as possible for
now.</P>
<P>4)</P>
<P>In Firebug, check if the request is being done</P>
<P>5)</P>
<P>If not, or just in case, use a local proxy to ensure you are not using
different domains, i¨¦ OpenLayers.ProxyHost = "/cgi-bin/proxy.cgi?url=";</P>
<P>6)</P>
<P>Check once more the WFS post request and answer in Firebug</P>
<P>Good luck,</P>
<P>Jorge</P>
<P>¡¡</P>
<P>On 14-09-2011 09:03, Boyle Robin wrote:</P>
<P>> Hello list!</P>
<P>></P>
<P>> I am having difficulty adding a WFS layer that was created using </P>
<P>> GeoServer. i am using OpenLayers.Layer.Vector with WFS protocol. </P>
<P>> When I add a layer to OpenLayers from the WMS equivalent, it is fine.
</P>
<P>> My code is below. The layer datasource is a shapefile called</P>
<P>> datazones_2001 which resides in the RobinTest workspace.</P>
<P>></P>
<P>> ==========================================================</P>
<P>> var wfsLayer = new OpenLayers.Layer.Vector("Datazones 2001", {</P>
<P>></P>
<P>> strategies: [new OpenLayers.Strategy.BBOX()],</P>
<P>></P>
<P>> protocol: [new OpenLayers.Protocol.WFS({</P>
<P>></P>
<P>> url:</P>
<P>> "</FONT></SPAN><A
href="http://vmfiddich:8081/geoserver/RobinTest/ows"><U><FONT color=#0000ff
size=2><FONT color=#0000ff size=2><SPAN
lang=EN-GB>http://vmfiddich:8081/geoserver/RobinTest/ows</U></FONT></FONT></SPAN></A><FONT
size=2><SPAN lang=EN-GB>"</P>
<P>></P>
<P>> ,featureType: "RobinTest:datazones_2001"</P>
<P>></P>
<P>> , featureNS:</P>
<P>> "</FONT></SPAN><A href="http://vmfiddich:8081/geoserver/data"><U><FONT
color=#0000ff size=2><FONT color=#0000ff size=2><SPAN
lang=EN-GB>http://vmfiddich:8081/geoserver/data</U></FONT></FONT></SPAN></A><FONT
size=2><SPAN lang=EN-GB>"</P>
<P>></P>
<P>> , version: "1.0.0"</P>
<P>></P>
<P>> })],</P>
<P>></P>
<P>> styleMap: new OpenLayers.StyleMap({</P>
<P>></P>
<P>> strokeWidth: 3</P>
<P>></P>
<P>> ,strokeColor: "#333333"</P>
<P>></P>
<P>> })</P>
<P>></P>
<P>></P>
<P>> })</P>
<P>></P>
<P>> map.addLayer(wfsLayer);</P>
<P>></P>
<P>></P>
<P>> =========================================================</P>
<P>></P>
<P>> When I preview the layer in GeoServer as GML it produces valid GML. </P>
<P>> Any ideas???</P>
<P>></P>
<P>> Thanks in advance,</P>
<P>> Robin</P></FONT></SPAN></DIV>
<DIV> </DIV>
<TABLE border=0 cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD style="PADDING-LEFT: 0px; PADDING-RIGHT: 6px; PADDING-TOP: 6px"
vAlign=top>
<DIV
style="FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #000000; FONT-SIZE: 8pt; FONT-WEIGHT: bold">Robin
BOYLE</DIV>
<DIV
style="FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #000000; FONT-SIZE: 8pt; FONT-WEIGHT: normal">IT
Consultant (GIS)</DIV></TD></TR>
<TR>
<TD style="FONT-WEIGHT: bold" align=left><SPAN
style="FONT-FAMILY: Times New Roman,Times,serif; COLOR: #da162e; FONT-SIZE: 12pt">Sopra</SPAN><SPAN
style="FONT-STYLE: italic; FONT-FAMILY: Helvetica,Arial,sans-serif; FONT-SIZE: 7.5pt">
group</SPAN><SPAN
style="FONT-FAMILY: Helvetica,Arial,sans-serif; COLOR: red; FONT-SIZE: 14pt">.</SPAN></TD></TR>
<TR>
<TD
style="BORDER-BOTTOM: #c80a2d 1px solid; PADDING-BOTTOM: 6px; PADDING-LEFT: 0px; PADDING-RIGHT: 6px; BORDER-RIGHT: #c80a2d 1px solid; PADDING-TOP: 6px">
<DIV
style="FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #888888; FONT-SIZE: 8pt; FONT-WEIGHT: normal">Orchard
Brae House<BR>30 Queensferry Terrace<BR>Edinburgh EH4 3ER<BR>Phone : (DDI)
+44 (0)131 311 6604 - (Office) +44 (0)131 332 3311<BR>Mob : 07736 664
619<BR><A style="COLOR: #888888; TEXT-DECORATION: none"
href="mailto:rboyle@uk.sopragroup.com">rboyle@uk.sopragroup.com</A> - <A
style="COLOR: #888888; TEXT-DECORATION: none"
href="http://www.sopragroup.co.uk/">www.sopragroup.co.uk</A></DIV></TD></TR></TBODY></TABLE>
<TABLE border=0 cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD
style="PADDING-BOTTOM: 6px; PADDING-LEFT: 0px; PADDING-RIGHT: 6px; FONT-FAMILY: Arial, Helvetica, sans-serif; COLOR: #888888; FONT-SIZE: 8pt; FONT-WEIGHT: normal; PADDING-TOP: 16px"
colSpan=2><FONT size=5 face=Webdings>P</FONT> Before printing, think
about the environment.</TD></TR></TBODY></TABLE>
<DIV> </DIV><PRE>IMPORTANT NOTICE: This message is intended for the addressee only. The content
may be confidential, legally privileged and protected by law. Unauthorised
use, copying or disclosure of any of it may be unlawful. If you are not the
intended recipient please notify the sender and remove it from your system.
Internet emails are not necessarily secure. Although we have taken steps to
ensure this email and attachments are free from any virus, we advise that in
keeping with good computing practice you should ensure they are actually virus
free. The right to monitor email communications through our network is
reserved by us.
Sopra Group Limited (Registered in England, No. 1588948) with Registered
Offices at: Middlesex House, Meadway Technology Park, Rutherford Close,
Stevenage, Hertfordshire, SG1 2EF. VAT No. 366 9784 84.
</PRE></BODY></HTML>