First Web Service
-
Hi Everybody, I am using web services first time. Only for my understanding I have used very simple functionality: Addition of two numbers and population of a dropdown list. My questions are 1- when I used "Namespace" It raised an error that 'error BC30002: Type 'First Web Service' is not defined.' later I commented out namespace it is working fine. any tip how to sortout this error. 2- Basically I play all the time with database (binding and manipulating data with controls )and desperate to use WCF and web services. Is this any better/helpful to use in the same way I have use in the FirstWebService. why I am asking this because I can perform the same functionality using simple classes. I dont see any difference or I am confusing myself. any help will be appreciated. FirstWebService code: Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports Microsoft.VisualBasic Imports System.Data Imports System.Data.SqlClient Imports App_Code.DB Imports App_Code.Web 'Namespace App_Code.Web ' 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:="http://tempuri.org/")> _ <WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ Public Class FirstWebService Inherits System.Web.Services.WebService Dim dbeng As DBEngine Dim lEBStruct As EBStruct Public Sub New() dbeng = New DBEngine dbeng.YourDBName = ConnectionSource.DBName.PupilVoice End Sub Private _YGid As Integer Private _YGDesc As String Public Property YGId() As Integer Get Return _YGid End Get Set(ByVal value As Integer) _YGid = value End Set End Property Public Property YGDesc() As String Get Return _YGDesc End Get Set(ByVal value As String) _YGDesc = value End Set End Property <WebMethod()> _ Public Function HelloWorld() As String Return "Hello Mathematician" End Function <WebMethod()> _ Public Function AddTwoIntegers(ByVal dig1 As Integer, ByVal dig2 As Integer) As String Return Convert.ToString("<br/>you entered teri tou two digits: " & dig1 & " and " & dig2 & ". Sum of two digits is " & dig1 + d