Moreover:
1) your wevb service is asking for two parametyers, not only one
        Dim partialvolumeW As Double
        Dim partialvolumeH As Double
        partialvolumeW = System.Convert.ToDouble("3")
        partialvolumeH = System.Convert.ToDouble("4")

        System.Threading.Thread.Sleep(3000)

2)you do not need to convert to string when calling the method:
        Dim result As String = wsConvert.PartialSphereVolume
(partialvolumeW, partialvolumeH)

------------------------

On 28 Gen, 22:35, Brock <[email protected]> wrote:
> I have a Web service I created for doing math conversions (in this
> case the partial volume of a sphere). I'm seeing a conflict with the
> Web service method and the code-behind on my .aspx page that consumes
> the service. Does anyone see anything wrong with the
> code?:                        THANKS!!!  (btw... this is not a
> homework assignment)
>
> Web service side (no compiler errors):
>
>     <System.Web.Services.WebMethod()> _
> Public Function PartialSphereVolume(ByVal Radius As Double, ByVal
> Height As Double) As Double
>         Return ((Radius * Math.PI * (Height ^ 2)) - (Math.PI *
> ((Height ^ 3) / 3)))
>     End Function
>
> .aspx Consuming side (compile error is in the
> "wsConvert.PartialSphereVolume(partialvolume)" phrase:
>
>     Protected Sub btnSpherePartialVolume_Click(ByVal sender As Object,
> ByVal e As System.EventArgs) Handles btnSpherePartialVolume.Click
>         Dim wsConvert As New com.mysite.SphericalVolumeWebService
>         Dim partialvolume As Double
>         partialvolume = System.Convert.ToDouble(txtRadius3.Text)
>         partialvolume = System.Convert.ToDouble(txtHeight.Text)
>         System.Threading.Thread.Sleep(3000)
>         lblSphericalPartialVolume.Text = wsConvert.PartialSphereVolume
> (partialvolume).ToString("#,##0.00")
>     End Sub

Reply via email to