Showing posts with label service. Show all posts
Showing posts with label service. Show all posts

Thursday, March 29, 2012

Server Side Time Out in c#

Hi

I have an ASP.NET site that uses web services for security. I have two
servers running the same service. Provided the servers are running I am
able to run a check script and swap servers depending on whether the
service is running properly. This works fine if just IIS has fallen
over.

The problem is that if the server is switched off, the ASP.NET code
continues to search for the server and leaves the application hanging.

Is is possible to add a timeout to the server-side code, so that after
say 5 seconds it stops searching for the server and uses the
alternative one?

Thanks

JaredI found a way to get round this. The web service has a Timeout already,
you just need to set it. I am not sure if every type of object has a
Timeout setting.

e.g.
WebService1.Security entsec = new WebService1.Security();

entsec.Timeput = 1000;
string entsecCheck = entsec.CommsCheck([password]);

This will time out after 1 second if the server is turned off.

Jared

Jared wrote:

Quote:

Originally Posted by

Hi
>
I have an ASP.NET site that uses web services for security. I have two
servers running the same service. Provided the servers are running I am
able to run a check script and swap servers depending on whether the
service is running properly. This works fine if just IIS has fallen
over.
>
The problem is that if the server is switched off, the ASP.NET code
continues to search for the server and leaves the application hanging.
>
Is is possible to add a timeout to the server-side code, so that after
say 5 seconds it stops searching for the server and uses the
alternative one?
>
Thanks
>
Jared

Server Side Time Out in c#

Hi
I have an ASP.NET site that uses web services for security. I have two
servers running the same service. Provided the servers are running I am
able to run a check script and swap servers depending on whether the
service is running properly. This works fine if just IIS has fallen
over.
The problem is that if the server is switched off, the ASP.NET code
continues to search for the server and leaves the application hanging.
Is is possible to add a timeout to the server-side code, so that after
say 5 seconds it stops searching for the server and uses the
alternative one?
Thanks
JaredI found a way to get round this. The web service has a Timeout already,
you just need to set it. I am not sure if every type of object has a
Timeout setting.
e.g.
WebService1.Security entsec = new WebService1.Security();
entsec.Timeput = 1000;
string entsecCheck = entsec.CommsCheck([password]);
This will time out after 1 second if the server is turned off.
Jared
Jared wrote:
> Hi
> I have an ASP.NET site that uses web services for security. I have two
> servers running the same service. Provided the servers are running I am
> able to run a check script and swap servers depending on whether the
> service is running properly. This works fine if just IIS has fallen
> over.
> The problem is that if the server is switched off, the ASP.NET code
> continues to search for the server and leaves the application hanging.
> Is is possible to add a timeout to the server-side code, so that after
> say 5 seconds it stops searching for the server and uses the
> alternative one?
> Thanks
> Jared

Saturday, March 24, 2012

Server was unable to process request. --> Array cannot be null...

Hello,
I am trying to call a simple web service from .net environment. The service
gets an array parameter. When I run it, it becomes the error:
Server was unable to process request. --> Array cannot be null. Parameter
name: bytes
I am sure that my array is not null. Besides, its name isn't "bytes".
What is wrong with it?
Regards..Have you tried using the debugger to step through the code and see
where the exception occurs? Did the error message include a stack
trace with line numbers? Something is null when it shouldn't be,
you'll have to find it.
Scott
http://www.OdeToCode.com/blogs/scott/
On Tue, 15 Mar 2005 09:28:04 +0200, "Diner" <dincer"AT"o2.pl> wrote:

>Hello,
>I am trying to call a simple web service from .net environment. The service
>gets an array parameter. When I run it, it becomes the error:
>Server was unable to process request. --> Array cannot be null. Parameter
>name: bytes
>I am sure that my array is not null. Besides, its name isn't "bytes".
>What is wrong with it?
>Regards..
>
I can't do it, because I get the error in the production environment. It
works fine on test environment...
"Scott Allen" <scott@.nospam.odetocode.com> wrote in message
news:8h0e31pp1k11odv79slg0bpqhu6c6kioae@.
4ax.com...
> Have you tried using the debugger to step through the code and see
> where the exception occurs? Did the error message include a stack
> trace with line numbers? Something is null when it shouldn't be,
> you'll have to find it.
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
> On Tue, 15 Mar 2005 09:28:04 +0200, "Diner" <dincer"AT"o2.pl> wrote:
>
service
>
On Tue, 15 Mar 2005 19:44:49 +0200, "Diner" <dincer"AT"o2.pl> wrote:

>I can't do it, because I get the error in the production environment. It
>works fine on test environment...
>
Try to build with debugging information included and get a stack trace
with line numbers. Or try putting some trace statements inside. A
little more information makes tracking down the source of the
information easier. Once you have some information you can review the
code and see what could be going wrong.
http://odetocode.com/Blogs/scott/ar.../01/24/963.aspx
Scott
http://www.OdeToCode.com/blogs/scott/

Server was unable to process request. --> Array cannot be null...

Hello,

I am trying to call a simple web service from .net environment. The service
gets an array parameter. When I run it, it becomes the error:

Server was unable to process request. --> Array cannot be null. Parameter
name: bytes

I am sure that my array is not null. Besides, its name isn't "bytes".

What is wrong with it?

Regards..Have you tried using the debugger to step through the code and see
where the exception occurs? Did the error message include a stack
trace with line numbers? Something is null when it shouldn't be,
you'll have to find it.

--
Scott
http://www.OdeToCode.com/blogs/scott/

On Tue, 15 Mar 2005 09:28:04 +0200, "Diner" <dincer"AT"o2.pl> wrote:

>Hello,
>I am trying to call a simple web service from .net environment. The service
>gets an array parameter. When I run it, it becomes the error:
>Server was unable to process request. --> Array cannot be null. Parameter
>name: bytes
>I am sure that my array is not null. Besides, its name isn't "bytes".
>What is wrong with it?
>Regards..
I can't do it, because I get the error in the production environment. It
works fine on test environment...

"Scott Allen" <scott@.nospam.odetocode.com> wrote in message
news:8h0e31pp1k11odv79slg0bpqhu6c6kioae@.4ax.com...
> Have you tried using the debugger to step through the code and see
> where the exception occurs? Did the error message include a stack
> trace with line numbers? Something is null when it shouldn't be,
> you'll have to find it.
> --
> Scott
> http://www.OdeToCode.com/blogs/scott/
> On Tue, 15 Mar 2005 09:28:04 +0200, "Diner" <dincer"AT"o2.pl> wrote:
> >Hello,
> >I am trying to call a simple web service from .net environment. The
service
> >gets an array parameter. When I run it, it becomes the error:
> >Server was unable to process request. --> Array cannot be null. Parameter
> >name: bytes
> >I am sure that my array is not null. Besides, its name isn't "bytes".
> >What is wrong with it?
> >Regards..
On Tue, 15 Mar 2005 19:44:49 +0200, "Diner" <dincer"AT"o2.pl> wrote:

>I can't do it, because I get the error in the production environment. It
>works fine on test environment...

Try to build with debugging information included and get a stack trace
with line numbers. Or try putting some trace statements inside. A
little more information makes tracking down the source of the
information easier. Once you have some information you can review the
code and see what could be going wrong.

http://odetocode.com/Blogs/scott/ar.../01/24/963.aspx

--
Scott
http://www.OdeToCode.com/blogs/scott/