From: Scott N. <sni...@sc...> - 2004-09-30 16:26:31
|
I have added "follow HTTP redirection" to my to-do list. As for non-200 status, SOAP Faults are returned with a 5xx status, so = they must be handled by the "usual" SOAP code. Other errors are usually = "caught" when it is determined that their Content-Type is not text/xml. Scott Nichol Do not send e-mail directly to this e-mail address, because it is filtered to accept only mail from specific mail lists. ----- Original Message -----=20 From: "Ghislain" <ghi...@lo...> To: <nus...@li...> Sent: Wednesday, September 29, 2004 3:38 PM Subject: [Nusoap-general] HTTP response handling >=20 > Hi all, >=20 > I didn't find any mechanisms to raise error when HTTP response is not=20 > 200 OK. > I added the following lines to return an error (if 404, 501, ...) or = to=20 > redirect automaticaly in case of error 301 (permanent redirect). I'm = not=20 > sure it's the clean way to do it and I didn't test extensively. >=20 >=20 > Ghislain >=20 >=20 >=20 > l. 2156 nusoap.php >=20 >=20 > add: >=20 > if (ereg('^HTTP/1.1 301',$header_array[0]) && > $this->incoming_headers['location']) { // Moved Permanently > // reconstruct... not really nice but works > $this->soap_transport_http($this->incoming_headers['location']); > $this->tryagain=3Dtrue; > return false; > } >=20 > if (!ereg('^HTTP/1.1 200 OK',$header_array[0])) { > $this->setError('Response error '.$header_array[0]); > return false; > } >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: IT Product Guide on = ITManagersJournal > Use IT products in your business? Tell us what you think of them. Give = us > Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out = more > http://productguide.itmanagersjournal.com/guidepromo.tmpl > _______________________________________________ > Nusoap-general mailing list > Nus...@li... > https://lists.sourceforge.net/lists/listinfo/nusoap-general > |