-
How to provide a return URL?
Iam coding an app in C# to connect to a server, authenticate and then go ahead.
When I send in a authentication request, its response is via a URL. It needs a return URL by which it returns crucial data called ekey.
Can anyone please advise on how to provide a return URL and how to read back the data once it sends them back? I use WebClient, HttpRequest right now to post data.
-
Re: How to provide a return URL?
Sorry, I did not fully parse your question. Can you describe the exact authentication scheme? Who sends what where? when?
-
Re: How to provide a return URL?
Its not authentication - I just need a URL to be passed out so it'll be passed back.
-
Re: How to provide a return URL?
Quote:
Originally Posted by
CM2013
Its not authentication - I just need a URL to be passed out so it'll be passed back.
How does the web service you are calling do it? Are you the one who is writing that web service?
-
Re: How to provide a return URL?
Basically, we are querying a server, and the tech support guys there says when we query the page (page1), it
"returns an answer to a URL provided by us"
We provided the url say www.test1.com/testpage.aspx
The tech support guy says he updated our account so it returns the answer to the above URL.
Now, our "system must capture the returned data" which is returned to the above URL, as I understand.
How do we capture this data now? ANy help is greatly appreciated.
-
Re: How to provide a return URL?
http://stackoverflow.com/questions/2...n-the-response.
See the example of the client code in the link above.
-
Re: How to provide a return URL?
I have the code myself - this is what the tech support guy wrote to me:
"You would need to host a URL yourself, then capture the response from there. You need to advise us of the URL, in order for us to return the data to."
We did send him the URL and hes updated our account so it returns data to our url. How do they return data to another url? How do we capture it??
I sent a HTTP POST method to their server - how do I get the response and read it from our URL? He says its returned to our URL. How is it done was my question...if I wasn't clear earlier.
-
Re: How to provide a return URL?
Who is hosting the web page that returns the data? Whoever hosts that page, needs to modify the page to return appropriate data. Whoever calls the page needs to extract the data using HttpResponse.
The link I gave you shows what you need to do in the server side (inside the page) and on the client side.
The tech guy can't call your page and force it to return data (unless the page is modified to return the data).
You know, what you are trying to do is probably better done by a web service rather than in a web page.
-
Re: How to provide a return URL?
We are hosting the page. This is really annoying as the tech guy has no idea of it. I want an ekey from their server once we establish the session (Session ID). Thats all - he cant understand what it is.
I have a C# app written that will run as a standalone app, so we are not developing websites here. But we are coding to interact with Servebase and the tech guy there wanted an Authans URL to return the ekey. Simple but the nuts there have complicated it unnecessarily.
"Could you please let me know your AuthAns URL as soon as its available so that I can update the account. As default these are set to our HostedAnswer.asp page."
The URl we gave is blank. Now, I have to manage 3 different things - my C# app to servebase server and the testpage.aspx he says will post the data to. He leaves by 3 PM wasting our precious time and not clarifying.
Your answers are appreciated highly.
-
Re: How to provide a return URL?
Yes, you are right. A webservice is easier and less clumsy than a blank .aspx page. Now, for a simple ekey to be returned I need to connect 3 different devices.
-
Re: How to provide a return URL?
As I understand, I write a webservice in the URL we are hosting - as an .asmx page. ThenI query the page from my client windows form app, when the asmx page will query their server and then return back to me as a string. Am I in the right direction?
-
Re: How to provide a return URL?
If you change to a webservice (from the aspx page you have now), you'll need to read up on how to write an asmx web service.
I would first write the web service and get it to return some test data and then call the web service from client code.
Once you do that, then modify the web service code to call the tech service and return the real data.
-
Re: How to provide a return URL?
Yes, Iam reading up on how to do it - it seems to be a fairly straightforward process.
http://www.west-wind.com/presentatio...ebServices.asp
I dont think even that'll work here. Either way, its a function - whether its encapsulated in a webservice or a windows app.
He says:
"You need to provide us with a URL you can access, in order to receive the results and for us to hand control of the browser back to. "
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
It allows you to query and get a token. I have just finided Sec 4.1, 4.2. Its 4.3 Iam stuck with - the code is in it. Its the Auhtorization Request example. Pls advise.
-
Re: How to provide a return URL?
In the tech specs I have shown above:
its sec 4.4 Iam stuck with:
It says:
4.4 Authorisation Request Response
PC-EFT Payment Page ESM returns an answer to a URL provided by the merchant. The merchant’s system must capture the returned data.
-
Re: How to provide a return URL?
Quote:
Originally Posted by
CM2013
In the tech specs I have shown above:
its sec 4.4 Iam stuck with:
It says:
4.4 Authorisation Request Response
PC-EFT Payment Page ESM returns an answer to a URL provided by the merchant. The merchant’s system must capture the returned data.
Make a call to his system and retrieve the data. Use the link I provided as a guide to make a httprequest and use the httpresponse to retrieve the data.
Ask the tech guy if they have any C# sample code for call their service.
-
Re: How to provide a return URL?
Quote:
Originally Posted by
CM2013
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.
-
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.
-
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?
-
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
-
Re: How to provide a return URL?
Quote:
Originally Posted by
CM2013
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
Re: How to provide a return URL?
Why do you need to write the data to a file?
-
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.
-
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?
-
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).
-
1 Attachment(s)
Re: How to provide a return URL?
The third-party website here is Servebase, a company that provides payment solutions.
They return data to our URL hosted at say, test.net\mypage.aspx
The form field simply has the ekey I want, and I read it - I need a way to access this from my C# app - a stand alone app.
Hence, I write it to a file with a unique id - see attached.
Once this is done, the control is back to my C# app - I need to retrive this file and read the EKEY value in it. I dont know the filename as its dynamically generated for ease of use. If I give the same filename, it never gets updated for every request.
-
Re: How to provide a return URL?
Just downloaded the path where the txt files are stored and parsing it for now. A webservice would be neat, you are right - will do that tomm.
-
Re: How to provide a return URL?
Quote:
Originally Posted by
CM2013
The third-party website here is Servebase, a company that provides payment solutions.
They return data to our URL hosted at say, test.net\mypage.aspx
Honestly, I don't think it works that way - in other words, they don't return the data to your URL. More likely you make a call to their service inside your web page, the data gets returned and you write out the file with the unique name. It is important to make this distinction in order to understand what is going on. Please post the code that makes the call to their service (if you don't want to post it publically, then send it to me in a private message).
Quote:
Originally Posted by
CM2013
The form field simply has the ekey I want, and I read it - I need a way to access this from my C# app - a stand alone app.
Hence, I write it to a file with a unique id - see attached.
As I mentioned before, you are going to run into problems storing the files. There are file locking issues to content with, security issues and so forth. This approach really isn't too scalable or robust.
Quote:
Originally Posted by
CM2013
Once this is done, the control is back to my C# app - I need to retrive this file and read the EKEY value in it. I dont know the filename as its dynamically generated for ease of use. If I give the same filename, it never gets updated for every request.
Rather than having the C# app call into your web page (where the web page makes the call to Servebase to retrieve the key), you write the file and then access the file from your c# app, why not have the web page just return the data directly (without writing the file)?
So if I show you how to create a WCF service, that you call with the C# app, have you pass in the URL, and it returns an eKey all within the same call, will that work for you?
Last couple of questions. If a URL is passed (say URL_1) and the eKey (e.g. eKey1) is returned, does the same URL (i.e. URL_1) ever get passed again? If so, would the eKey (e.g. eKey1) from the first call still be valid? Or would a new eKey be returned? Understanding this helps determine if caching should be used.
-
Re: How to provide a return URL?
Quote:
Originally Posted by
Arjay
So if I show you how to create a WCF service, that you call with the C# app, have you pass in the URL, and it returns an eKey all within the same call, will that work for you?
Last couple of questions. If a URL is passed (say URL_1) and the eKey (e.g. eKey1) is returned, does the same URL (i.e. URL_1) ever get passed again? If so, would the eKey (e.g. eKey1) from the first call still be valid? Or would a new eKey be returned? Understanding this helps determine if caching should be used.
You are right - Iam actually calling their URL which could be handled by a webservice on their end.
I would figure out writing a webservice as myself - please do not spend your time on it.
Right now,am looking at iframes which is what is compliant with Servebase. We are supposed data thro' iFrame to an URL so it inturn does sending the ekey etc.