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 Roy Wood <ro...@filogix.com> on 2002/12/02 21:45:41 UTC

Mozilla?

I'm trying to use Mozilla and its built-in SOAP support to access a 
service I've set up (Axis + TomCat), but I keep getting a "no SOAPAction 
Header error" error back.  I took a look, and Mozilla doesn't seem to 
send a SOAPAction Header, and apparently Axis requires this.

Anyone else have any experience using Mozilla to invoke SOAP services?


-Roy

Re: Mozilla?

Posted by Tom Myers <to...@dreamscape.com>.

Roy Wood wrote:

> I'm trying to use Mozilla and its built-in SOAP support to access a
> service I've set up (Axis + TomCat), but I keep getting a "no SOAPAction
> Header error" error back.  I took a look, and Mozilla doesn't seem to
> send a SOAPAction Header, and apparently Axis requires this.
>
> Anyone else have any experience using Mozilla to invoke SOAP services?
>
>
> -Roy
>
You can either use the Mozilla-specific SOAPCall mechanism, or xmlhttp;
the advantage of xmlhttp is that you can then write a cross-browser
invocation, such as the following fragment which assumes that "env" is
the actual SOAP envelope as a string:

>   var xmlhttp=null; var doc=null;
>   if(document.all) xmlhttp=new ActiveXObject('MSXML2.XMLHTTP');
>   else xmlhttp=new XMLHttpRequest();
>   if(!xmlhttp)return alert("doGoogleSearch: cannot initialize xmlhttp object");
>   if(!document.all)netscape.security.PrivilegeManager.enablePrivilege("UniversalBrowserRead");
>   xmlhttp.open('POST',"http://api.google.com/search/beta2",false);
>   xmlhttp.setRequestHeader("SOAPAction", "doGoogleSearch")
>   xmlhttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8")
>   xmlhttp.send(env);
>   return xmlhttp.responseXML;
As you see, the SOAPAction header is set explicitly.

Of course, if you're using Mozilla only, then you're not interested
in what happens if "document.all" is non-null. :-) But this does successfully
return the result of a google search on IE6 and Mozilla 1.2b, which is what
I'm testing on. And if you're using Mozilla only, then you may prefer to
use new SOAPCall(), new SOAPParameter(), new SOAPHeaderBlock()...
http://linux.imp.mx/cvs-tmp/rpms/SOURCES/mozilla/extensions/xmlextras/docs/Soap_Scripts_in_Mozilla.html#2.2_Header_Blocks
Did you try and fail to set a SOAPAction header with SOAPHeaderBlock()?

Of course that doesn't work at all on IE, and if you want to use the MS
SOAPCLIENT setup then so far as I know you have to download the SDK...
anybody know if that's false? Once you do that, you can run from WSDL,
but it's not the moral equivalent of an applet, exactly...am I rambling
again? Well, never mind. Hope this helps somehow.

Tom Myers