burak Posted June 27, 2003 Posted June 27, 2003 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 Quote
Administrators PlausiblyDamp Posted June 27, 2003 Administrators Posted June 27, 2003 (edited) Have you refreshed the web reference on the client? If not that means the client is still expecting a decimal and not the string / user defined class. Edited May 21, 2007 by PlausiblyDamp Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
burak Posted June 27, 2003 Author Posted June 27, 2003 Yes, I refreshed the web reference on the client. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.