Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hello,

 

I fixed the problem I was having before

 

http://www.xtremedotnettalk.com/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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...