[OpenLayers-Users] GetCapabilities

Marc Jansen jansen at terrestris.de
Tue Jul 28 11:15:41 EDT 2009


Hi Raul,

getFullRequestString is actually a method of instances of e.g. 
OpenLayers.Layer.WMS, so it should be called like this:

var wms_layer = new OpenLayers.Layer.WMS( ... );

wms_layer.getFullRequestString(
  {
    REQUEST: 'GetCapabilities'
  },
  'http://www.example.com/wms-server'
);

It is not a method of the Map-instance.

The second error you get (Access to restricted URI denied) hints that 
you are trying to issue a AJAX Request to another server than the one 
your script is being executed at.

For example it is not allowed for a script running on 
http://abc.example.com to query http://xyz.example.com.

Regards,
Marc



Raul David Orozco schrieb:
> Hi. I'm trying to make a GetCapabilities request to a server, using a 
> couple of examples that I found in OpenLayers documentation.
>
> In the first case I tried something like this:
>
> var url = map.getFullRequestString({
>         REQUEST: "Getcapabilities"},
>                 "http://192.168.1.5:9090/smms/wms.php"); //URL of the 
> server
>  OpenLayers.loadURL(url, '', this, setHTML);
>
> but I get a error message saying that function getFullRequestString 
> doesn't exists.
>
> In my second try, I used this code:
> this.request = OpenLayers.Request.GET({
>     url: "http://192.168.1.5:9090/smms/wms.php",
>     success: function(response)
>  {
>         var XMLformat = new OpenLayers.Format.XML();
>         xml = XMLformat.read(response.responseText);
>         
>         var CAPformat = new OpenLayers.Format.WMSCapabilities();
>         capabilities = CAPformat.read(xml);
>         
>         window.console.log(capabilities);
>     }
> });
>
> But I get the error related to the proxy:
>
> Access to restricted URI denied"  code: "1012"
>
> Now I'm out of ideas, I don't know how to capture the GetCapabilities request. 
> Thanks for any help, I'll appreciate it.
>
>
>
> ------------------------------------------------------------------------
>
> ¡Obtén la mejor experiencia en la web!
> Descarga gratis el nuevo Internet Explorer 8
> http://downloads.yahoo.com/ieak8/?l=e1
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   


-- 

  Diplom-Geograph Marc Jansen
  - Anwendungsentwickler -

  terrestris GmbH & Co. KG
  Irmintrudisstraße 17
  53111 Bonn

  Tel:    ++49 (0)228 / 96 28 99 -53
  Fax:    ++49 (0)228 / 96 28 99 -57

  Email:  jansen at terrestris.de
  Web:    http://terrestris.de

  Amtsgericht Bonn, HRA 6835
  Komplementärin:  terrestris Verwaltungsgesellschaft mbH
  vertreten durch: Hinrich Paulsen, Till Adams  







More information about the Users mailing list