[Geoserver-devel] WMS cascading fails with an ESRI server

Hi,

Captured from a gis.stackexchange question http://gis.stackexchange.com/questions/123754/problem-with-connecting-remote-wms-connection-to-geoserver, this WMS server can't be cascaded with Geoserver.:
http://mapy.geoportal.gov.pl/wss/service/pub/guest/kompozycjaG2_TBD_WMS/MapServer/WMSServer?
The error is
Connection test failed: Content type is required for org.geotools.data.wms.response.WMSGetCapabilitiesResponse

I could not connect the service with OpenJUMP either. It gives an error
IOException: org.sax.SAXParseException; Premature end of life.

However, I can read GetCapabilities with browser and document was reported valid by a web service at xmlvalidation.com.

I studied with Fiddler what happens. Geoserver is sending the following request but gets never anything back. I could have something to do with the headers and ESRI server wants to get something more than it gets now

GET http://mapy.geoportal.gov.pl/wss/service/pub/guest/kompozycjaG2_TBD_WMS/MapServer/WMSServer?REQUEST=GetCapabilities&VERSION=1.3.0&SERVICE=WMS HTTP/1.1
Accept-Encoding: gzip
User-Agent: Java/1.7.0_67
Host: mapy.geoportal.gov.pl
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Proxy-Connection: keep-alive

Browsers gets an answer and it is sending the request this way:

GET http://mapy.geoportal.gov.pl/wss/service/pub/guest/kompozycjaG2_TBD_WMS/MapServer/WMSServer?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Accept-Language: fi-FI
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Accept-Encoding: gzip, deflate
Proxy-Connection: Keep-Alive
Host: mapy.geoportal.gov.pl

I wonder if this could be some common java http issue because exactly the same happens with OpenJUMP: program sends the GetCapabilities request but ESRI server sends back only this empty response

HTTP/1.1 200 OK
Server: BigIP
Content-Length: 0
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Age: 0
Date: Fri, 28 Nov 2014 10:05:36 GMT

What is this " Server: BigIP"? In the good response to request from browser the headers are

HTTP/1.1 200 OK
Content-Type: text/xml
Date: Fri, 28 Nov 2014 09:52:11 GMT
Content-Length: 218715
Vary: Accept-Encoding
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Age: 0

-Jukka Rahkonen-

On Fri, Nov 28, 2014 at 12:53 PM, Rahkonen Jukka (Tike) <
jukka.rahkonen@anonymised.com> wrote:

Hi,

Captured from a gis.stackexchange question
http://gis.stackexchange.com/questions/123754/problem-with-connecting-remote-wms-connection-to-geoserver,
this WMS server can't be cascaded with Geoserver.:

http://mapy.geoportal.gov.pl/wss/service/pub/guest/kompozycjaG2_TBD_WMS/MapServer/WMSServer
?
The error is
Connection test failed: Content type is required for
org.geotools.data.wms.response.WMSGetCapabilitiesResponse

I could not connect the service with OpenJUMP either. It gives an error
IOException: org.sax.SAXParseException; Premature end of life.

However, I can read GetCapabilities with browser and document was reported
valid by a web service at xmlvalidation.com.

I studied with Fiddler what happens. Geoserver is sending the following
request but gets never anything back. I could have something to do with
the headers and ESRI server wants to get something more than it gets now

GET
http://mapy.geoportal.gov.pl/wss/service/pub/guest/kompozycjaG2_TBD_WMS/MapServer/WMSServer?REQUEST=GetCapabilities&VERSION=1.3.0&SERVICE=WMS
HTTP/1.1
Accept-Encoding: gzip
User-Agent: Java/1.7.0_67
Host: mapy.geoportal.gov.pl
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Proxy-Connection: keep-alive

I cannot be sure, but "Accept: text/html, image/gif, image/jpeg, *; q=.2,
*/*; q=.2" sounds like trouble, not sure what the "*; q=.2" means, or the
other one, but it may well be
that the server is not answering because text/xml is not matching any
accepted content type?

Cheers
Andrea

--

GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo è consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.

The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------