Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: axis and soap from javascript ?

From: Eric Osman <ericosman@---.--->
To: NULL
Date: 4/9/2004 1:13:00 PM

Well, it looks like I need to put on some special SOAP headers to 
successfully talk to the web service.

       *** If this is true, do I have to construct those soap headers by
       **** hand ?   Or is there a javascript library I can use to
       **** do it more conveniently ?

If I have to do it by hand, do the following errors help you help me 
figure out what I'm doing wrong ?


If I do basically what you show below, the xml I get back looks like 
this if I don't put in any SOAP headers:

<?xml version="1.0"?>
<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <soapenv:Body>
                         <soapenv:Fault> 
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: Bad envelope tag: 
TEST_REQUEST</faultstring>
                                     <detail/>
                         </soapenv:Fault>
             </soapenv:Body>
</soapenv:Envelope>

If I put in a header equivalent to the one that was used for delivering 
that error message to me, I get this:

<?xml version="1.0"?>
<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
             <soapenv:Body>
                         <soapenv:Fault> 
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: SimpleDeserializer encountered a 
child element, which is NOT expected, in something it was trying to 
deserialize.</faultstring>
                                     <detail/>
                         </soapenv:Fault>
             </soapenv:Body>
</soapenv:Envelope>


Any ideas about this ?????

Thanks.  /Eric

> Hi...Here's an example of using Microsoft's implimentation XMLHTTP.
> You'll want to do a lot more reading up about it...consider going down
> to your local full-service bookstore, or looking for a text on line, or
> <gasp/> googling for more info...but this will get you started:
> 
> var XMLHTTP  = new ActiveXObject( 'Msxml2.XMLHTTP' );
> 
> var XMLRequest = new ActiveXObject( 'Msxml2.DOMDocument' );
> var XMLResponse;
> 
> var method = 'POST';
> var async = false;
> 
> // TODO:  Change the string in the next line to whatever xml you need to
> send...
> var xmlString ='<root><content>Here is some text</content></root>';
> 
> // TODO:  Change the next line to the web address of the server you are
> // trying to get information from
> var url  = 'http://localhost/server.asp';
> 
> var bSuccessfullyLoaded = XMLRequest.loadXML( xmlString);
> 
> if( bSuccessfullyLoaded )
> {
>  debugger;
>  XMLHTTP.Open( method, url, async );
>  XMLHTTP.Send( xmlString );
>  XMLResponse = XMLHTTP.responseXML;
> 
>  if( 0 == XMLResponse.parseError.errorCode )
>  {
>   // TODO:  Do something useful here once you
>   // successfully get a response...
>   window.alert( XMLResponse.xml );
>  }
>  else
> {
>     // TODO:  Handle the parsing error here
>     window.alert('A Parse Error');
>  }
> }
> 
> 
> Good Luck!
> 
> --Geoff McGrath
> 
> 



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent