cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice Working but Not PDA Application

Former Member
0 Kudos

HI everyone, I got a problem. I am on a school project which uses a PDA to connect to the webservice. The PDA will uses the web service to retrieve values from SAP. I tried my webservice for a simple function like Login it is successful. But when i run my PDA emulator on visual studio it is unable to work. I am unable to solve this error, can anyone help me pls. Thank you:)

The following is my webservice coding

  <WebMethod(EnableSession:=True, Description:="This method is used to verify and retrieve a user info upon logging in")> _
 Public Function Login(ByVal Email As String, _
                                ByVal Password As String) As String


        Dim oCompany As SAPbobsCOM.Company
        Dim oRecSet As SAPbobsCOM.Recordset
        Dim LoginExist As String
        'Dim oDocument As SAPbobsCOM.Documents = Nothing

        'oDocument = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
        'oDocument. = SAPbobsCOM.BoDocumentTypes.dDocument_Items

        Try
            SetConnectionParam("S10036633", "SBODemo_SG", "manager", "manager", "sa", "P@ssw0rd")

            If ConnectToDatabase() Then
                oCompany = Session("g_CompanyConnection")
                oRecSet = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
                oRecSet.DoQuery("SELECT T0.[firstName] FROM OHEM T0 WHERE T0.[email]='" & Email & "'  AND  T0.[homeTel]='" & Password & "'  AND  T0.[position] IN (3,5)")

                If Not oRecSet.EoF Then
                    LoginExist = "True"
                Else
                    LoginExist = "False"
                End If

            End If
        Catch ex As Exception
            Session("g_LastErrorMsg") = ex.Message
        End Try
        Return LoginExist

    End Function

The following is my coding in visual studio 2005, where this method is to consume ( or use) the webservice method.

  Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogin.Click
        Dim localhost As New localhost.Service
        Dim dtLogin As String = ""
        Dim Username As String = ""
        Dim Password As String = ""

        Username = CType(txtUsername.Text, String)
        Password = CType(txtPassword.Text, String)
        dtLogin = localhost.Login(Username, Password)

        If dtLogin = "True" Then
            Dim form As New frmHome
            form.Show()
        Else
            MessageBox.Show("Invalid Username / Password")
        End If


    End Sub   

The following is the simple design for my PDA.

<a href="http://img389.imageshack.us/my.php?image=screenshot2887tb0.jpg">[IMG]http://img389.imageshack.us/img389/503/screenshot2887tb0.th.jpg[/IMG]</a>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi again, this is my image for my PDA .

http://img389.imageshack.us/my.php?image=screenshot2887tb0.jpg

Thanks all for your help really appreciate it.