<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
manually building a SOAP request is rather unusual, but I assume you
know what you're doing and why you're doing it. At this point, I would
check that the ressource <a
href="http://localhost/cartoserver.wsdl.php?mapId=ybaranav1">http://localhost/cartoserver.wsdl.php?mapId=ybaranav1</a>
is accessible from your php script.<br>
<br>
Damien<br>
<br>
<br>
<br>
Alex Kuznetsov wrote:
<blockquote
cite="midb8ea4be10607251906k5ae3430cj25272a72dad791fe@mail.gmail.com"
type="cite">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>
<html><br>
<head><title>Parcel Locator</title><br>
</head><br>
<br>
<body><br>
<br>
<?php
<br>
<br>
$dbcon = pg_connect("dbname=webproj6 user=postgres host=localhost
password=postgres");<br>
<br>
if ($dbcon == 0) die("connection to WebProj6 PostgreSQL DB failed");<br>
<br>
$query = 'SELECT astext(envelope(the_geom)) FROM poly_parcel where
GID = 5000' ;
<br>
<br>
$result = pg_query($query) or die('Query failed [' . $query . '] with
error: ' . pg_last_error());<br>
<br>
while ($line = pg_fetch_array($result, null, PGSQL_ASSOC))<br>
{<br>
foreach ($line as $col)<br>
list($j1, $j2, $x1, $y1, $xj, $yj, $x2, $y2) = split('[( ,]',
$col) ;
<br>
}<br>
<br>
pg_free_result($result);<br>
pg_close($dbcon);<br>
<br>
$x1 -= $margin ;<br>
$y1 -= $margin ;<br>
$x2 += $margin ;<br>
$y2 += $margin ;<br>
<br>
// ERROR ON NEXT LINE: Warning: SoapClient::__construct() [
function.SoapClient---construct]:<br>
<br>
// I/O warning : failed to load external entity "<a
href="http://localhost/cartoserver.wsdl.php?mapId=ybaranav1">http://localhost/cartoserver.wsdl.php?mapId=ybaranav1</a>"
<br>
<br>
// in C:\wamp\www\cartoweb3\projects\ybaranav1\parloc2.php on line 41<br>
<br>
<br>
<br>
$client = new SoapClient("<a
href="http://localhost/cartoserver.wsdl.php?mapId=ybaranav1">http://localhost/cartoserver.wsdl.php?mapId=ybaranav1
</a>");<br>
<br>
$request->mapId = 'ybaranav1';<br>
<br>
$request->imagesRequest->className = 'ImagesRequest';<br>
$request->imagesRequest->mainmap->isDrawn = true;<br>
$request->imagesRequest->mainmap->path = '';
<br>
$request->imagesRequest->mainmap->width = 500;<br>
$request->imagesRequest->mainmap->height = 500;<br>
$request->imagesRequest->mainmap->format = '';<br>
<br>
$request->imagesRequest->keymap->isDrawn = true;
<br>
$request->imagesRequest->keymap->path = '';<br>
$request->imagesRequest->keymap->width = 224;<br>
$request->imagesRequest->keymap->height = 150;<br>
$request->imagesRequest->keymap->format = '';
<br>
<br>
$request->imagesRequest->scalebar->isDrawn = true;<br>
$request->imagesRequest->scalebar->path = '';<br>
$request->imagesRequest->scalebar->width = 350;<br>
$request->imagesRequest->scalebar->height = 3;
<br>
$request->imagesRequest->scalebar->format = '';<br>
<br>
$request->layersRequest->className = 'LayersRequest';<br>
$request->layersRequest->layerIds = array('Parcel','Buildings');<br>
<br>
$request->layersRequest->resolution = null;
<br>
<br>
$request->locationRequest->className = 'LocationRequest';<br>
$request->locationRequest->locationType = 'bboxLocationRequest';<br>
$request->locationRequest->bboxLocationRequest->bbox->minx
= $x1 ;
<br>
$request->locationRequest->bboxLocationRequest->bbox->miny
= $y1 ;<br>
$request->locationRequest->bboxLocationRequest->bbox->maxx
= $x2 ;<br>
$request->locationRequest->bboxLocationRequest->bbox->maxy
= $y2 ;
<br>
<br>
try<br>
{<br>
$result = $client->getMap($request);<br>
print_r($result);<br>
}<br>
catch (SoapFault $fault)<br>
{<br>
print $fault->faultstring;<br>
}<br>
<br>
?><br>
<br>
</body><br>
</html>
<br>
<br>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
Cartoweb-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Cartoweb-users@lists.maptools.org">Cartoweb-users@lists.maptools.org</a>
<a class="moz-txt-link-freetext" href="http://lists.maptools.org/mailman/listinfo/cartoweb-users">http://lists.maptools.org/mailman/listinfo/cartoweb-users</a>
</pre>
</blockquote>
<br>
</body>
</html>