> Service service = new Service(); > Call call = (Call)service.createCall(); > call.setUsername(username); > call.setPassword(password);
> How can I do it with Mozilla JavaScript?
I am not sure you can do that with JavaScript but perhaps if you use script to access a web service and authentication is required then Mozilla will simply pop up its authentication dialog as normal with other resources requiring authentication. Have you tried that, simply calling the service with script? What happens then, do you get an error dialog or an error in the JavaScript console?
>> Service service = new Service(); >> Call call = (Call)service.createCall(); >> call.setUsername(username); >> call.setPassword(password);
>> How can I do it with Mozilla JavaScript?
> I am not sure you can do that with JavaScript but perhaps if you use > script to access a web service and authentication is required then > Mozilla will simply pop up its authentication dialog as normal with > other resources requiring authentication. > Have you tried that, simply calling the service with script? What > happens then, do you get an error dialog or an error in the JavaScript > console?
I don't know, I don't tried it yet.
I think HTTP-Basic authentication use custom HTTP headers in SOAP messages, so can I modify it any way except working with XmlHttpRequest?
Eugene Prokopiev wrote: >> Pop up dialog is suitable for me.
> sorry, it's _not_ suitable for me
I am not sure the SOAP API has any way to provide username and password for basic authentication but for me here with Firefox 1.0 it works to use XMLHttpRequest first to make a HTTP HEAD request sending the credentials (the open method has the fourth and fifth argument for that) and then to make the SOAP call e.g.
> I am not sure the SOAP API has any way to provide username and password > for basic authentication but for me here with Firefox 1.0 it works to > use XMLHttpRequest first to make a HTTP HEAD request sending the > credentials (the open method has the fourth and fifth argument for that) > and then to make the SOAP call e.g.
How about submitting username and password together with the URL?
var soapCall = new SOAPCall(); soapCall.transportURI = 'http://username:passw...@example.org/services/service.asmx'; soapCall.encode(...);
I know the security is not too good. But then the URI need not be hardcoded, it can be created on the client. And next the request better use https to encrypt the whole stream....