[wsas-java-dev] Re: [mashup-dev] WSRequest.js related issue

saminda abeyruwan saminda at wso2.com
Sat Nov 3 06:54:24 PDT 2007


Hi All,

Well I have an explanation to the cause for the prior mentioned problem. 
The web service I've created called "Math". The combination of 
jsstub.xsl and tryit.xsl xslts create an custom javascript class called 
"Math". Browser has loaded the generated "Math" class instead of the 
predefined "Math" class coming from the javascript runtime. If you look 
at the javascript flow, it is lucid that the custom created "Math" class 
loaded first before the predefined one.

Unfortunately their could be situations that javascirpt class loading 
would be in conflicting state (ex: if there exist an "Date" service :) 
dynamic-codegen would create an Date class. If this class loaded first, 
the predefined Date class would not be loaded). One proposal I could 
come forth would be to "qualify" the classes that dynamic-codegen could 
create,  i.e org.wsf.dc.Math for "Math" service or org.wsf.dc.Date for 
"Date" service.

What would be your consent on prior anomaly.

Shall I open an JIRA for this issue.

Thank you

Saminda

saminda abeyruwan wrote:
> Hi,
> 
> WSAS has encountered a slight issue in WSRequest.js (line 743)
> 
> i.e randomToken = Math.floor(Math.random() * 10000000000);
> 
> The above line is in the _buildWSAHeaders : function(standardversion, 
> options, address) {...} of WSRequest.js.
> 
> WSAS loads "Try it" inside an iframe which embeds into a div. When an 
> service is invoked and WSRequest hits the line 747 to build WSA headers, 
>  it will throw an undefined error. Once this line has been removed and 
> generates the MessageId as follows,
> id = "http://identifiers.wso2.com/messageid/" + now + "/" + now;
> 
> everything worked fine.
> 
> Unfortunately, I could not give much information on why it would cause 
> such error only I could demonstrate it.
> 
> Considering the safe side should it be viable to remove the 
> "randomToken" variable and generate the message id with
> 
>  "http://identifiers.wso2.com/messageid/" + now ;
> 
> now = (new Date()).valueOf();
> 
> because, IMHO the probability of getting the same Id in concurrent 
> situation is quite small.
> 
> Thank you
> 
> Saminda
> 
> _______________________________________________
> Mashup-dev mailing list
> Mashup-dev at wso2.org
> http://www.wso2.org/cgi-bin/mailman/listinfo/mashup-dev
> 





More information about the Wsas-java-dev mailing list