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