Monday, March 29, 2010

WebService failure ... how to catch?

I know this is poor form, but I don't know the right way to
do it.

I have a WebService that I am writing in .Net, it's full of
methods and goodies that I need to access from Flex. So in my Flex
app. I establish a WebService component and point it to my wsdl to
consume it. That part works just fine. The problem I am having is
that since I have lots of different methods in the WebService, I
need to handle the results differently; my way around that is just
by making multiple WebService instances that all point to the same
WSDL I just change their result handlers.

In any case, sometimes, at what seems to be random,
connections fail. IE, I can't access my save instance of the
WebService, other functions that access the same WSDL through
different WebService instances work just fine.

Is there a way I can make it auto-redial or something like
that? Where if, for some reason, accessing a method on a webservice
fails it can automatically retry to connect to it?

I'll show you what I am talking about:



public function save (var variable:int):void

{

ws1.save(variable);

}

public function get (var variable:int):void

{

ws2.get(variable);

}



%26lt;mx:WebService id=''ws1'' wsdl=''
http://www.someURL.com/blah.asp?wsdl''
result=''{ws1Handler(event)}''/%26gt;

%26lt;mx:WebService id=''ws2'' wsdl=''
http://www.someURL.com/blah.asp?wsdl''
result=''{ws2Handler(event)}''/%26gt;



something like that, but randomly ws1 won't save, while ws2
will continue to work.

That's generally how my app is set up, but with a lot more
instances of the same thing.

This is really the only problem presented with doing it this
way. This isn't too slow, nor am I concerned with memory.

Any help is appreciated.WebService failure ... how to catch?
Okay I was able to get everything down to just one webservice
component that has many operation tags, and I am still getting the
same error. When accessing certain methods from my webservice at,
what seems to be random, it will just throw an error and the
webservice crashes from there. If I close the browser and try again
it works just fine: no code change, no recompile, just refresh. If
anyone has experienced anything similar, or figured out how to fix
it PLEASE let me know.WebService failure ... how to catch?
Believe it or not, I think this may be what could be causing
my problem:

After checking the IIS logs on our IIS 6 server I was able to
find that when I finally was able to reproduce the issue it threw a
lot of 304 errors. I didn't know what those were, so I did some
research. It seems like people were experiencing similar things
with images not loading; I'm not having issues with images, but
WebServices would be an online asset that would be mounted and
called similarly to how browsers would call or reference any other
online asset.



FROM MICROSOFT:

''Typically, when Internet Explorer aborts an HTTP request,
the page no longer has to have a reference for that resource (such
as an image, a JScript (.js) file, an HTML component (.htc) file,
or a Cascading Style Sheet (.css) file). This problem may occur
when you rapidly open and close many nodes of a DHTML treeview-like
control.

The problem occurs more frequently when Internet Explorer is set
to look for newer versions on every visit to the Web page because
this generates more HTTP requests. (Typically, these requests are
''get'' requests).





Other factors that contribute to HTTP traffic may also
generate more HTTP requests. These factors include setting the
cache attribute and network latency. Network latency contributes to
the problem because there is a greater chance of aborting an HTTP
request.



If you raise the connection limit per server, you can delay
the problem. The problem occurs because Internet Explorer may
occasionally lose HTTP connections internally. Because 2 is the
standard connection limit for HTTP 1.1, the problem occurs later if
you raise the connection limit.''


http://support.microsoft.com/?kbid=818506



I'm still not sure that this is the answer, but I will keep
you all posted.
I don't know if we'll ever know if that was the answer. I
have since moved from that job to somewhere else. However before I
left I was told that the .xml files I would reference to load all
the data for my pull-down-menus and other semi-dynamic data sources
were also receiving 304 errors. I think that was it.

But please respond to this posting if you experience anything
similar, or if you find out the real cause or fix.

No comments:

Post a Comment