About WS-Eventing

vukia.jan.gmail.com's picture
Hi all. I'm trying to build a webservice to retrieve event message from event source(using savan module), I wrote a hello.js and published it on Mashup server to be event sink and I wrote another js file on XULRUNNER to handle the event message. But I can't find some helpful messages from samples, just find how to handle the response using init callback function, but the event message from event source to event sink seems a "request",not response so I don't know how to monitor the incoming event message from XULRUNNER's js file Thanks for your help~
tyrell's picture

Did you try using TCPMon to

Did you try using TCPMon to intercept and analyse the request? Maybe the payload from your event source is incompatible with what the Mashup is expecting. Tyrell
vukia.jan.gmail.com's picture

here is come information

Here is my environment: Using Axis2-1.4 to publish the eventsource (savan's stock sample code) Send subscription by soap message by XMLHttpRequest. from Axis2 console,It works And I write a simple js code and publish it on Mashup server 1.5 named hello.js ------------------------------ var input="sigh"; function publish(Stock){ input=Stock; } function event() { return this.input; } ------------------------------- My subscription addressing to hello web service and I got the message from TCPmon POST /services/vukia/hello HTTP/1.1 Content-Type: text/xml; charset=UTF-8 SOAPAction: "urn:anonOutonlyOp" User-Agent: Axis2 Host: 127.0.0.1:8081 Transfer-Encoding: chunked ff <?xml version='1.0' encoding='UTF-8'?> -678992066 0 and HTTP/1.1 200 OK Server: Apache-Coyote/1.1 Content-Type: text/xml;charset=UTF-8 Transfer-Encoding: chunked Date: Mon, 09 Nov 2009 10:10:26 GMT 10a <?xml version='1.0' encoding='UTF-8'?> 0 it seems my hello service has received the event message~ In my XULRUNNER js file.. var response; function load(){ hello.event.callback = function(payload){ response=payload; alert(response); }; hello.publish.onError=showError; hello.event(); } when I call the event function,The return value is always "sigh" It seems that JS object in XULRUNNER is independent, so I don't know how to retrieve the event message comed from event source in XULRUNNER's js file
tyrell's picture

Try using the annotations as

Try using the annotations as below in your mashup js ... var input="sigh"; publish.inputTypes = { "Stock" : "string" }; function publish(Stock){ this.input=Stock; } function event() { return this.input; }
vukia.jan.gmail.com's picture

Dear tyrell, I've try your

Dear tyrell, I've try your code but still got "sigh" return, maybe I can try object session to achieve my work~
tyrell's picture

Yes. That was to be my next

Yes. That was to be my next suggestion. Store the global variable using the session host object with the correct scope set.
vukia.jan.gmail.com's picture

I'm successful by using

I'm successful by using session object this.scope="application"; var key = "number"; publish.inputTypes = { "Stock" : "string" }; function publish(Stock){ this.input=Stock; session.put(key,Stock); return this.input; } function event() { var number = session.get(key); return number } My XULRUNNER call function event() and return the Stock value received by function publish(), but my final job is that my XULRUNNER application have to immediately get event message when function publish() receive event message, not by call function event() to get the event message.. I've no idea to achieve this goal.......ˊ_ˋ
vukia.jan.gmail.com's picture

My goal

In my job, I want to write a js file in XULRUNNER and make it as a web service to retrieve event message, when XULRUNNER receives event message, It can be display in my xulrunner UI. SO my ideal js code in xulrunner is: his.scope="application"; var input; publish.inputTypes = { "Stock" : "string" }; function publish(Stock){ this.input=Stock; changelog(); } function changelog() { var textbox = document.getElementbyId("show"); textbox.value = this.input; } but I think it would not work because XULRUNNER and mashup server run this js file in different way. they can't share the local variable and session is in server side. I seems impossible to let Xulrunner javascript to call mashup's js webservice function by local, not by wsrequest.. it's hard for me to explain..but I really don't know how to do that..
tyrell's picture

You are correct. There's no

You are correct. There's no way to share variables "locally" between XULRUNNER and Mashup Server. You need to do a Web Service call. The best option I see is to adopt a polling mechanism in your XULRUNNER code to poll the Mashup to check the above variable. Depending on the frequency the event source fires events, you can fine tune the polling frequency to ensure minimum lag time. Hope this helps. Tyrell
vukia.jan.gmail.com's picture

Dear Tryell, I am

Dear Tryell, I am appreciative of your help, I think I have to think another way to make my plan more efficient,polling method in my system is not efficient because the event is not regularly sends to eventsink, it's event-driven model. I have ever thought that I can write a Mashup Server plug-in of XULRUNNER..but it seems.......a very hard work.. If you have idea, please share it with me, thanks^_^ /Kevin
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)