Infrastructure Map Server General Discussion

Infrastructure Map Server General Discussion

Reply
*Jon Rizzo
Message 1 of 22 (2,768 Views)

Using Map to connect to MapGuide WMS

2768 Views, 21 Replies
06-14-2007 01:09 PM
Hello,

I am trying to consume the WMS service provided by MapGuide. I am using Map
as the client application. I am not sure if my problem is in Map or in
MapGuide, so I am posting this here in case somebody has an idea.

In AutoCAD Map (2008) I set up a connection to my MapGuide server. To rule
out firewall issues, the MapGuide server is running on the same machine that
I am trying to connect from. First, I set the coordinate system of the dwg.
Then, I added a WMS connection in the Data Connect palette. Here is the URL
that I am using:

http://localhost/mapguide/mapagent/mapagent.fcgi?service=WMS

After I click "Connect" I enter my MapGuide username and password. The Data
Connect dialog then shows me all of the available layers. The only layers
which are currently configured to show up are the Sheboygan sample layers.
It doesn't matter which layer I select, the result is always the same: Map
pops up a baloon warning that says "There was a problem adding data to Map.
Failed to get bands data. Unable to connect to the host.".

I find it difficult to believe that there would be a connection problem to
localhost, so I must be doing something wrong. Am I skipping a step? Any
ideas? Thanks in advance for any suggestions you can offer.

Jon
Employee
dswilson
Posts: 730
Registered: ‎09-14-2006
Message 2 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-15-2007 01:23 PM in reply to: *Jon Rizzo
What you are doing should be valid Jon.

If you were to try the WMS service in another client such as GAIA can you get it to work?

You might want to post under Map3D instead as this may be a Map problem rather than a MapGuide problem.

Regards,
Dave


Dave Wilson
SQA Analyst
AEC IM
Autodesk, Inc.

*Andy Morsell
Message 3 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-15-2007 04:57 PM in reply to: *Jon Rizzo
I just tried the same thing in Map 2007 and did not have any issues.
Accessing both an MGE and MGOS server. I thought the problem might be that
you had tacked on the ?service=WMS (turns out map will do that for you, you
only need to specify the mapagent), but it still worked for me. The fact
that the WMS getCapabililties worked but the actual layer WMS request did
not is sort of odd. It sounds like you are doing everything correctly so I
wonder if it's an issue with Map 2008? Or, what if you don't set a
coordinate system in the drawing? I would try that but I just discovered
that I have a problem with my Map 2007 where I cannot set a coordinate
system. Yippee.


--
Andy Morsell, P.E.
Spatial Integrators, Inc.
http://www.SpatialGIS.com

"Jon Rizzo" wrote in message
news:5626896@discussion.autodesk.com...
Hello,

I am trying to consume the WMS service provided by MapGuide. I am using Map
as the client application. I am not sure if my problem is in Map or in
MapGuide, so I am posting this here in case somebody has an idea.

In AutoCAD Map (2008) I set up a connection to my MapGuide server. To rule
out firewall issues, the MapGuide server is running on the same machine that
I am trying to connect from. First, I set the coordinate system of the dwg.
Then, I added a WMS connection in the Data Connect palette. Here is the URL
that I am using:

http://localhost/mapguide/mapagent/mapagent.fcgi?service=WMS

After I click "Connect" I enter my MapGuide username and password. The Data
Connect dialog then shows me all of the available layers. The only layers
which are currently configured to show up are the Sheboygan sample layers.
It doesn't matter which layer I select, the result is always the same: Map
pops up a baloon warning that says "There was a problem adding data to Map.
Failed to get bands data. Unable to connect to the host.".

I find it difficult to believe that there would be a connection problem to
localhost, so I must be doing something wrong. Am I skipping a step? Any
ideas? Thanks in advance for any suggestions you can offer.

Jon
*Jon Rizzo
Message 4 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-18-2007 06:30 AM in reply to: *Jon Rizzo
Hi Dave,

Thanks for the reply. I just tried GAIA and I seem to have similar problems
from there. I can browse the available layers & add them to a map, but the
appear to be blank, so I guess my problem is somewhere in MapGuide. I
disabled windows firewall client just to be sure & the problem persists.
Here is the message log from GAIA:

-------------------- Message #1--------------------
CarbonTools.CarbonToolsException: Reading from WMS failed
[Source URL = http://localhost:8008/mapguide/mapagent/mapagent.fcgi?]
[Layer name = Samples/Sheboygan/Layers/Parcels] --->
System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: No connection could be made because the
target machine actively refused it

at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)

at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState
state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)

--- End of inner exception stack trace ---

at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

at CarbonTools.Content.OGC.WMS.HandlerWMS.a(IAsyncResult A_0)

--- End of inner exception stack trace ---
-------------------- Message #0--------------------
CarbonTools.CarbonToolsException: Reading from WMS failed
[Source URL = http://localhost:8008/mapguide/mapagent/mapagent.fcgi?]
[Layer name = Samples/Sheboygan/Layers/Parcels] --->
System.Net.WebException: Unable to connect to the remote server --->
System.Net.Sockets.SocketException: No connection could be made because the
target machine actively refused it

at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)

at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure,
Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState
state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)

--- End of inner exception stack trace ---

at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

at CarbonTools.Content.OGC.WMS.HandlerWMS.a(IAsyncResult A_0)

--- End of inner exception stack trace ---

wrote in message news:5628192@discussion.autodesk.com...
What you are doing should be valid Jon.

If you were to try the WMS service in another client such as GAIA can you
get it to work?

You might want to post under Map3D instead as this may be a Map problem
rather than a MapGuide problem.

