Web service request not working

J Trahair

Well-known member
Joined
May 14, 2008
Messages
175
Location
Spain
Programming Experience
10+
Hi. I am trying to get a response from a web service (online ticket sales) to check a ticket or to redeem one. However, nothing seems to happen except StatusDescription = OK and StatusCode = 200. Even when I deliberately misspell the user name, password, ticket number (credentials) etc, it still returns OK and 200. Can anyone let me know what I have missed? No errors are raised.

(This has to be suitable for Windows CE6.0.)

Thanks in advance.

VB.NET:
        'Imports System.Net

        Dim myCredentials As New System.Net.NetworkCredential("username", "password")

        '1. validate a ticket - takes barcode and returns qty active
        Dim request1 As WebRequest = WebRequest.Create("http://tickets.co.uk/api/validateTicket?barcode=" & TextBox1.Text)

        request1.Credentials = myCredentials

        Dim response1 As WebResponse = request1.GetResponse()

        MsgBox(CType(response1, HttpWebResponse).StatusDescription)
        MsgBox(CType(response1, HttpWebResponse).StatusCode)

        response1.Close()


        '2. redeem a ticket - takes barcode + qty, redeems and indicates success 
        'or failure
        Dim request2 As WebRequest = WebRequest.Create("http://tickets.co.uk/api/redeemTicket?barcode=" & TextBox1.Text & "&quantity=" & strResult1)

        request2.Credentials = myCredentials

        Dim response2 As WebResponse = request2.GetResponse()

        MsgBox(CType(response2, HttpWebResponse).StatusDescription)
        MsgBox(CType(response2, HttpWebResponse).StatusCode)

        response2.Close()


        '3. validate an order - takes any ticket barcode, discards ticket id, and 
        'returns order details/state or failure
        Dim request3 As WebRequest = WebRequest.Create("http://tickets.co.uk/api/validateOrder?barcode=" & TextBox1.Text)

        request3.Credentials = myCredentials

        Dim response3 As WebResponse = request3.GetResponse()

        MsgBox(CType(response3, HttpWebResponse).StatusDescription)
        MsgBox(CType(response3, HttpWebResponse).StatusCode)

        response3.Close()
 
I should add - I know the '("http://tickets.co.uk/api/validateOrder?barcode=" & TextBox1.Text)' sections are OK because I have the whole thing running in a Windows 8 version which uses ChilkatDotNet2 and different methods/functions but the same actual requests. I have to replicate this for a handheld terminal using WindowsCE6.0 and Compact Framework.
 
Back
Top