[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

(Chan)

1/3/2003 6:06:00 PM

Using VB.net, I just created a webservice (.asmx) page on my LOCAL
machine with the typical "Add" method as:
-------------------
Imports System
Imports System.Web.Services
Imports System.Xml.Serialization

Public Class clsEmail

<WebMethod> Public Function Add(a As Integer, b As Integer) As
Integer
Return a + b
End Function
end class
-------------------
Everything is public.

I use the "WebService Proxy Generator" to generate all files.

I now build a web page .aspx have the following in its page_load
function:
-------------------
dim wsTest as new nsWS.clsWS()
dim b as integer
b = wsTest.Add(1, 2)
-------------------

To test the webservice, I first called up .asmx in my LOCAL browser,
say "http://localhost/testWS.asmx". I got the <Add> button as
expected, click on it got the correct answer.

Now, I call up the .aspx to test if I could use the webservice just
tested, I got error:
Exception Details: System.Net.WebException: The request failed with
HTTP status 401: Access Denied.

The line in .aspx is highlighted
b = wsTest.Add(1, 2)

OS is Win2000, .NET Framework is 1.0 with Hotfix and SP2. Editor is
MS' WebMatrix. IE is 6.0. IIS security is "Allow anonymous" and
"Integrated".

BTW, I did the tutorial sample of WebMatrix using DataGrid, worked
perfectly.

Any clue?

Thanks!
2 Answers

Marina

1/3/2003 5:43:00 PM

0

Try making it 'allow anonymous' only.

"Chan" <hifchan@yahoo.com> wrote in message
news:fe01f62a.0301030832.16f103be@posting.google.com...
> Using VB.net, I just created a webservice (.asmx) page on my LOCAL
> machine with the typical "Add" method as:
> -------------------
> Imports System
> Imports System.Web.Services
> Imports System.Xml.Serialization
>
> Public Class clsEmail
>
> <WebMethod> Public Function Add(a As Integer, b As Integer) As
> Integer
> Return a + b
> End Function
> end class
> -------------------
> Everything is public.
>
> I use the "WebService Proxy Generator" to generate all files.
>
> I now build a web page .aspx have the following in its page_load
> function:
> -------------------
> dim wsTest as new nsWS.clsWS()
> dim b as integer
> b = wsTest.Add(1, 2)
> -------------------
>
> To test the webservice, I first called up .asmx in my LOCAL browser,
> say "http://localhost/testWS.asmx". I got the <Add> button as
> expected, click on it got the correct answer.
>
> Now, I call up the .aspx to test if I could use the webservice just
> tested, I got error:
> Exception Details: System.Net.WebException: The request failed with
> HTTP status 401: Access Denied.
>
> The line in .aspx is highlighted
> b = wsTest.Add(1, 2)
>
> OS is Win2000, .NET Framework is 1.0 with Hotfix and SP2. Editor is
> MS' WebMatrix. IE is 6.0. IIS security is "Allow anonymous" and
> "Integrated".
>
> BTW, I did the tutorial sample of WebMatrix using DataGrid, worked
> perfectly.
>
> Any clue?
>
> Thanks!


(Chan)

1/3/2003 8:48:00 PM

0

You are not authorized to view this page