<div dir="ltr">Hello Elena,<div>the error messages report "Unauthorized".</div><div><div>I would try by modifying the ServerlUrl, removing the user and password empty parameters, so that it just contains the base WMS url:</div><div><br></div><div><ServerUrl><a href="https://wms.mapa.gob.es/sigpac/ows?SERVICE=WMS" target="_blank">https://wms.mapa.gob.es/sigpac/ows?SERVICE=WMS</a></ServerUrl><br></div><div><br></div><div>and also removing the <UserPwd>:</UserPwd> tag at the bottom of your xml.</div><div><br></div><div>Let us know if that works.</div><div><br></div><div>Regards,</div><div>Daniele</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 8, 2021 at 10:51 AM Elena Ruiz <<a href="mailto:eruiz@aplitop.com">eruiz@aplitop.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">





<div lang="ES" style="overflow-wrap: break-word;">
<div class="gmail-m_408233360926504808WordSection1">
<p class="MsoNormal"><span lang="EN-GB">Hello, I trying a WMS web service with gdal, but I have different results depend on I use a url in a web browser or I use the gdal commands.
<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">If I put this url in Crome:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><a href="https://wms.mapa.gob.es/sigpac/ows?FORMAT=image/jpeg&HEIGHT=99&LAYERS=EEPP&WIDTH=183&SERVICE=WMS&BBOX=413276.0389803443,4066482.0439935336,675346.7028941214,4208125.2305295570&REQUEST=GetMap&TRANSPARENT=FALSE&STYLES=&VERSION=1.3.0&CRS=EPSG:25830" target="_blank">https://wms.mapa.gob.es/sigpac/ows?FORMAT=image/jpeg&HEIGHT=99&LAYERS=EEPP&WIDTH=183&SERVICE=WMS&BBOX=413276.0389803443,4066482.0439935336,675346.7028941214,4208125.2305295570&REQUEST=GetMap&TRANSPARENT=FALSE&STYLES=&VERSION=1.3.0&CRS=EPSG:25830</a><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I get an image:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><img border="0" width="870" height="344" style="width: 9.0625in; height: 3.5833in;" id="gmail-m_408233360926504808Imagen_x0020_1" src="cid:178b0ff14125b006a1"><span lang="EN-GB"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">But If I use the same parameters in a XML file, like as this:<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><GDAL_WMS><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <Service name="WMS"><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <Version>1.3.0</Version><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <ServerUrl><a href="https://wms.mapa.gob.es/sigpac/ows?SERVICE=WMS&amp;username=&amp;password=" target="_blank">https://wms.mapa.gob.es/sigpac/ows?SERVICE=WMS&amp;username=&amp;password=</a></ServerUrl><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <Layers>EEPP</Layers><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <CRS>EPSG:25830</CRS><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <ImageFormat>image/jpeg</ImageFormat><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <Transparent>FALSE</Transparent><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <BBoxOrder>xyXY</BBoxOrder><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  </Service><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <DataWindow><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <UpperLeftX>413276.0389803443</UpperLeftX><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <UpperLeftY>4208125.2305295570</UpperLeftY><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <LowerRightX>675346.7028941214</LowerRightX><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <LowerRightY>4066482.0439935336</LowerRightY><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <SizeX>183</SizeX><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">    <SizeY>99</SizeY><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  </DataWindow><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <Timeout>1600</Timeout><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <BandsCount>3</BandsCount><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <BlockSizeX>1024</BlockSizeX><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <BlockSizeY>1024</BlockSizeY><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <OverviewCount>20</OverviewCount><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <UserPwd>:</UserPwd><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <UnsafeSSL>true</UnsafeSSL><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">  <ZeroBlockHttpCodes></ZeroBlockHttpCodes><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"></GDAL_WMS><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">And then I run the next gdal command: gdal_translate -of JPEG -outsize 183 99 C:\Users\elena\AppData\Local\Temp\tmpnuevo.xml C:\Users\elena\AppData\Local\Temp\miimagen.jpeg<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">The result is :<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">Input file size is 183, 99<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">0ERROR 1: GDALWMS: Unable to download block 0, 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">URL: <!doctype html><html lang="es"><head><title>Estado HTTP 401 ÔÇô No autorizado</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;}
 h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado HTTP 401 ÔÇô No autorizado</h1><hr class="line" /><p><b>Tipo</b> Informe
 de estado</p><p><b>mensaje</b> Unauthorized</p><p><b>Descripci</span><span lang="EN-GB" style="font-size:9pt;font-family:Arial,sans-serif">├</span><span lang="EN-GB" style="font-size:9pt">│</span><span lang="EN-GB" style="font-size:9pt">n</b> Este
 requerimiento requiere autenticaci</span><span lang="EN-GB" style="font-size:9pt;font-family:Arial,sans-serif">├</span><span lang="EN-GB" style="font-size:9pt">│</span><span lang="EN-GB" style="font-size:9pt">n HTTP.</p><hr class="line" /><h3>Apache
 Tomcat/9.0.37</h3></body></html><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">  HTTP status code: 401, error: <!doctype html><html lang="es"><head><title>Estado HTTP 401 ÔÇô No autorizado</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3,
 b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado HTTP 401 ÔÇô No autorizado</h1><hr
 class="line" /><p><b>Tipo</b> Informe de estado</p><p><b>mensaje</b> Unauthorized</p><p><b>Descripci</span><span lang="EN-GB" style="font-size:9pt;font-family:Arial,sans-serif">├</span><span lang="EN-GB" style="font-size:9pt">│</span><span lang="EN-GB" style="font-size:9pt">n</b>
 Este requerimiento requiere autenticaci</span><span lang="EN-GB" style="font-size:9pt;font-family:Arial,sans-serif">├</span><span lang="EN-GB" style="font-size:9pt">│</span><span lang="EN-GB" style="font-size:9pt">n HTTP.</p><hr class="line" /><h3>Apache
 Tomcat/9.0.37</h3></body></html>.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see <a href="http://www.gdal.org/frmt_wms.html" target="_blank">http://www.gdal.org/frmt_wms.html</a>).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">ERROR 1: C:\Users\elena\AppData\Local\Temp\tmpnuevo.xml, band 1: IReadBlock failed at X offset 0, Y offset 0: GDALWMS: Unable to download block 0, 0.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">URL: <!doctype html><html lang="es"><head><title>Estado HTTP 401 ÔÇô No autorizado</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3, b {color:white;background-color:#525D76;}
 h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado HTTP 401 ÔÇô No autorizado</h1><hr class="line" /><p><b>Tipo</b> Informe
 de estado</p><p><b>mensaje</b> Unauthorized</p><p><b>Descripci</span><span lang="EN-GB" style="font-size:9pt;font-family:Arial,sans-serif">├</span><span lang="EN-GB" style="font-size:9pt">│</span><span lang="EN-GB" style="font-size:9pt">n</b> Este
 requerimiento requiere autenticaci</span><span lang="EN-GB" style="font-size:9pt;font-family:Arial,sans-serif">├</span><span lang="EN-GB" style="font-size:9pt">│</span><span lang="EN-GB" style="font-size:9pt">n HTTP.</p><hr class="line" /><h3>Apache
 Tomcat/9.0.37</h3></body></html><u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">  HTTP status code: 401, error: <!doctype html><html lang="es"><head><title>Estado HTTP 401 ÔÇô No autorizado</title><style type="text/css">body {font-family:Tahoma,Arial,sans-serif;} h1, h2, h3,
 b {color:white;background-color:#525D76;} h1 {font-size:22px;} h2 {font-size:16px;} h3 {font-size:14px;} p {font-size:12px;} a {color:black;} .line {height:1px;background-color:#525D76;border:none;}</style></head><body><h1>Estado HTTP 401 ÔÇô No autorizado</h1><hr
 class="line" /><p><b>Tipo</b> Informe de estado</p><p><b>mensaje</b> Unauthorized</p><p><b>Descripci</span><span lang="EN-GB" style="font-size:9pt;font-family:Arial,sans-serif">├</span><span lang="EN-GB" style="font-size:9pt">│</span><span lang="EN-GB" style="font-size:9pt">n</b>
 Este requerimiento requiere autenticaci</span><span lang="EN-GB" style="font-size:9pt;font-family:Arial,sans-serif">├</span><span lang="EN-GB" style="font-size:9pt">│</span><span lang="EN-GB" style="font-size:9pt">n HTTP.</p><hr class="line" /><h3>Apache
 Tomcat/9.0.37</h3></body></html>.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt">Add the HTTP status code to <ZeroBlockHttpCodes> to ignore this error (see
<a href="http://www.gdal.org/frmt_wms.html" target="_blank">http://www.gdal.org/frmt_wms.html</a>).<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:9pt"><u></u> <u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">And there are not any image.<u></u><u></u></span></p>
<p class="MsoNormal"><span lang="EN-GB">I´m using gdal 3.0, and I don´t understand why works at web browser and don´t works with gdal, I am doing something wrong? Thank you very much and regards<u></u><u></u></span></p>
</div>

<hr>

<table style="height:50px;width:473px">
  <tbody>
  <tr>
    <td>
      <p style="font-size:10pt;font-family:Arial" align="right"><img border="0" src="https://www.aplitop.com/descargas/firma1.jpg"></p></td>
    <td style="font-size:12pt;height:25px;font-family:"Times New Roman";width:330px" valign="top">
      <div style="line-height:13px" align="left"><span style="font-size:9pt;font-family:"Myriad Pro","Open Sans",Arial"><strong>Elena Ruiz </strong></span><br><span style="font-size:7pt;font-family:"Myriad Pro","Open Sans",Arial">Sofware Development & Technical Support<br></span><span style="font-size:7pt;font-family:"Myriad Pro","Open Sans",Arial">Tel. 
      +34 952 43 97 71  <br><a href="mailto:eruiz@aplitop.com" target="_blank">eruiz@aplitop.com</a><br>Sumatra, 9 - 29190 Málaga (Spain)<br></span><span style="font-size:7pt;font-family:"Myriad Pro","Open Sans",Arial"><strong><a href="http://www.aplitop.com" target="_blank">www.aplitop.com</a><br><br><a href="https://www.facebook.com/AplitopSL/" target="_blank"><img style="height: 15px; width: 15px;" border="0" src="cid:178b0ff141346ea9a502" width="15" height="15"></a>   <a href="https://twitter.com/aplitop" target="_blank"><img style="height: 15px; width: 15px;" border="0" src="cid:178b0ff141397f04d0a3" width="15" height="15"></a>   <a href="https://www.linkedin.com/company/aplitop" target="_blank"><img style="height: 15px; width: 15px;" border="0" src="cid:178b0ff1413dbe1ae414" width="15" height="15"></a>   <a href="https://www.youtube.com/user/aplitop" target="_blank"><img style="height: 15px; width: 15px;" border="0" src="cid:178b0ff1413ca49fca85" width="15" height="15"></a></strong></span></div></td></tr></tbody></table>
<p style="font-size:10pt;font-family:Arial"><span style="font-size:6pt;font-family:"Myriad Pro"">In accordance with the 
provisions of the European Regulation of Data Protection 2016/679 (Reglamento 
Europeo de Protección de Datos 2016/679), we inform you that the data and the 
information you provide us through this medium will be used by APLITOP, S.L., 
with C.I.F. B-92543396 and with address at C / Sumatra, 9, Malaga, 29190, in 
order to answer your questions and inform you about our products. The data 
provided will be kept as long as it does not request its cessation and will not 
be transferred to third parties except in cases where there is a legal 
obligation. You have the right to access your personal data, correct inaccurate 
data or request its deletion when the data is no longer necessary for the 
purposes that were collected, as well as any rights recognized in the RGPD 
2016/679<br><br><a title="" href="https://www.aplitop.com/Event/en/358/intergeo-2019" target="_blank"></a><br><br></span></p></div>

_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Regards,</div><div dir="ltr">Daniele Romagnoli</div><div dir="ltr">==</div><div dir="ltr">GeoServer Professional Services from the experts! Visit <a href="http://goo.gl/it488V" target="_blank">http://goo.gl/it488V</a> for more information.</div><div dir="ltr">==</div><div dir="ltr"><br></div><div dir="ltr">Ing. Daniele Romagnoli</div><div dir="ltr">Senior Software Engineer</div><div dir="ltr"><br></div><div dir="ltr">GeoSolutions S.A.S.</div><div dir="ltr">Via di Montramito 3/A</div><div dir="ltr">55054  Massarosa (LU)</div><div dir="ltr">Italy</div><div dir="ltr">phone: +39 0584 962313</div><div dir="ltr">fax:      +39 0584 1660272</div><div dir="ltr"><br></div><div dir="ltr"><a href="http://www.geo-solutions.it" target="_blank">http://www.geo-solutions.it</a></div><div dir="ltr"><a href="http://twitter.com/geosolutions_it" target="_blank">http://twitter.com/geosolutions_it</a></div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><span style="font-size:12.8px">-------------------------------------------------------</span></div><div dir="ltr"><span style="font-size:12.8px"><br></span></div><div dir="ltr"><span style="font-size:12.8px">Con riferimento alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se potesse darmene notizia.</span></div><div dir="ltr"><span style="font-size:12.8px"><br></span></div><div dir="ltr"><span style="font-size:12.8px">This email is intended only for the person or entity to which it is addressed and may contain information that is privileged, confidential or otherwise protected from disclosure. We remind that - as provided by European Regulation 2016/679 “GDPR” - copying, dissemination or use of this e-mail or the information herein by anyone other than the intended recipient is prohibited. If you have received this email by mistake, please notify us immediately by telephone or e-mail.</span></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>