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

Jonathan Marsh jonathan at wso2.com
Sat Nov 3 07:44:49 PDT 2007


Yes, please open a JIRA.  In the Mashup Server we can limit the ability to
deploy services with reserved names.  We already do this if the name is
already in use by another service, if the service contains bad characters
like "-", and so forth.  But if those restrictions aren't followed by WSAS,
and by arbitrary services that you might apply the try-it to, it's not a
very good solution.

On the other hand always rewriting the try-it objects (Math -> WS_Math, foo
-> WS_foo) so they won't conflict with anything makes for a poor user
experience, and still doesn't always solve the problem.  Perhaps the best we
can do is have the try-it rewrite the names only when they conflict (Math ->
_Math, foo -> foo).  A bit complicated to implement.

Or we could simply give up on such services, but then we'd need to develop
an "error" view of a service, which is also a little complicated.

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: Saturday, November 03, 2007 6:54 AM
> To: mashup-dev at wso2.org
> Cc: wsas-java-dev at wso2.org
> Subject: Re: [mashup-dev] WSRequest.js related issue
> 
> 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
> >
> 
> 
> _______________________________________________
> 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