?????? ??????This article applies to a different operating system than the one you are using. Article content that may not be relevant to you is disabled.
This article references the following .NET Framework Class Library namespace:
private void Page_Load(object sender, System.EventArgs e)
{
// Start an instance of the Web Service client-side proxy.
localhost.Service1 myProxy = new localhost.Service1();
Response.Write( myProxy.HelloWorld());
}
Visual Basic .NET ????? ???
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Start an instance of the Web Service client-side proxy.
Dim myProxy As localhost.Service1 = New localhost.Service1()
Response.Write(myProxy.HelloWorld())
End Sub
You may receive an Access Denied error message. This occurs because your
credentials are not delivered with the Web service request for
authentication.
TheCredentialCacheclass belongs to theSystem.Net??? ????? ???
Add the following namespace declaration to the top of the
file:
????? C# .NET ????? ???
using System.Net;
Visual Basic .NET ????? ???
Imports System.Net
????? ????DefaultCredentials???? ?? ??????????????property of the Web service client-side proxy. To do
this, change the code of thePage_Loadevent as follows:
????? C# .NET ?????:
private void Page_Load(object sender, System.EventArgs e)
{
// Start an instance of the Web service client-side proxy.
localhost.Service1 myProxy = new localhost.Service1();
myProxy.Credentials = System.Net.CredentialCache.DefaultCredentials;
Response.Write( myProxy.HelloWorld());
}
Visual Basic .NET ????? ???
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Start an instance of the Web service client-side proxy.
Dim myProxy As localhost.Service1 = New localhost.Service1()
myProxy.Credentials = System.Net.CredentialCache.DefaultCredentials
Response.Write(myProxy.HelloWorld())
End Sub
????? ???????? ???????? ??,???????.Hello ??????appears in the browser.