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

Jonathan Marsh jonathan at wso2.com
Sat Nov 3 07:48:54 PDT 2007


While it is unlikely a client would generate two identifiers with the same
Date (millisecond), the WS-A MessageId is supposed to be unique across
clients as well - which is why I added the random number which seemed an
expedient way to ensure 99.99999% of message ids would be unique.  And
easier to generate than a GUID.  I fear removing the random number might
cause some interop problems down the line somewhere.  Since we've found the
source of the problem, I'm not inclined to change this at present - though
I'm open to convincing arguments!

Jonathan Marsh - http://www.wso2.com - http://auburnmarshes.spaces.live.com
 

> -----Original Message-----
> From: mashup-dev-bounces at wso2.org [mailto:mashup-dev-bounces at wso2.org]
> On Behalf Of saminda abeyruwan
> Sent: Friday, November 02, 2007 8:11 PM
> To: mashup-dev at wso2.org
> Cc: wsas-java-dev at wso2.org
> Subject: [mashup-dev] WSRequest.js related issue
> 
> 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