You are here: Re: accessing web service... « PHP Programming Language « IT news, forums, messages
Re: accessing web service...

Posted by shimmyshack on 06/26/07 08:56

On Jun 26, 5:08 am, shotokan99 <soft_devj...@yahoo.com> wrote:
> i modified it using this code:
> $ch=curl_init();
> curl_setopt($ch,CURLOPT_URL,$xgo);
> curl_setopt($ch, CURLOPT_HEADER, false);
> curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
> $xresult=curl_exec($ch);
>
> echo var_dump($xresult);
>
> the response is: httpstatus 403
>
> >have you encoded the url in the get paramater properly.
> >have you tried it locally returning static xml, debug locally then set
> >it free.
>
> yes. im completely sure that my parameters entries are 100% ok,
> because i run it straight to the browser address bar and it gives a
> valid xml response. i have no firewall issue becuase i tried to run
> xml before and it was doin ok. the only difference to what i did
> before is, im passing a formatted xml and this time the request is
> done thru query string.

since you get a 403, you're right the data is going both ways so the
firewall doesnt seem to be a factor.
But remember I guess you were using a browser before, now you are
using php, that makes things completely different, I'm not sure what
you mean when you say that "the only difference to what i did before
is, im passing a formatted xml and this time the request is done thru
query string" - have you tried doing this in a browser, are you sure
it is acceptable, 403 means forbidden after all.
My guess would be that you are required to do things that a browser
does, change the user agent, and start accepting cookies, so that cURL
looks more like a browser, and finally send and receive the data just
as the browser does. You aren't far off, but remember that most web
services (free ones) wouldn't like to be thrashed by a program and may
well have retrictions - if it has a howto follow compltetly to the
letter, but you should be alright with just mimicking what works, cURL
can do it just required a few more options and tweaks.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация