[Jwap-info] URL Redirection Header Problems
Brought to you by:
mcdmx,
nikobender
|
From: Domingo M. <dom...@zw...> - 2004-07-06 22:37:45
|
Hi everybody, I have been testing the jWAP package and it has worked very well. However, today I found a problem and it seems to me that it is related with the management of URL redirections (different to a WAP Gatew= ay redirection) because there is no method to set a "setFollowRedirects(true= )". As a concrete example consider the following URL: http://wap.tmovil.cl Using jWAP I receive the following exceptions after been connected to the= =20 gateway: **************************************************** Connecting to WAP-Gateway connected to WAP gateway GET http://wap.tmovil.cl java.lang.ArrayIndexOutOfBoundsException: 1 at net.sourceforge.jwap.wsp.WSPDecoder.getUint8(Unknown Source) at=20 net.sourceforge.jwap.wsp.header.WAPCodePage.decodeContentType(Unknown Sou= rce) at net.sourceforge.jwap.wsp.pdu.CWSPPDU.getContentType(Unknown So= urce) at net.sourceforge.jwap.wsp.pdu.CWSPPDU.getPDU(Unknown Source) at net.sourceforge.jwap.wsp.CWSPMethodManager.tr_process(Unknown=20 Source) at net.sourceforge.jwap.wtp.CWTPInitiator.process(Unknown Source) ***************************************************** Looking for an answer I used the Jakarta HttpClient GetMethod to get that URL. The results are the following: **************************************************** Host: wap.tmovil.cl User-Agent: Jakarta Commons-HttpClient/2.0final *** Answer Headers *** Status: HTTP/1.1 302 Found Date: Tue, 06 Jul 2004 21:59:03 GMT Server: Apache/2.0.47 (Unix) mod_ssl/2.0.47 OpenSSL/0.9.6j PHP/4.3.3=20 mod_jk/1.2.6-dev X-Powered-By: PHP/4.3.3 Location: http://wap.tmovil.cl/tmc/portal/index.php Content-Length: 0 Content-Type: text/html; charset=3DISO-8859-1 **************************************************** As you can see the Content-Lenght is 0 and the Status is 302. In this cas= e there is no information to get and, obviously, to decode because we have = a redirection. The new URL can be found in the header Location as=20 http://wap.tmovil.cl/tmc/portal/index.php When I use this URL with jWAP everything works without problems: **************************************************** Connecting to WAP-Gateway connected to WAP gateway GET http://wap.tmovil.cl/tmc/portal/index.php jWAP: decodeContentType: parameter decoding not yet supported Response received En CWSPResult: Content Type: application/vnd.wap.wmlc 95 bytes writing to a file Token: 39 element namecard Token: 51 element nameonevent Token: 43 element namego Token: 60 element nametimer Token: 32 element namep Token: 3 Token: 32 element namep Token: 28 element namea Token: 3 Headers: Date: Tue, 6 Jul 2004 15:02:49 PDT Server: Apache/2.0.47 (Unix) mod_ssl/2.0.47 OpenSSL/0.9.6j PHP/4.3.3=20 mod_jk/1.2.6-dev X-Powered-By: PHP/4.3.3 Disconnecting from WAP-Gateway Disconnected. **************************************************** I am going to check the code to find a way to handle it. Even though CWSP= Reply have defined the 302 code, I am not pretty sure that CWSPSession is handl= ing=20 this case (in STATE_RESUMING there is a check for if (pdu2.getStatus() =3D= =3D=20 CWSPReply._200_OK_Success) but all the other cases implies s_disconnect()= ). I appreciate any suggestions. Best Regards, Domingo Morales. |