Click here to Skip to main content
15,897,187 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi I am new to SOAP and XML.

I need help with creating a login to a web service.

I am using VS to create an excel page to login into the web service. VS has created a lot of the web service coding for the connection

VB Code:

VB
Imports Microsoft.VisualStudio.Tools.Applications.Runtime
Imports Office = Microsoft.Office.Core
Imports Excel = Microsoft.Office.Interop.Excel
Imports Tools = Microsoft.Office.Tools.Excel
Imports Login = BetBotv2.au.com.tab.login
Imports Racing = BetBotv2.au.com.tab.racing

Public Class Sheet3

    Private Sub Sheet3_Startup() Handles Me.Startup
        Range("B5").Value = "Logged Out"

    End Sub

    Private Sub Sheet3_Shutdown() Handles Me.Shutdown

    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

        Range("B5").Value = "Logged Out"
        Button1.Visible = False
        Button2.Visible = True

    End Sub

    Private Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim user As String
        Dim pass As String
        Dim userLogin As New au.com.tab.login.Login
        Dim key As String


        user = Range("B2").Value
        pass = Range("B3").Value

        key = userLogin.GetKey(user, pass)
        Range("B4").Value = key

        If Range("B4").Value = "<error>Your username or password is invalid. Please try again.</error>" Then
            Range("B5").Value = "Login Error"
        ElseIf Range("B4").Value = "" Then
            Range("B5").Value = "Logged Out"
        Else
            Range("B5").Value = "Logged In"
        End If



        Button1.Visible = True
        Button2.Visible = False

    End Sub


WSDL

http://www.tab.com.au/LiveOdds/Services/Login/Login.wsdl?State=2

The above code appears to be communicating to the web service and returns invalid username and/or password. try again.
Password and username are valid which has been confirmed by the TAB

TAB also publish SOAP file which is

https://direct.tab.com.au/LiveOdds/Services/Login/Login.asmx

xml SOAP

HTML
POST /LiveOdds/Services/Login/Login.asmx HTTP/1.1
Host: direct.tab.com.au
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://direct.tab.com.au/LiveOdds/GetKey"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetKey xmlns="http://direct.tab.com.au/LiveOdds/">
      <userName>string</userName>
      <password>string</password>
    </GetKey>
  </soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetKeyResponse xmlns="http://direct.tab.com.au/LiveOdds/">
      <Key>string</Key>
    </GetKeyResponse>
  </soap:Body>
</soap:Envelope>


SOAP 1.2

The following is a sample SOAP 1.2 request and response. The placeholders shown need to be replaced with actual values.

HTML
POST /LiveOdds/Services/Login/Login.asmx HTTP/1.1
Host: direct.tab.com.au
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetKey xmlns="http://direct.tab.com.au/LiveOdds/">
      <userName>string</userName>
      <password>string</password>
    </GetKey>
  </soap12:Body>
</soap12:Envelope>

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetKeyResponse xmlns="http://direct.tab.com.au/LiveOdds/">
      <Key>string</Key>
    </GetKeyResponse>
  </soap12:Body>
</soap12:Envelope>



Can any one help as I said I am a newbie at XML and SOAP

Thanks in advance
Posted
Updated 20-Aug-11 4:20am
v2
Comments
Simon_Whale 12-Sep-11 17:17pm    
Can you verify that the username and password are correct?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900