>I was accessing a kind of web service for a number of years. No WSDL or any such, just sending url-encoded xml and getting more xml in return and it worked fine.
>Now it redirects me from
www.someserver.com/portal/services to /#/portal?query= and then I'm supposed to add xml={actual xml here} to the url. However, HTTPGet() just returns the redirection but of course can't follow it. Tried to navigate directly to
www.someserver.com/#/portal?query= but it seems that some bit gets lost in the process. In the headers returned I get a "1.1 404 not found", and the buffer returned contains some html saying "Cannot POST /".
>
>The service is 99% serving browser clients, i.e. other web apps. I seem to be their only fat client (though opinions may vary, I got only 86kg), going HttpGet() without a browser, so... anyone knows a trick for this?
Dragan,
This will not solve your issue, but may be give something more for you to work (if you didn't check it already).
LOCAL HTTP AS WinHttp.WinHttpRequest
LOCAL URL AS String
LOCAL Redirected AS String
m.URL = "http://www.someserver.com/#/portal?query=somedata"
m.HTTP = CREATEOBJECT("WinHttp.WinHttpRequest.5.1")
m.HTTP.Open("Get", GETWORDNUM(m.URL, "#", 1), .f.)
m.HTTP.Send()
IF m.HTTP.Status = 302
m.Redirected = m.HTTP.Getresponseheader("Location")
MESSAGEBOX(TEXTMERGE("Redirected to <<m.Redirected>>"))
m.HTTP.Open("Get", m.Redirected, .F.)
m.HTTP.Send()
ENDIF
? "" + m.HTTP.Responsebody
At least you'll know to where you're being redirected. Then you'll have to figure out some way to pass your arguments to the Web Service (without actually trying it is difficult for me to give more "ideas" beside this one...).
----------------------------------
António Tavares Lopes