Regards,
Dave
*Jon Rizzo
Message 5 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-18-2007 07:26 AM in reply to: *Jon Rizzo
I have noticed that Map's coordinate systems and MapGuide's coordinate
systems don't always play nice together on the same machine. For example,
if you try to use one of the Arbitrary X-Y coordinate systems in Map, it
throws errors when you save & open your drawing, at least it does for me.


"Andy Morsell" wrote in message
news:5628370@discussion.autodesk.com...
I just tried the same thing in Map 2007 and did not have any issues.
Accessing both an MGE and MGOS server. I thought the problem might be that
you had tacked on the ?service=WMS (turns out map will do that for you, you
only need to specify the mapagent), but it still worked for me. The fact
that the WMS getCapabililties worked but the actual layer WMS request did
not is sort of odd. It sounds like you are doing everything correctly so I
wonder if it's an issue with Map 2008? Or, what if you don't set a
coordinate system in the drawing? I would try that but I just discovered
that I have a problem with my Map 2007 where I cannot set a coordinate
system. Yippee.


--
Andy Morsell, P.E.
Spatial Integrators, Inc.
http://www.SpatialGIS.com

"Jon Rizzo" wrote in message
news:5626896@discussion.autodesk.com...
Hello,

I am trying to consume the WMS service provided by MapGuide. I am using Map
as the client application. I am not sure if my problem is in Map or in
MapGuide, so I am posting this here in case somebody has an idea.

In AutoCAD Map (2008) I set up a connection to my MapGuide server. To rule
out firewall issues, the MapGuide server is running on the same machine that
I am trying to connect from. First, I set the coordinate system of the dwg.
Then, I added a WMS connection in the Data Connect palette. Here is the URL
that I am using:

http://localhost/mapguide/mapagent/mapagent.fcgi?service=WMS

After I click "Connect" I enter my MapGuide username and password. The Data
Connect dialog then shows me all of the available layers. The only layers
which are currently configured to show up are the Sheboygan sample layers.
It doesn't matter which layer I select, the result is always the same: Map
pops up a baloon warning that says "There was a problem adding data to Map.
Failed to get bands data. Unable to connect to the host.".

I find it difficult to believe that there would be a connection problem to
localhost, so I must be doing something wrong. Am I skipping a step? Any
ideas? Thanks in advance for any suggestions you can offer.

Jon
Employee
dswilson
Posts: 730
Registered: ‎09-14-2006
Message 6 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-18-2007 07:45 AM in reply to: *Jon Rizzo
Within MapGuide if you build a WMS Connection, build a layer and add it to a map does it preview? That should help confirm if the problem is within MapGuide or not.

Regards,
Dave


Dave Wilson
SQA Analyst
AEC IM
Autodesk, Inc.

*Jon Rizzo
Message 7 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-18-2007 10:35 AM in reply to: *Jon Rizzo
I built a connection & the "Test Connection" button was successful. When I
go to create the layer, I get a similar behavior to the other programs: I
can see the layers listed in the "Feature class" dropdown, but none of them
show any data in the preview.

I had similar results on both my test machine and my production server,
although I did not test a thoroughly on the production server. What's even
more strange is that I can access external WMS services from my production
server (such as jpl.nasa.gov) since it is in the DMZ , but I can't serve
them up myself.


wrote in message news:5629454@discussion.autodesk.com...
Within MapGuide if you build a WMS Connection, build a layer and add it to a
map does it preview? That should help confirm if the problem is within
MapGuide or not.

Regards,
Dave
*Jason Birch
Message 8 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-18-2007 11:21 PM in reply to: *Jon Rizzo
Jon Rizzo wrote:
> Thanks for the reply. I just tried GAIA and I seem to have similar problems
> from there.

Jon,

Have you used the MapGuide Site Administrator to update the WMS
properties?

The version that I have has port 8008 specified as part of the WMS
server name. If this is the case for you, I think it will cause you
problems, as you appear to be running MapGuide on port 80.

You can also set this manually in Server/WMS/OgcWmsService.config.awd if
you prefer using a text editor for configuration.

Jason
*Jason Birch
Message 9 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-19-2007 08:31 AM in reply to: *Jon Rizzo
Jason Birch wrote:
> Have you used the MapGuide Site Administrator to update the WMS
> properties?

The reason I asked is because you specified your url as:

http://localhost/mapguide/mapagent/mapagent.fcgi?service=WMS

And the error message references:

http://localhost:8008/mapguide/mapagent/mapagent.fcgi

Jason
*Jon Rizzo
Message 10 of 22 (2,768 Views)

Re: Using Map to connect to MapGuide WMS

06-19-2007 09:14 AM in reply to: *Jon Rizzo
Interesting. Thanks for the tip! I didn't realize that MapGuide's default
port would not work on a web server running on it's default port. This
seems to make it "better" but something is still not right. In Studio, I
created a WMS feature source connecting to JPL's WMS service & defined a
layer with it. I am able access this layer from GAIA and display it on a
map, using MapGuide as a sort of "pass through". This layer looks fine.
Unfortunately, the layers defined in the sheboygan sample still don't seem
to be showing anything. This time, GAIA is not recording any error
messages, but the sample layers appear to be blank. Any ideas?

Jon




"Jason Birch" wrote in message
news:5630885@discussion.autodesk.com...
Jason Birch wrote:
> Have you used the MapGuide Site Administrator to update the WMS
> properties?

The reason I asked is because you specified your url as:

http://localhost/mapguide/mapagent/mapagent.fcgi?service=WMS

And the error message references:

http://localhost:8008/mapguide/mapagent/mapagent.fcgi

Jason
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!