[mapguide-dev] problem with tcp port

Traian Stanev traian.stanev at autodesk.com
Thu Apr 27 08:20:03 EDT 2006


Have you tried calling other service functions and have they worked? For
example try calling ResourceService::EnumerateResources. If that returns
a bunch of XML then the server is working ok and the issue is likely
with RenderMap. Also, can you look at what is in the MgMap object that
you pass in to RenderMap. What is the map scale, display width and
height, dpi, data extents, etc? If these are bad values, you may get
errors with RenderMap.

Traian
 

-----Original Message-----
From: alucas at srtec.com [mailto:alucas at srtec.com] 
Sent: Wednesday, April 26, 2006 7:13 PM
To: dev at mapguide.osgeo.org
Subject: [mapguide-dev] problem with tcp port

Hello,

I've a problem. I'm writting a sample desktop c# application that render
a
map located in a server. All works fine, but when I call renderMap
method,
I get a error with the port for connection 2801 in the server and the
MapGuideServer service in the server machine crash.

Sample code:(Sorry for long lines of code, I'm wrtting from web mail)

...
// Init Winsock
MapGuideApi.InitializeSockets();

// Init WebTier
MapGuideApi.MgInitializeWebTier(@"C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\webconfig.ini");

// Connect to the site server
MgSiteConnection siteConn = new MgSiteConnection();
MgUserInformation userInfo = new
MgUserInformation("Administrator","admin");

siteConn.Open(userInfo);

// create an instance of resource service
MgResourceService     
resourceService=siteConn.CreateService(MgServiceType.ResourceService)as
MgResourceService;

MgRenderingService renderService = 
siteConn.CreateService(MgServiceType.RenderingService) as 
MgRenderingService;

MgResourceIdentifier resourceMap = new
MgResourceIdentifier("Library://Samples/test/Map/Map.MapDefinition");

// Create a new map instance
MgMap map = new MgMap();
map.Create(resourceService, resourceMap, "Map");

// Render the map (for test to show map features, it works fine)
//MgEnvelope ext = map.GetMapExtent();

//MgCoordinate ll = ext.GetLowerLeftCoordinate();
//MgCoordinate ur = ext.GetUpperRightCoordinate();
//string bgcolor = map.GetBackgroundColor();
// MessageBox.Show(bgcolor); // works fine

// problem writting protected memory!!!
MgByteReader rdr = renderService.RenderMap(map, null, "png");

...
Future steps when I've solved this problem:
//MgByteSink bs = new MgByteSink(rdr);
//bs.ToFile("demo.png");
...

In the server side, I went to logs dir. and open Errors file and this is
the error reported:
<2006-04-25T21:43:25>
 Error: Port 2801 is not available, please try using a different port.
        Exception occurred in method MgServer.svc at line 1001 in file
c:\build_tux_area\mgdev\server\src\core\Server.cpp

I've tested the port in the server with a sample tcp program that
connects
to server:2801 and the server and port are ok. The client application
show
a error writting in protected memory...
In my webconfig, I think that all is ok, this config file is in my
client
machine (where c# app runs). So, I suspect that port 2801 is for
connections from server side applications. I suspect this, because
reading
the webconfig file, in the statement 'client connection' only the port
is
specified, but in 'site connections' exists IP and port. I'm not sure of
this.

Any idea?
Thanks in advance.



Antonio Lucas

Software Engineer
SER&TEC S.L
Phone: +34 96 395 95 13
www.srtec.com
Valencia (Spain)



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe at mapguide.osgeo.org
For additional commands, e-mail: dev-help at mapguide.osgeo.org







More information about the Mapguide-internals mailing list