Infrastructure Map Server Forum
Welcome to Autodesk’s Infrastructure Map Server Forums. Share your knowledge, ask questions, and explore popular Infrastructure Map Server topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Using Map to connect to MapGuide WMS

21 REPLIES 21
Reply
Message 1 of 22
Anonymous
4589 Views, 21 Replies

Using Map to connect to MapGuide WMS

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
21 REPLIES 21
Message 2 of 22
dswilson
in reply to: Anonymous

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
Message 3 of 22
Anonymous
in reply to: Anonymous

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
Message 4 of 22
Anonymous
in reply to: Anonymous

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
Message 5 of 22
Anonymous
in reply to: Anonymous

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
Message 6 of 22
dswilson
in reply to: Anonymous

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
Message 7 of 22
Anonymous
in reply to: Anonymous

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
Message 8 of 22
Anonymous
in reply to: Anonymous

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
Message 9 of 22
Anonymous
in reply to: Anonymous

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
Message 10 of 22
Anonymous
in reply to: Anonymous

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
Message 11 of 22
dswilson
in reply to: Anonymous

If you get no preview at the layer level, add the layer to a new map and see what it sets for the coordinate system and bounds. It may be that the extent information is incorrect and you might be zoomed too far out to see the data.

Regards,
Dave
Message 12 of 22
Anonymous
in reply to: Anonymous

Hi Dave,

Thanks for sticking with me on this. I created a data source to serve up
the Parcels layer as WMS, then I created a layer from this data source.
When I added it to a new map, it set the coordinate system to EPSG:4326 (WGS
84) and the extents (-180, 90) to (180, 90). The result is a map containing
what appears to be a blank layer. Does this work for you? I duplicated the
same behavior on two different machines ( one of which is running IIS 5
under XP Pro, and the other is running IIS 6 under Server 2003)

Jon



wrote in message news:5637127@discussion.autodesk.com...
If you get no preview at the layer level, add the layer to a new map and see
what it sets for the coordinate system and bounds. It may be that the extent
information is incorrect and you might be zoomed too far out to see the
data.

Regards,
Dave
Message 13 of 22
Anonymous
in reply to: Anonymous

Perhaps I should try a different approach - since I may very well be doing
something wrong, could you make a simple package demonstrating how to serve
& consume the Sheboygan "parcels" layer as a WMS service? This will help me
verify whether or not the software is working properly on my end. 🙂




"Jon Rizzo" wrote in message
news:5639883@discussion.autodesk.com...
Hi Dave,

Thanks for sticking with me on this. I created a data source to serve up
the Parcels layer as WMS, then I created a layer from this data source.
When I added it to a new map, it set the coordinate system to EPSG:4326 (WGS
84) and the extents (-180, 90) to (180, 90). The result is a map containing
what appears to be a blank layer. Does this work for you? I duplicated the
same behavior on two different machines ( one of which is running IIS 5
under XP Pro, and the other is running IIS 6 under Server 2003)

Jon



wrote in message news:5637127@discussion.autodesk.com...
If you get no preview at the layer level, add the layer to a new map and see
what it sets for the coordinate system and bounds. It may be that the extent
information is incorrect and you might be zoomed too far out to see the
data.

Regards,
Dave
Message 14 of 22
davidre
in reply to: Anonymous

I have the exact same problem: I have set a layer as a WMS service (in MGOS), but it shows up as blank when I try to look at it through ESRI ArcCatalog or ArcMap. No errors, just a blank page.

The layer works perfectly well within a map in MapGuide. The WMS bounds are set as <Bounds SRS="EPSG:32633" west="-100000" south="6420000" east="1100000" north="7960000"/> (Norway, UTM33N). ArcMap recognizes the feature as supporting UTM33N, but reports the bounds as the entire globe, in lat/long coordinates.

The documentation that I have found has been very vague on how to set up a WMS with MapGuide, and a working example would be very much appreciated!

Regards,
David
Message 15 of 22
davidre
in reply to: Anonymous

Interestingly, if I enter the WMS url into a browser, I get the error:

"Server Error, unable to connect to fastcgi server."

Is this correct, or might this be related to the core of this problem?
Message 16 of 22
dswilson
in reply to: Anonymous

Try opening the existing Sheboygan map and add your WMS layer to it. I think the issue is the extent. Sheboygan is a tiny dot in comparison to +/-180 +/-90. I suspect the layer is there, but too small to see.

Dave
Message 17 of 22
dswilson
in reply to: Anonymous

What exactly is the URL you are trying to test with? Does it include the following appended to the end:
http://servername/mapguide/mapagent/mapagent.fcgi?service=WMS&version=1.1.1&Request=GetCapabilities

This should prompt you to save the results. Save it as something.xml and go open the file.

Regards,
Dave
Message 18 of 22
dswilson
in reply to: Anonymous

It may be possible that the ESRI is looking for a lat lon bounding box definition:

LatLonBoundingBox minx="-120" miny="48.999358" maxx="-110"
maxy="60.000393"

You may need to determine your bounds in Lat Lon even though the data is in a UTM coordinate system. You can add the LatLonBoundingBox parameters as part of the definition when you right click on the Layer in Studio and set it's service properties. Add the additional bounds info to the Bounds field. Note the example above is NOT in your UTM code, it's just a sample of the string.

I'm also not sure of the formatting whether you just add a new line above or whether you add it within the existing tags or wrap it in it's own tags.

Regards,
Dave
Message 19 of 22
davidre
in reply to: Anonymous

I think I might be on to something now:

Even though the WMS url is:
http://my-server-name/mapguide/mapagent/mapagent.fcgi?service=WMS

the GetCapabilites returns urls that starts with
http://localhost:8008/...

Notice that both the host name and port is wrong in the response from the WMS.

If I manually copy one of the urls in the GetCapabilites response and correct the host name/port, everything seems to work as advertised!

Any idea where the WMS response url is configured on the server side?

Regards,
David
Message 20 of 22
Anonymous
in reply to: Anonymous

*blush* That did the trick. The problem, I came to realize, is that the
layers I was trying to view(the parcels layer) only has a scale range of 0
to 10000. So, the problem wasn't just that it was too small, but that the
layer had no display representation at this scale.

Thanks for the help. Now I need to see if I can get this working from Map,
which was my original problem. 😉


wrote in message news:5641876@discussion.autodesk.com...
Try opening the existing Sheboygan map and add your WMS layer to it. I think
the issue is the extent. Sheboygan is a tiny dot in comparison to +/-180
+/-90. I suspect the layer is there, but too small to see.

Dave

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report