We are working on a college MapServer project with CartoWeb... is a great productive tool.<br>As a final task, we are trying to add functionality to search for an individual parcel and zoom<br>to it on the map. We are able to retrieve the coordinates from our PostGIS database but can't get
<br>the SoapClient working and can't figure out how to integrate this function with the rest of CartoWeb...<br>i.e. do we have to add/extend a plug-in?<br><br>Our third attempt is pasted below. Note the ERROR above the offending line.
<br><br>Any help greatly appreciated<br>- Tony Bonnici, Alex Kusnetsov<br><br>-------------<br><br>&lt;html&gt;<br>&nbsp;&lt;head&gt;&lt;title&gt;Parcel Locator&lt;/title&gt;<br>&nbsp;&lt;/head&gt;<br><br>&nbsp;&lt;body&gt;<br><br>&nbsp;&lt;?php
<br><br>&nbsp; $dbcon = pg_connect(&quot;dbname=webproj6 user=postgres host=localhost password=postgres&quot;);<br><br>&nbsp; if ($dbcon == 0) die(&quot;connection to WebProj6 PostgreSQL DB failed&quot;);<br><br>&nbsp; $query = 'SELECT astext(envelope(the_geom)) FROM poly_parcel where GID = 5000' ;
<br><br>&nbsp; $result = pg_query($query) or die('Query failed [' . $query . '] with error: ' . pg_last_error());<br><br>&nbsp; while ($line = pg_fetch_array($result, null, PGSQL_ASSOC))<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; foreach ($line as $col)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; list($j1, $j2, $x1, $y1, $xj, $yj, $x2, $y2) = split('[( ,]', $col) ;
<br>&nbsp; }<br><br>&nbsp; pg_free_result($result);<br>&nbsp; pg_close($dbcon);<br><br>&nbsp; $x1 -= $margin ;<br>&nbsp; $y1 -= $margin ;<br>&nbsp; $x2 += $margin ;<br>&nbsp; $y2 += $margin ;<br><br>// ERROR ON NEXT LINE: Warning: SoapClient::__construct() [
function.SoapClient---construct]:<br><br>// I/O warning : failed to load external entity &quot;<a href="http://localhost/cartoserver.wsdl.php?mapId=ybaranav1">http://localhost/cartoserver.wsdl.php?mapId=ybaranav1</a>&quot;
<br><br>// in C:\wamp\www\cartoweb3\projects\ybaranav1\parloc2.php on line 41<br><br><br><br>&nbsp; $client = new SoapClient(&quot;<a href="http://localhost/cartoserver.wsdl.php?mapId=ybaranav1">http://localhost/cartoserver.wsdl.php?mapId=ybaranav1
</a>&quot;);<br><br>&nbsp; $request-&gt;mapId = 'ybaranav1';<br><br>&nbsp; $request-&gt;imagesRequest-&gt;className = 'ImagesRequest';<br>&nbsp; $request-&gt;imagesRequest-&gt;mainmap-&gt;isDrawn = true;<br>&nbsp; $request-&gt;imagesRequest-&gt;mainmap-&gt;path = '';
<br>&nbsp; $request-&gt;imagesRequest-&gt;mainmap-&gt;width = 500;<br>&nbsp; $request-&gt;imagesRequest-&gt;mainmap-&gt;height = 500;<br>&nbsp; $request-&gt;imagesRequest-&gt;mainmap-&gt;format = '';<br><br>&nbsp; $request-&gt;imagesRequest-&gt;keymap-&gt;isDrawn = true;
<br>&nbsp; $request-&gt;imagesRequest-&gt;keymap-&gt;path = '';<br>&nbsp; $request-&gt;imagesRequest-&gt;keymap-&gt;width = 224;<br>&nbsp; $request-&gt;imagesRequest-&gt;keymap-&gt;height = 150;<br>&nbsp; $request-&gt;imagesRequest-&gt;keymap-&gt;format = '';
<br><br>&nbsp; $request-&gt;imagesRequest-&gt;scalebar-&gt;isDrawn = true;<br>&nbsp; $request-&gt;imagesRequest-&gt;scalebar-&gt;path = '';<br>&nbsp; $request-&gt;imagesRequest-&gt;scalebar-&gt;width = 350;<br>&nbsp; $request-&gt;imagesRequest-&gt;scalebar-&gt;height = 3;
<br>&nbsp; $request-&gt;imagesRequest-&gt;scalebar-&gt;format = '';<br><br>&nbsp; $request-&gt;layersRequest-&gt;className = 'LayersRequest';<br>&nbsp; $request-&gt;layersRequest-&gt;layerIds = array('Parcel','Buildings');<br><br>&nbsp; $request-&gt;layersRequest-&gt;resolution = null;
<br><br>&nbsp; $request-&gt;locationRequest-&gt;className = 'LocationRequest';<br>&nbsp; $request-&gt;locationRequest-&gt;locationType = 'bboxLocationRequest';<br>&nbsp; $request-&gt;locationRequest-&gt;bboxLocationRequest-&gt;bbox-&gt;minx = $x1 ;
<br>&nbsp; $request-&gt;locationRequest-&gt;bboxLocationRequest-&gt;bbox-&gt;miny = $y1 ;<br>&nbsp; $request-&gt;locationRequest-&gt;bboxLocationRequest-&gt;bbox-&gt;maxx = $x2 ;<br>&nbsp; $request-&gt;locationRequest-&gt;bboxLocationRequest-&gt;bbox-&gt;maxy = $y2 ;
<br><br>&nbsp; try<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; $result = $client-&gt;getMap($request);<br>&nbsp;&nbsp;&nbsp; print_r($result);<br>&nbsp; }<br>&nbsp; catch (SoapFault $fault)<br>&nbsp; {<br>&nbsp;&nbsp;&nbsp; print $fault-&gt;faultstring;<br>&nbsp; }<br><br>?&gt;<br><br>&lt;/body&gt;<br>&lt;/html&gt;
<br><br>