web service query
-
hii am using web service in my application.i added web refrence.now i am trying to use it in my code.actually it is temperature conversion web service. the code is:
Protected Sub ConvertButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ConvertButton1.Click
Dim wsConvert As localhost.Convert()
Dim temperature As Double = System.Convert.ToDouble(TemperatureTextBox.Text)
FarenhiteLabel.Text = wsConvert.FahrenheitToCelsius(temperature).ToString()
End Subbut i am not getting the function FahrenheitToCelsius() plz guide me where am i wrong...
-
hii am using web service in my application.i added web refrence.now i am trying to use it in my code.actually it is temperature conversion web service. the code is:
Protected Sub ConvertButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ConvertButton1.Click
Dim wsConvert As localhost.Convert()
Dim temperature As Double = System.Convert.ToDouble(TemperatureTextBox.Text)
FarenhiteLabel.Text = wsConvert.FahrenheitToCelsius(temperature).ToString()
End Subbut i am not getting the function FahrenheitToCelsius() plz guide me where am i wrong...
-
hii am using web service in my application.i added web refrence.now i am trying to use it in my code.actually it is temperature conversion web service. the code is:
Protected Sub ConvertButton1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ConvertButton1.Click
Dim wsConvert As localhost.Convert()
Dim temperature As Double = System.Convert.ToDouble(TemperatureTextBox.Text)
FarenhiteLabel.Text = wsConvert.FahrenheitToCelsius(temperature).ToString()
End Subbut i am not getting the function FahrenheitToCelsius() plz guide me where am i wrong...
-
web service code:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Convert
Inherits System.Web.Services.WebService<System.Web.Services.WebMethod()> \_
Public Function FahrenheitToCelsius(ByVal Fahrenheit As Double) _
As Double
Return ((Fahrenheit - 32) * 5) / 9
End Function<System.Web.Services.WebMethod()> \_ Public Function CelsiusToFahrenheit(ByVal Celsius As Double) \_ As Double Return ((Celsius \* 9) / 5) + 32 End Function
End Class
implementation code:
Partial Class Default4
Inherits System.Web.UI.PageProtected Sub ConvertButton1\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ConvertButton1.Click Dim wsConvert As localhost.Convert() Dim temperature As Double = System.Convert.ToDouble(TemperatureTextBox.Text) FarenhiteLabel.Text = wsConvert.FahrenheitToCelsius(temperature).ToString() 'wsConvert.FahrenheitToCelsius(temperature).ToString() ' CelciusLabel.Text = "Celsius To Fahrenheit = " & \_ ' wsConvert.CelsiusToFahrenheit(temperature).ToString() End Sub
End Class
-
web service code:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Public Class Convert
Inherits System.Web.Services.WebService<System.Web.Services.WebMethod()> \_
Public Function FahrenheitToCelsius(ByVal Fahrenheit As Double) _
As Double
Return ((Fahrenheit - 32) * 5) / 9
End Function<System.Web.Services.WebMethod()> \_ Public Function CelsiusToFahrenheit(ByVal Celsius As Double) \_ As Double Return ((Celsius \* 9) / 5) + 32 End Function
End Class
implementation code:
Partial Class Default4
Inherits System.Web.UI.PageProtected Sub ConvertButton1\_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ConvertButton1.Click Dim wsConvert As localhost.Convert() Dim temperature As Double = System.Convert.ToDouble(TemperatureTextBox.Text) FarenhiteLabel.Text = wsConvert.FahrenheitToCelsius(temperature).ToString() 'wsConvert.FahrenheitToCelsius(temperature).ToString() ' CelciusLabel.Text = "Celsius To Fahrenheit = " & \_ ' wsConvert.CelsiusToFahrenheit(temperature).ToString() End Sub
End Class
-
i got the solution... jst changed the code line as:
Dim wsConvert As localhost.Convert()
to
Dim wsConvert As localhost.Convert = New localhost.Convert()
nyway thanks.....