Hello,
I fixed the problem I was having before
http://www.computerhelp.forum/t73531.html
by including the .wsdl as a web reference in my client.
I changed the code to return a class insteadof a decimal, but I get soap errors on client when I try to access the values in the object. I am also having problems passing back a string. Decimal works fine.
Here is my code
-------------------
Imports System.Web.Services
Public Class temp_values
Public temp As Decimal
Public fUnit As String
End Class
<WebService(Namespace:="http://tempuri.org/")> _
Public Class CTemp
Inherits System.Web.Services.WebService
<WebMethod()> Public Function GetTemp(ByVal Temperature As Decimal, _
ByVal FromUnits As String ) As temp_values
Dim tVal As temp_values
tVal.fUnit = FromUnits
Select Case FromUnits.ToUpper.Chars(0)
Case "F" Fahrenheit
tVal.temp = ((Temperature - 32) * 5) / 9
Return tVal
Case "C" Celsius
tVal.temp = ((Temperature - 32) * 5) / 9
Return tVal
End Select
End Select
End Function
End Class
---------------------
The following page talks about returning a dataset
http://www.dotnetextreme.com/articles/complexDataType.asp
Do you know how to pass back user defined classes?
Thanks,
Burak
I fixed the problem I was having before
http://www.computerhelp.forum/t73531.html
by including the .wsdl as a web reference in my client.
I changed the code to return a class insteadof a decimal, but I get soap errors on client when I try to access the values in the object. I am also having problems passing back a string. Decimal works fine.
Here is my code
-------------------
Imports System.Web.Services
Public Class temp_values
Public temp As Decimal
Public fUnit As String
End Class
<WebService(Namespace:="http://tempuri.org/")> _
Public Class CTemp
Inherits System.Web.Services.WebService
<WebMethod()> Public Function GetTemp(ByVal Temperature As Decimal, _
ByVal FromUnits As String ) As temp_values
Dim tVal As temp_values
tVal.fUnit = FromUnits
Select Case FromUnits.ToUpper.Chars(0)
Case "F" Fahrenheit
tVal.temp = ((Temperature - 32) * 5) / 9
Return tVal
Case "C" Celsius
tVal.temp = ((Temperature - 32) * 5) / 9
Return tVal
End Select
End Select
End Function
End Class
---------------------
The following page talks about returning a dataset
http://www.dotnetextreme.com/articles/complexDataType.asp
Do you know how to pass back user defined classes?
Thanks,
Burak