current Mozilla supports javascript-soap directly, without
needing a plugin. My simple javascript function to send
a test word to an echo test service (apache axis beta 2 on
server side) follows. You'll note that it appears to be
modeled on apache soap 2.2.
===================================
function test() {
// build up array of parameters to call with
var parameterInArray = new Array();
var echo = "test";
var echoParameter = new SOAPParameter(echo, "echo");
parameterInArray[0] = echoParameter;
// prepare soap call
var soapCall = new SOAPCall();
soapCall.transportURI = "http://" + location.hostname +
"/TheDataWeb_Services/servlet/AxisServlet";
soapCall.actionURI = "echoString";
soapCall.encode(0, "echoString", "urn:test", 0, null,
parameterInArray.length, parameterInArray);
// make the call
var soapResponse = soapCall.invoke();
// test for fault
var soapFault = soapResponse.fault;
if (soapFault != null) {
var faultNameSpace = soapFault.faultNamespace;
var faultCode = soapFault.faultCode;
var faultSummary = soapFault.faultString;
var faultActor = soapFault.actorURI;
alert("Test service access failed: " + faultSummary);
return false;
}
// get response parameters
var parameterOutArray = soapResponse.getParameters(false, {});
if (parameterOutArray.length != 1) {
alert("Test echo returned parameters wrong number of parameters,
expected 1, found " + parameterOutArray.length);
return false;
}
var response = parameterOutArray[0];
var value = response.value;
var name = response.name;
if (value != echo) {
alert("Test expected " + echo + ", found " + value);
return false;
}
return true;
}
On Tue, 2002-05-21 at 09:37, Newman, Scott wrote:
> How exactly? Using WASP? Just curious. :)
>
> Scott
>
> -----Original Message-----
> From: Heitzso [mailto:[EMAIL PROTECTED]]
> Sent: 21 May, 2002 7:35 AM
> To: [EMAIL PROTECTED]
> Subject: Re: javascript SOAP clients
>
> I managed to do this with mozilla-javascript last
> night.
>
>
> > ----- Original Message -----
> > From: "robert woodley" <[EMAIL PROTECTED]>
> >
> > > Dear All -
> > >
> > > I need to write a AXIS SOAP client in javascript. Has
> > > anybody had any success doing this? Are there toolkits
> > > to do this? Any insights would be helpful.
> > >
> > > Thank you
> > > Bob Woodley
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > LAUNCH - Your Yahoo! Music Experience
> > > http://launch.yahoo.com
> >
>