Forum

HTTP Requests in vb.net
This thread is public.
avatar
XXLServers


Hello,

Im trying to implement Zaypay in my vb.net application. The response seems to be working, but all I’m getting is the following XML code:

<?xml version=”1.0” encoding=”UTF-8”?> <response> <error>Not Found</error> </response>

Ive tried using different requests, an example:

https://secure.zaypay.com/ipaddress/pay/price_setting_id/locale_for_ip?key=price_setting_key

Of course replacing ipaddress an IP address (and tried others too), replacing price_setting_id with a price setting I made on this account and the key is the price setting key thats on the price setting page.

Is there something wrong in my code or in my request url?

If needed, I will post the vb.net code im using.

Thanks for the help.

avatar
bastiaan


Hi XXLS,

I’ve checked our logs and the cause is you’re using a POST request. As the locale_for_ip-method only returns data, and doesn’t ‘change state’ in our system (and needs to be able to be cached) only GET requests are allowed for this method.

You can use GET-requests for any method if you want (which is quite ugly), or you can use GET to read and POST for things that ‘change state’.

I hope this helps you, please ask anything else if you encounter other problems.

Best regards,

Bastiaan

avatar
XXLServers


Hey Bastiaan,

Stupid me, must have been coding too long hehe.

After using data from a different file, I forgot to change POST to GET.

Works fine now, cheers!

On another note, when Im receiving a report from your server, the manual tells me to respond to that, but as far as I can see I can only use the VB.NET ‘HttpWebResponse’ after a webrequest, which Im not doing.

How does your server expect the code back, I tried to look in the php files, but most functions there are no use for VB.NET.

I have no problem getting the data from the Zaypay reportings, but I cant use

die (’ok’);

or at least cant find a function in .NET to send anything back.

avatar
bastiaan


Hi XXLS,

Great that solved problem #1

Code long, drink much coffee :)

Well, I’m no VB.NET expert (at all) but I’d say this. The script that lives at the report_url is just another page? A page can display anything you want? You don’t have to initiate another request to make this work, you just respond with a page that just contains ok. Or is that the problem? (I can hardly imagine?)

Best regards,

Bastiaan

avatar
bastiaan


(oh, and if you don’t reply with the ok thing, we’ll try a few more times. This is nice for when there is a temporary hickup on your end (say too many connections on your db), the retries will still trigger your business logic when it comes back on. As soon as a satisfactory response is detected the retries are stopped.)

avatar
XXLServers


Alright, I guess I was thinking way beyond the simple solution.

If it is just about displaying that, then thats indeed an easy one.

Cheers for all the help.

avatar
bastiaan


Great to be of help, anytime.

Best regards,

Bastiaan