0
Reply

web method not running when being passed a double (ByVal num1 As Double)

crunchie xx

crunchie xx

Feb 4 2010 4:44 PM
2.4k
When the following method is invoked from the .asp page i get the "HTTP 500 internal error"
when invoked from the .asmx page it runs just fine,

<WebMethod()> Public Function Delivery(ByVal num1 As Double) As Double

        If IsNumeric(num1) Then

            If num1 < 1 Then
                Return Math.Round(3.2, 2)
            ElseIf num1 < 4.9 Then
                Return Math.Round(1.6 * num1, 2)
            ElseIf num1 < 9.9 Then
                Return Math.Round(0.8 * num1, 2)
            ElseIf num1 > 9.9 Then
                Return Math.Round(0.4 * num1, 2)
            Else
                Return "Error"
            End If

        End If

    End Function

I have the following demo (http://www.w3schools.com/webservices/ws_summary.asp) and a hello world demo working fine on both asp and asax and they're on the same page/same service

Any ideas?