I get malicious web site errors trying to download that file from the site.
The HttpResponse does not fill a crucial field - ekey. It came back empty. They will only send it to our URL which is hosted at lintott.net. I need to find the link between what to call their server, how it passes to my URL and then I can read it. The .aspx hosted in lintott.net does nothing - its empty. These links are not done, until then it wont work. Nobody has done these calls before - from windows app -> servebase server to another URL in another server.
Will do this and post it - as I need it today.
If I do:
string post = "erst=authreq&elid=bebcppesmtest&esid=" + m_sSessionID + "";
HttpWebRequest WebReq = (HttpWebRequest)WebRequest.Create("https://wxuat.servebase.net/Hosted/HostedAnswer.asp?" + post);
WebReq.Method = "POST";
HttpWebResponse response = (HttpWebResponse)WebReq.GetResponse();
//read the response to stream and output it
Stream ds = response.GetResponseStream();
StreamReader sr = new StreamReader(ds);
Nothing comes back - it just shows the same string back - with the same fields filled in as I gave, and ekey empty. How does our URL fit in here? And where do I get it?
Its 1 MB - doesnt let me post. I could email if you are ok with email@example.com
Ok, will do. Will update this thread so its useful for other newbies. Get back to you on this.
My Supervisor thinks there is no whitelist . This is clearly a case of missing link. Will figure it out myself and post it here.
Is their server posts back to our url - linott.net/bebc then how do I get it? Web pages are stateless - it makes no sense the tech guy didnt give the link here. There is no way one can read from a webpage on some server. Data is not saved anywhere.
I think you are misinterpreting how this works. In my opinion, their website doesn't post back to your site, it merely returns data to you.
In other words, you make an httprequest using your url as the key and post it to their web site, they pass back the eKey to you which you retrieve using the httpresponse class.
You should be able to test this by coding up a small console application and make the appropriate httprequest call (using the link I gave you) and retrieve the eKey with the httpresponse.
Found the solution - used form fields to get the data posted by the other site and wrote the values needed to a text file. Will either use while loop to check for the file's existence to read the values back or write a webservice.
The only problem I ran into is that, first time I create the file on the webserver and write it, its fine. The next write is too slow or doesnt write at all. An expert suggested I write a new file every request - but I can't keep track them of all.
Found out the solution for the appending file problem as well: create a new file everytime and check its timestamp to get the latest file.
Why do you need to write the data to a file?
coz I need to read it from the text file from my C# app - I basically want to access a string thats returned as a form field.
Do you know how to read a list of files from a website folder that I have access to?? Or the latest file?
This approach is a bad idea in my opinion. You are going to have issues with the locking and access of the files.
Post the content of these 'files' (with mocked up data) and I'll show you how to create a web service around them (expect I won't use files).
If I recall correctly, you send in a url as the 'key' and then get an eKey (i.e. the contents of the file back). Is that correct. If so, send me a typical url that you use (or a fake one).