Re: [thredds] CORS on thredds, or more specifically - thredds WMS on worldwindserver.net

  • To: Ryan May <rmay@xxxxxxxx>
  • Subject: Re: [thredds] CORS on thredds, or more specifically - thredds WMS on worldwindserver.net
  • From: Roy Mendelssohn - NOAA Federal <roy.mendelssohn@xxxxxxxx>
  • Date: Fri, 12 Feb 2016 14:12:24 -0800
My guess is that if you have the TDS running behind an Apache, that this will 
not be enough, that the Apache will block the CORS request.  Yu probably need 
to enable CORA in Apache also.

-Roy

> On Feb 12, 2016, at 9:39 AM, Ryan May <rmay@xxxxxxxx> wrote:
> 
> It *should* be enough just to uncomment the CORS config section in 
> threddsConfig.xml. That worked last time *I* checked. I'm hoping Adam's 
> problem was just a conflict between CORS built into TDS and CORS from tomcat.
> 
> Ryan
> 
> On Fri, Feb 12, 2016 at 10:37 AM, Signell, Richard <rsignell@xxxxxxxx> wrote:
> So what's the cookbook procedure for someone who has a THREDDS Data
> Server running and just wants to enable CORS on the THREDDS services
> like WMS?
> 
> -Rich
> 
> On Fri, Feb 12, 2016 at 12:03 PM, John Caron <jcaron1129@xxxxxxxxx> wrote:
> > Oh, I think im mixing up CORS with CAMS authentication.
> >
> > On Fri, Feb 12, 2016 at 9:23 AM, Ryan May <rmay@xxxxxxxx> wrote:
> >>
> >> Actually, the part Adam mentions in threddsConfig.xml is something I added
> >> fall 2014, specifically so I could hit our thredds server from javascript
> >> running elsewhere.
> >>
> >> Something to dig into when I get a chance....
> >>
> >> Ryan
> >>
> >> On Thu, Feb 11, 2016 at 5:15 PM, John Caron <jcaron1129@xxxxxxxxx> wrote:
> >>>
> >>> Thanks for the info. Yes, that CORS section in TDS war.xml is ancient.
> >>>
> >>> On Thu, Feb 11, 2016 at 5:05 PM, Adam Steer <Adam.Steer@xxxxxxxxxx>
> >>> wrote:
> >>>>
> >>>> Hi all
> >>>>
> >>>> I solved my own problem. CORS works for thredds catalogues if I enable a
> >>>> CORS filter in tomcat, and comment out the CORS section in
> >>>> threddsConfig.xml.
> >>>>
> >>>> thredds = 4.5.5 - 20150306.1537
> >>>> tomcat = 7.0.65.0
> >>>> OS = CentOS 6.7
> >>>>
> >>>> Cheers
> >>>> Adam
> >>>>
> >>>>
> >>>> > On 11 Feb 2016, at 11:10 AM, Adam Steer <Adam.Steer@xxxxxxxxxx> wrote:
> >>>> >
> >>>> > Hi all
> >>>> >
> >>>> > I’m new at thredds - and diving straight into attempting to get data
> >>>> > from a thredds server to appear on worldwindserver.net. I’m failing at
> >>>> > googling up a result, so I hope this hasn’t been covered somewhere here
> >>>> > recently.
> >>>> >
> >>>> > if I try to add a server at worldwindserver.net with the form:
> >>>> >
> >>>> >
> >>>> > http://ip.address/thredds/wms/gb6/ocean_eta_1993_03.nc?service=WMS&version=1.3.0&request=GetCapabilities
> >>>> >
> >>>> > ….worldwindserver.net tells me 'Failed to retrieve WMS capabilities
> >>>> > from [URL]:….’.
> >>>> >
> >>>> > I’ve been pursuing the line that it may be a CORS issue, so I’ve
> >>>> > followed Apache’s instructions and added the following to webxml:
> >>>> > ---
> >>>> > <filter>
> >>>> >    <filter-name>CorsFilter</filter-name>
> >>>> >    <filter-class>org.apache.catalina.filters.CorsFilter</filter-class>
> >>>> >    <init-param>
> >>>> >      <param-name>cors.allowed.methods</param-name>
> >>>> >      <param-value>GET</param-value>
> >>>> >    </init-param>
> >>>> >    <init-param>
> >>>> >      <param-name>cors.exposed.headers</param-name>
> >>>> >
> >>>> > <param-value>Access-Control-Allow-Origin,Access-Control-Allow-Credentials</param-value>
> >>>> >    </init-param>
> >>>> >
> >>>> >  </filter>
> >>>> >  <filter-mapping>
> >>>> >    <filter-name>CorsFilter</filter-name>
> >>>> >    <url-pattern>/*</url-pattern>
> >>>> >  </filter-mapping>
> >>>> >
> >>>> > ---
> >>>> > …and enabled the CORS element in threddsConfig.xml:
> >>>> > ---
> >>>> >  <CORS>
> >>>> >    <enabled>true</enabled>
> >>>> >    <maxAge>1728000</maxAge>
> >>>> >    <allowedMethods>GET</allowedMethods>
> >>>> >    <allowedHeaders>*</allowedHeaders>
> >>>> >    <allowedOrigin>*</allowedOrigin>
> >>>> >  </CORS>
> >>>> > ---
> >>>> > (set allowedHeaders to *, not sure if this is advisable or correct!)
> >>>> >
> >>>> > However, the result from worldwindserver.net is unchanged.
> >>>> >
> >>>> > Also - using this service: http://client.cors-api.appspot.com/client
> >>>> >
> >>>> > …tells me that CORS is not enabled on my thredds catalogue.
> >>>> >
> >>>> > Tomcat is hard restarted after both changes, I’m wondering if there is
> >>>> > anywhere else I should look, or make changes.
> >>>> >
> >>>> > …or, does anyone have a thredds catalogue which is successfully
> >>>> > serving WMS data to worldwindserver, and is happy to share bits of 
> >>>> > config
> >>>> > files?
> >>>> >
> >>>> > Thanks
> >>>> >
> >>>> > Adam
> >>>> >
> >>>> >
> >>>> > ===============================
> >>>> > Adam Steer
> >>>> > Earth Systems Data Service Specialist
> >>>> > National Computational Infrastructure
> >>>> > Leonard Huxley Building, Mills Road
> >>>> > The Australian National University
> >>>> > Canberra, ACT, 0200 Australia
> >>>> > +61 2 6125 1413
> >>>> > adam.steer@xxxxxxxxxx
> >>>> > ===============================
> >>>> >
> >>>> >
> >>>> > _______________________________________________
> >>>> > thredds mailing list
> >>>> > thredds@xxxxxxxxxxxxxxxx
> >>>> > For list information or to unsubscribe,  visit:
> >>>> > http://www.unidata.ucar.edu/mailing_lists/
> >>>>
> >>>> _______________________________________________
> >>>> thredds mailing list
> >>>> thredds@xxxxxxxxxxxxxxxx
> >>>> For list information or to unsubscribe,  visit:
> >>>> http://www.unidata.ucar.edu/mailing_lists/
> >>>
> >>>
> >>>
> >>> _______________________________________________
> >>> thredds mailing list
> >>> thredds@xxxxxxxxxxxxxxxx
> >>> For list information or to unsubscribe,  visit:
> >>> http://www.unidata.ucar.edu/mailing_lists/
> >>
> >>
> >>
> >>
> >> --
> >> Ryan May, Ph.D.
> >> Software Engineer
> >> UCAR/Unidata
> >> Boulder, CO
> >
> >
> >
> > _______________________________________________
> > thredds mailing list
> > thredds@xxxxxxxxxxxxxxxx
> > For list information or to unsubscribe,  visit:
> > http://www.unidata.ucar.edu/mailing_lists/
> 
> 
> 
> --
> Dr. Richard P. Signell   (508) 457-2229
> USGS, 384 Woods Hole Rd.
> Woods Hole, MA 02543-1598
> 
> 
> 
> -- 
> Ryan May, Ph.D.
> Software Engineer
> UCAR/Unidata
> Boulder, CO
> _______________________________________________
> thredds mailing list
> thredds@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit: 
> http://www.unidata.ucar.edu/mailing_lists/

**********************
"The contents of this message do not reflect any position of the U.S. 
Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn@xxxxxxxx www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.



  • 2016 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the thredds archives: