You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by vi...@free.fr on 2002/10/19 00:14:02 UTC

Axis and Mozilla SOAP Javascript

Hi,
  I'm trying to invoke a web service from javascript using the mozilla
implementation (the only one? I don't know). But mozilla don't send the
SOAPAction header when invoking the service, and therefore axis is not happy. Is
someone here has encountered the same problem?
Thanks
Lionel

Re: Axis and Mozilla SOAP Javascript

Posted by Heitzso <he...@bellsouth.net>.
On Fri, 2002-10-18 at 18:14, villardml@free.fr wrote:
> Hi,
>   I'm trying to invoke a web service from javascript using the mozilla
> implementation (the only one? I don't know). But mozilla don't send the
> SOAPAction header when invoking the service, and therefore axis is not happy. Is
> someone here has encountered the same problem?
> Thanks
> Lionel


I used mozilla soap to breadboard an app.  There were a couple
of glitches along the way.  Some were solvable, some weren't.
But making simple calls to a webservice is doable.  Below
is one of the javascript functions I wrote to call an
axis web service.  I haven't tested this code in a couple of
months so it may not function in the 1.0 or RC environments.

=============================

function getDataSourceChildNodes(id) {
	if (! parent.sessionId)
		getSessionId();
	// build up array of parameters to call with
	var parameterInArray = new Array();
	var sessionIdParameter = new SOAPParameter(parent.sessionId,
"sessionId");
	var idParameter = new SOAPParameter(id, "dataSourceId");
	parameterInArray[0] = sessionIdParameter;
	parameterInArray[1] = idParameter;
	// prepare soap call
	var soapCall = new SOAPCall();
	soapCall.transportURI = "http://" + location.hostname +
"/TheDataWeb_Services/servlet/AxisServlet";
	soapCall.actionURI = "getDataSourceChildNodes";
	soapCall.encode(0, "getDataSourceChildNodes", "urn:ferrett", 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("getDataSourceChildNodes failed: " + faultSummary);
		return null;
	}
	// get response parameters
	var parameterOutArray = soapResponse.getParameters(false, {});
	if (parameterOutArray.length != 1) {
		alert("wrong number of returned parameters, expected 1, found " +
parameterOutArray.length);
		return null;
	}
	var response = parameterOutArray[0];
	return response.value;
}



RE: Axis and Mozilla SOAP Javascript

Posted by Heitzso <he...@bellsouth.net>.
Start of this thread referenced mozilla soap javascript implementation.

IE doesn't have that.  It has something called 
"web service behavior" or something similar and it is not
at all like the mozilla soap javascript implementation.

I'm not aware of any cross browser platform simple browser side
scripting technology to provide access to a web service.
One of the big issues is security, and a straight up
javascript implementation will (I believe) block or, minimally,
doesn't support, the calls necessary to invoke a web
service function.

Heitzso


On Mon, 2002-10-21 at 13:55, Chris Howard wrote:
> I'm trying to do the same thing.  I did it at my previous job so I know it
> is doable but I cannot find any good reference on it.
> 
> We created XML DOMs from scratch on the client side and sent that XML via
> soap to the SOAP server.  The soap server then split up the XML and handled
> it appropriatly, using server side JScript.  I am attempting to do the front
> end the same way but Java on the server side.
> 
> The main bits of information I'm missing on the client side (they were
> obfuscated with the code I was working on):
> 
> * How do you create an XML DOM in IE/Netscape (I know it is different syntax
> to create them but after that they use the same code)
> 
> * How do I send the XML to the client and get the response back.
> 
> On the server side I'm having trouble finding the reference I need as well.
> I cannot find documentation on how I get the XML and access it via the DOM
> (document.getElementByTagName("..."), document.firstChild, and all that).
> 
> If anyone has any directions they can point me in I would be most greatfull.
> I've been scouring google for about 3 days now.
> 
> -Chris
> 
> -----Original Message-----
> From: villardml@free.fr [mailto:villardml@free.fr]
> Sent: Friday, October 18, 2002 6:14 PM
> To: axis-user@xml.apache.org
> Subject: Axis and Mozilla SOAP Javascript
> 
> 
> Hi,
>   I'm trying to invoke a web service from javascript using the mozilla
> implementation (the only one? I don't know). But mozilla don't send the
> SOAPAction header when invoking the service, and therefore axis is not
> happy. Is
> someone here has encountered the same problem?
> Thanks
> Lionel
> 



RE: Axis and Mozilla SOAP Javascript

Posted by Chris Howard <ch...@boxlake.com>.
I'm trying to do the same thing.  I did it at my previous job so I know it
is doable but I cannot find any good reference on it.

We created XML DOMs from scratch on the client side and sent that XML via
soap to the SOAP server.  The soap server then split up the XML and handled
it appropriatly, using server side JScript.  I am attempting to do the front
end the same way but Java on the server side.

The main bits of information I'm missing on the client side (they were
obfuscated with the code I was working on):

* How do you create an XML DOM in IE/Netscape (I know it is different syntax
to create them but after that they use the same code)

* How do I send the XML to the client and get the response back.

On the server side I'm having trouble finding the reference I need as well.
I cannot find documentation on how I get the XML and access it via the DOM
(document.getElementByTagName("..."), document.firstChild, and all that).

If anyone has any directions they can point me in I would be most greatfull.
I've been scouring google for about 3 days now.

-Chris

-----Original Message-----
From: villardml@free.fr [mailto:villardml@free.fr]
Sent: Friday, October 18, 2002 6:14 PM
To: axis-user@xml.apache.org
Subject: Axis and Mozilla SOAP Javascript


Hi,
  I'm trying to invoke a web service from javascript using the mozilla
implementation (the only one? I don't know). But mozilla don't send the
SOAPAction header when invoking the service, and therefore axis is not
happy. Is
someone here has encountered the same problem?
Thanks
Lionel