[OpenLayers-Users] OpenLayers Proxying in IIS

Linda Rawson linda.rawson at gmail.com
Mon Oct 15 18:29:18 EDT 2007


In case anyone is looking for this you do it the following way in tilecache.

    def fetch (self):
        response = None
        while response is None:
            try:

                auth_handler = urllib2.HTTPBasicAuthHandler()
                auth_handler.add_password("WMS", self.url(), "username",
"password")
                opener = urllib2.build_opener(auth_handler)
                response = opener.open(self.url())
                data = response.read()
                msg = response.info()

Linda Rawson

On 10/15/07, Linda Rawson <linda.rawson at gmail.com> wrote:
>
> I should have been more specific.  I am very familiar with WMS.  Thanks
> for the info!
>
> I just needed to send a *username:password@*  to the service and that is
> where it is coughing and puking but only in IE.  I think with tilecache I
> will need to adjust the proxy parameters in the cache.py but I was
> wondering if anyone else got around this problem.  You seemed to be a pretty
> good expert on proxy so I emailed you.
>
> Thanks!
> Linda Rawson
>
>
>  On 10/15/07, Jeff Dege <jdege at korterra.com> wrote:
> >
> > (You sent this just to me, instead of to the list.  I'm CC'ing it to the
> > list).
> >
> > First, I'm by no means the expert on this stuff.  But I'll give it a
> > shot.  Others can correct me, if I'm messing up.  (Though this is pretty
> > simple, getting-started kind of stuff, and may be within my competency.)
> >
> > It sounds as if you're trying to plug the WMS server URL directly into
> > your browser, as given, and it's not working for you.  That's not a
> > surprise.  A WMS server needs a lot of complicated arguments appended to
> > the URL, and it doesn't return an HTML page, suitable for browsing.
> >
> > If you want to display a map, using data from WMS server, you'll need a
> > map viewer - like OpenLayers.  Your browser should point to a web page
> > containing OpenLayers javascript code, and that web page should build a
> > layer using the WMS URL you are working with.
> >
> > Look at: http://openlayers.org/dev/examples/wms.html
> >
> > Then look at the code:
> >
> >        function init(){
> >            map = new OpenLayers.Map( 'map' );
> >            layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
> >                    "http://labs.metacarta.com/wms/vmap0 ", {layers:
> > 'basic'} );
> >            map.addLayer(layer);
> >
> >            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
> >            map.addControl( new OpenLayers.Control.LayerSwitcher() );
> >        }
> >
> > This declares a map, and adds a WMS layer, using a WMS server at
> > labs.metacarta.com.
> >
> > If you replace that url with the one you have (putting in the real
> > username and password), you should be able to get a start.
> >
> > You may have to set the longitude and latitude to different values to
> > center the map where you want.
> >
> > And the WMS server you're trying to access may not define a layer named
> > 'basic'.
> >
> > You can get a list of available layers by passing a GetCapabilities
> > request to the WMS server.  This will return an XML document describing
> > what the WMS server is capable of providing.
> >
> > The URL for the metacarta site above is:
> >
> > http://labs.metacarta.com/wms/vmap0?version=1.1.1&service=wms&request=Ge
> >
> > tCapabilities
> >
> > For your site, it would be something like:
> >
> > http://username:password@image.globexplorer.com/gexservlets/wms?version=
> >
> > 1.1.1&service=wms&request=GetCapabilities
> >
> >
> >
> > > -----Original Message-----
> > > From: linda.rawson at gmail.com [mailto: linda.rawson at gmail.com]
> > > Sent: Monday, October 15, 2007 12:20 PM
> > > To: Jeff Dege
> > > Subject: Re: OpenLayers Proxying in IIS
> > >
> > > Jeff,
> > >
> > > I am using Digital Globe and they gave me the following url
> > > for their WMS service.  They suck!  Anyway I have vented.
> > >
> > > http://username:password@image.globexplorer.com/gexservlets/wms
> > >
> > > How on earth do I send this URL to IE or tilecache?  It
> > > totally returns errors.  I assume I use a proxy but I was
> > > wondering if you could send me in the right direction.
> > >
> > > Thanks,
> > > Linda Rawson
> > >
> > > Jeff Dege wrote:
> > > >
> > > > When I asked Erik whether it would be appropriate to suggest a
> > > > commercial package on the list, he said yes, it might be of help to
> > > > others with the same problem, and it would probably
> > > encourage others to
> > > > offer their own solutions, which would also be of help to
> > > others with
> > > > the same problem.
> > > >
> > > >
> > > >> -----Original Message-----
> > > >> From: John Cole [mailto:john.cole at uai.com]
> > > >> Sent: Friday, October 05, 2007 10:56 AM
> > > >> To: Jeff Dege; users at openlayers.org
> > > >> Subject: RE: [OpenLayers-Users] OpenLayers Proxying in IIS
> > > >>
> > > >> Search the mailing list, I posted a WFS proxy in asp.net a
> > > while back.
> > > >>
> > > >> John
> > > >>
> > > >> -----Original Message-----
> > > >> From: users-bounces at openlayers.org
> > > >> [mailto:users-bounces at openlayers.org] On
> > > >> Behalf Of Jeff Dege
> > > >> Sent: Friday, October 05, 2007 9:57 AM
> > > >> To: users at openlayers.org
> > > >> Subject: [OpenLayers-Users] OpenLayers Proxying in IIS
> > > >>
> > > >> OpenLayers uses AJAX, and AJAX has a problem with cross-domain http
> >
> > > >> requests.  So OpenLayers has a mechanism by which a proxy
> > > >> prefix can be
> > > >> prepended to every request, directing the request to a proxy
> > > >> site on the
> > > >> host domain.
> > > >>
> > > >> The issue has always been how to set up such a proxy site.
> > > >>
> > > >> If your website is hosted by Apache, it's easy.  Apache ships
> > > >> with tools
> > > >> that make creating such a proxy easy.
> > > >>
> > > >> If your website is IIS, it has not been.  I, at least, have
> > > >> been unable
> > > >> to find either public domain code, or understandable
> > > instructions, on
> > > >> how to create a proxying site for IIS.
> > > >>
> > > >> I've asked on OpenLayers-Users, and had no answers.  I've asked
> > > >> elsewhere, and had no answers.
> > > >>
> > > >> Eventually, I found a discussion of the issue:
> > > >>
> > > >> http://blogs.msdn.com/david.wang/archive/2005/08/01/HOWTO_Comm
> > > >> on_URL_Red
> > > >> irection_Techniques_for_IIS_Summary.aspx
> > > >>
> > > >> The relevant quote:
> > > >>
> > > >>    No one seems to provide modules to do Server-Side Redirection or
> >
> > > >> Server-Side
> > > >>    Forwarding on IIS for free. At least, I am not aware of any
> > > >> free/open-source
> > > >>    add-on IIS modules which implement those Server-Side
> > > behaviors; I
> > > >> only know
> > > >>    of for-fee modules like ISAPIRewrite.
> > > >>
> > > >> Which got me looking for ISAPIRewrite.  This I found at:
> > > >>
> > > >>     http://www.helicontech.com/isapi_rewrite/
> > > >>
> > > >> This is a commercial, but reasonably priced ($99), ISAPI
> > > >> filter DLL that
> > > >> implements the functionality of Apache's mod_rewrite and
> > > >> mod_proxy.  And
> > > >> with it, creating a forwarding proxy for OpenLayers is simple.
> > > >>
> > > >> ISAPI_Rewrite has a "lite" version that is free, but the
> > > lite version
> > > >> doesn't do proxying.  The commercial version is available
> > > for download
> > > >> on a 45-day free trial.  I downloaded it yesterday
> > > morning, and had a
> > > >> proxy working before lunchtime.
> > > >>
> > > >> I know there are others who have had the same problem.
> > > This may be of
> > > >> help.
> > > >>
> > > >> _______________________________________________
> > > >> Users mailing list
> > > >> Users at openlayers.org
> > > >> http://openlayers.org/mailman/listinfo/users
> > > >>
> > > >> No virus found in this incoming message.
> > > >> Checked by AVG Free Edition.
> > > >> Version: 7.5.488 / Virus Database: 269.14.0/1049 - Release
> > > >> Date: 10/4/2007
> > > >> 8:59 AM
> > > >>
> > > >>
> > > >> No virus found in this outgoing message.
> > > >> Checked by AVG Free Edition.
> > > >> Version: 7.5.488 / Virus Database: 269.14.0 /1049 - Release
> > > >> Date: 10/4/2007
> > > >> 8:59 AM
> > > >>
> > > >> This email and any files transmitted with it are confidential
> > > >> and intended solely for the use of the individual or entity
> > > >> to whom they are addressed. If you have received this email
> > > >> in error please notify the sender. This message contains
> > > >> confidential information and is intended only for the
> > > >> individual named. If you are not the named addressee you
> > > >> should not disseminate, distribute or copy this e-mail.
> > > >>
> > > > _______________________________________________
> > > > Users mailing list
> > > > Users at openlayers.org
> > > > http://openlayers.org/mailman/listinfo/users
> > > >
> > > >
> > > Quoted from:
> > > http://www.nabble.com/OpenLayers-Proxying-in-IIS-tf4575776.htm
> > > l#a13064168
> > >
> > >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071015/714ad607/attachment.html


More information about the Users mailing list