put <WebMethod()> _
before the web service function.

2010/2/1 Brock <[email protected]>:
> I'm still not understanding this. I tried this without working (I
> changed the naming to fit the method's wording):
>
>    Protected Sub btnSpherePartialVolume_Click(ByVal sender As Object,
> ByVal e As System.EventArgs) _
>    Handles btnSpherePartialVolume.Click
>        Dim wsConvert As New
> com.juggernautical.SphericalVolumeWebService
>        Dim partialvolume As Double
>        Dim Height As Double
>        Dim Radius As Double
>        Height = System.Convert.ToDouble("3")
>        Radius = System.Convert.ToDouble("4")
>        Dim Result As String = (Height, Radius)
>        System.Threading.Thread.Sleep(3000)
>        lblSphericalPartialVolume.Text = Result
>    End Sub
>
>    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
>
>
>
>
> On Jan 29, 8:22 am, Cimpy <[email protected]> wrote:
>> 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- Hide quoted text -
>>
>> - Show quoted text -
>

Reply via email to