How to provide a return URL? - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 34

Thread: How to provide a return URL?

  1. #16
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,289

    Re: How to provide a return URL?

    Quote Originally Posted by CM2013 View Post
    I still cant see how this will work from a webservice as well. Iam writing a C# windpws app. I receive a session ID using a HTTP Post method. Just check this doc I have uploaded:

    http://www.sendspace.com/file/81gub1
    Please just zip this up and post it in a reply as an attachment.

    I get malicious web site errors trying to download that file from the site.

  2. #17

    Re: How to provide a return URL?

    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.

  3. #18

    Re: How to provide a return URL?

    If I do:

    Code:
    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);
                    MessageBox.Show(sr.ReadToEnd());

    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?

  4. #19

    Re: How to provide a return URL?

    Its 1 MB - doesnt let me post. I could email if you are ok with it.ct0306@outlook.com

  5. #20
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,289

    Re: How to provide a return URL?

    Quote Originally Posted by CM2013 View Post
    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.
    They are probably doing a whitelist onyour server. Give them the IP address of you dev box ans ask them to add it to the white list.

  6. #21

    Re: How to provide a return URL?

    Ok, will do. Will update this thread so its useful for other newbies. Get back to you on this.

  7. #22

    Re: How to provide a return URL?

    My Supervisor thinks there is no whitelist . This is clearly a case of missing link. Will figure it out myself and post it here.

  8. #23

    Re: How to provide a return URL?

    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.

  9. #24
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,289

    Re: How to provide a return URL?

    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.

  10. #25

    Re: How to provide a return URL?

    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.

  11. #26

    Re: How to provide a return URL?

    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.

  12. #27
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,289

    Re: How to provide a return URL?

    Why do you need to write the data to a file?

  13. #28

    Re: How to provide a return URL?

    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.

  14. #29

    Re: How to provide a return URL?

    Do you know how to read a list of files from a website folder that I have access to?? Or the latest file?

  15. #30
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,289

    Re: How to provide a return URL?

    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).

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center