Le 24/04/2013 15:36, edgar.sol...@web.de a écrit :
> On 24.04.2013 15:10, Rahkonen Jukka wrote:
>>> In OrbisGIS, it's up to the user to give the URL. As we're not speaking 
>>> about
>>>> people that know HTTP well, most of them will forget the ending ?
>>>> or &. This URL is given directly to the client, and if the ? or & is 
>>>> missing at the
>>>> end, requests will fail. But as said, I can change things in OrbisGIS, 
>>>> just before
>>>> making calls to the WMS client.
>> Hi,
>>
>>   OpenJUMP takes WMS urls with or withour ending "?" or ending "&" without 
>> troubles so there must be code for handling these cases.
> ok, i see what you are trying to achieve. the correct way to handle query 
> strings (which is what url parameters after the "?" are called) is to check 
> if there exists one already and then either using "?" to attach or "&" to 
> concatenate. you can easily check if there is a query string already via
>   new URL("http://host/path?foo=bar";).getQuery()
> a simple match for "?" should do as well, as the spec for URLs only allows 
> "?" to be there one time to separate the query string from the rest of the 
> URL. other question marks if desired have to be url encoded.
>
> generally later parameters with the same key overwrite earlier definitions 
> eg. ?foo=bar&foo=karl will often end up with the server using "foo=karl". but 
> actually this must be defined in the standard and varies between web 
> applications.
>
> btw. URLs are totally valid with a trailing "?". it simply means they have no 
> query string...
>
> ..ede
>
That's basically what I do, and I'm glad that it seems to be coherent 
:-) I choose the "simple match for "?"" way.

For the version negociation, I think I can improve what I made so that 
it becomes usable for the following use cases :

- An explicit version is provided and is supported
- No explicit version was provided
- An explicit version is provided but is not supported by the server

The first one already works.

The second one currently works and lets the server choose the version it 
replies, as described in the norm. We can imagine to have a "preferred 
version" argument in a constructor, or maybe to be able to change 
statically a global preferred version, or something else...

I can easily solve the third case now. I just have to change the version 
registered in the WMService class so that it matches the retrieved 
GetCapabilities document (in order to keep my object coherent with what 
it just get from the inter webs). Basically, I've got a "if" to remove 
somewhere, not that hard.

Note that the ability to reset the version after reading the capability 
answer makes the library resistant to invalid input. If the WMService is 
initialized with version set to "potato", the version will be set to the 
best version supported by the server.

Currently, what I understand from what Michaël made is that it will 
create the parser according  to the parameter given in the 
GetCapabilities URL. There is no verification of what is replied by the 
server, so I think what I've written may be useful. I may not understand 
what he made, however.

Le 24/04/2013 15:18, Rahkonen Jukka a écrit :
> Hi Alexis,
>
> You are in such a good speed with WMS that I encourage you to implement also 
> WMS GetFeatureInfo into OrbisGIS. It is a useful tool and your users will 
> love it.
>
> I wrote something about that some days ago 
> http://article.gmane.org/gmane.comp.gis.jump.devel/13811
> When you get interested I can arrange you a WMS service and some layers to 
> test with.
>
> -Jukka Rahkonen-
>
^_^
I read that too. I'm supposed to add that on the server side, first... 
And I'll probably have to go back to my works on Symbology Encoding soon.

Best wishes,

Alexis.




------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to