I created a Web Reference in C# Visual Studio. When I build the project I get zwS_SQRT1 user control in my toolbox (it has an operation ZSqrt). I put it on the form and then
zwS_SQRT1.Credentials = new System.Net.NetworkCredential("GORENMI1", "tlaxcala3");
si.durs.guediserr.ZSqrt x = new si.durs.guediserr.ZSqrt();
x.Number = 16;
si.durs.guediserr.ZSqrtResponse y = new si.durs.guediserr.ZSqrtResponse();
y = zwS_SQRT1.ZSqrt(x);
MessageBox.Show(y.Result.ToString());
Sometimes I get a result, but sometimes I get only the error message
The request was aborted: The request was canceled.
What am I doing wrong ?
The Error message is:
System.Net.WebException was unhandled
HResult=-2146233079
Message=The request was aborted: The request was canceled.
Source=System.Web.Services
StackTrace:
at System.Web.Services.Protocols.WebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.HttpWebClientProtocol.GetWebResponse(WebRequest request)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at WebService.si.durs.guediserr.ZWS_SQRT.ZSqrt(ZSqrt ZSqrt1) in D:\DURS\Kovačnica\WebService\Web References\si.durs.guediserr\Reference.cs:line 80
at WebService.Form1.button1_Click(Object sender, EventArgs e) in D:\DURS\Kovačnica\WebService\Form1.cs:line 39
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WebService.Program.Main() in D:\DURS\Kovačnica\WebService\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
Thanks in advance
Miran