Een webservice
Nu heb ik een verwijzing naar deze webservice met als naam 'm'
en hij retouneert 2! terwijl het enige wat hij mag retouneren 10 en 30 is
What's wrong?
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
| Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
' To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
' <System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="******")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class NieuwePagina
Inherits System.Web.Services.WebService
<WebMethod()> _
Public Function Authenticate(ByVal user_name As String, ByVal user_password As String) As SoapResult
Dim db As New clsDatabase
Try
db.Connect("Select * from tblUser Where (user_naam=" & db.f(user_name) & ") and (user_wachtwoord=" & db.f(user_password) & ")")
If (db.Field("user_pagina") = True) Then
'Session("user_authenticated") = True
Return SoapResult.Success
End If
db.Disconnect()
Catch ex As System.Exception
Return SoapResult.Exception
End Try
End Function
Enum SoapResult
Success = 10
NotAuthenticated = 20
Exception = 30
End Enum
End Class |
Nu heb ik een verwijzing naar deze webservice met als naam 'm'
code:
1
| m.Authenticate(My.Settings.Username, My.Settings.Password) |
en hij retouneert 2! terwijl het enige wat hij mag retouneren 10 en 30 is
What's wrong?