Wednesday, March 21, 2012

Declarative timer and web service

I am trying to use a declarative script to timer on tick -> web service on complete -> update label.

No problems with updating the label but is there anyway to invoke a service method without resorting to javascript (i.e. pure xml-script)? I imagine I can do something like tick="Sys.Net.ServiceMethod.invoke(..." but it kinda kills the purpose.

Any ideas?

Alex

hello.

i think you're after the servicemethodrequest class.

here's an example of it's declaration:

<serviceMethod id="myService" url="webservice.asmx" methodName="Test">
<completed>
<!--invoke your binding from here-->
</completed>
</serviceMethod>

btw, you can invoke the previous service by using the invokeMethod action (invoke is the name of the method exposed by servicemethod that let's you start the web service method execution).


Luis - yes I am after theServiceMethodRequest class except I would like to invoke the ws via a timer control (w/o resorting to using JS) on tick event:

<timer id="timer" interval="1000" enabled="true" tick="INVOKE WS"/
<serviceMethod id="svc..." url="service.asmx" methodName="GetSomething">
<completed> ...</completed>
</serviceMethod>

While I can write a JS function to invoke the method (and I have done this) I would like to create a version (more elegant) w/o any JS using declarative script. No point for me to use a combination of declarative script to do the binding and ws calls if I still have to write a JS function to call the ws on Tick, might as well do the bindings manually. Right now this is what I do but would be great if I can use the tick event to invoke a ws as well. Any ideas?

AO


hello.

how about something like this;

<timer ...>
<tick>
<invokeMethod target="svc..." method="invoke" />
</tick>
</timer>

if you need parameters, then add them as child element of the invokemethod element...


Thanks that was easy... wish there was an easy way to browse the Atlas library by class with Visual Studio. The documentation didn't make any mention of this (as far as I remember) and from briefly looking in the code I didn't find it.

Luis, thanks again!

No comments:

Post a Comment