Send Soap Request Request with Credential using SoapClient

namespace test{
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Web.Services3;
using Microsoft.Web.Services3.Addressing;
using Microsoft.Web.Services3.Messaging;
using System.Web.Services.Protocols;
using System.Net;
using System.Web;
using System.Configuration;

class OutgoingSoapClient : SoapClient {

public SoapEnvelope GetResponse()
{
try {
string username = "UserName";
string password = "Password"
distAdd="http://localhost/Service1.ashx"
System.Net.CredentialCache credCache = new System.Net.CredentialCache();
credCache.Add (new Uri(distAdd.ToString()), "Basic", new NetworkCredential(username, password));
SoapHttpOutputChannel httpchannel = (SoapHttpOutputChannel)
this.Channel;
httpchannel.Options.Credentials = credCache;
httpchannel.Options.Timeout = 30000;
SoapEnvelope response = this.SendRequestResponse(action, request);
return response;
}
}
}