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/06 17:25:46 UTC

Mozilla Success, But a New Problem....

I got Mozilla working by adding an "actionURI" to the SOAPCall object.  
Something like this:

     soapCall.actionURI = "Moof";


Now, the only complication is that I am returning back a Vector of 
Strings, and can't figure out how to process them in JavaScript.  
Following along the examples I've Googled, I can access the single return 
parameter of "GetAppraisalIndexReturn" which is the Vector, but not the 
associated String elements.  Looks like Axis is linking to these like 
this: <GetAppraisalIndexReturn href="#id0"/>, which is confusing 
Mozilla's JavaScript engine.

Anyone have any suggestions as to how to deal with this?  I just want to 
access the data coming back!


-Roy




p.s.  Here's the SOAP payload:

<?xml version="1.0" encoding="UTF-8"?>
<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>
  <ns1:GetAppraisalIndexResponse 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:ns1="urn:appraisal-backend">
   <GetAppraisalIndexReturn href="#id0"/>
  </ns1:GetAppraisalIndexResponse>
  <multiRef id="id0" soapenc:root="0" 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xsi:type="ns2:Vector" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:ns2="http://xml.apache.org/xml-soap">
   <item xsi:type="xsd:string">1	2	2	Lot 25 Amethyst Crescent East	Cole 
Harbour	NS	1	2002-11-08 00:00:00.0	2002-11-08 
00:00:00.0	0	1	1	null	Stephen V Bessey	RET - Retail</item>
   <item xsi:type="xsd:string">2	2	2	28 Lanigan 
Court	Spryfield	NS	2	2002-11-04 00:00:00.0	2002-11-04 
00:00:00.0	null	1	1	null	Alain J Godbout	RET - Retail</item>
   <item xsi:type="xsd:string">3	2	2	108 Churchill Downs Circle	Lower 
Sackville	NS	3	2002-11-01 00:00:00.0	2002-11-01 
00:00:00.0	0	1	1	null	Brian D Williams	RET - Retail</item>
   <item xsi:type="xsd:string">4	2	2	161 Eaglewood 
Drive	Bedford	NS	4	2002-11-01 00:00:00.0	2002-11-01 
00:00:00.0	null	1	1	null	Kimberley S West	RET - Retail</item>
   <item xsi:type="xsd:string">5	2	2	100 Nestor Crescent	Cole 
Harbour	NS	5	2002-11-05 00:00:00.0	2002-11-05 
00:00:00.0	null	1	1	null	Yvette A Saulnier	RET - Retail</item>
   <item xsi:type="xsd:string">6	2	2	657  A &amp; B Herring Cove 
Road	Spryfield	NS	6	2002-11-01 00:00:00.0	2002-11-01 
00:00:00.0	0	1	1	null	Delia P Cavendish	RET - Retail</item>
   <item xsi:type="xsd:string">7	2	2	7 Scotsdale Drive	Musquodoboit 
Harbour	NS	7	2002-11-06 00:00:00.0	2002-11-06 
00:00:00.0	null	1	1	null	Stephen Curtis	EIM - Eastern IMAC</item>
   <item xsi:type="xsd:string">8	2	2	2 Stratford 
Way	Halifax	NS	8	2002-11-01 00:00:00.0	2002-11-01 
00:00:00.0	null	1	1	null	Stephanie Morrison	ALT - Alternate Dist.</item>
   <item xsi:type="xsd:string">9	2	2	46 Brookside 
Road	Brookside	NS	9	2002-11-07 00:00:00.0	2002-11-07 
00:00:00.0	2	1	1	null	Kevin G Pattison	RET - Retail</item>
   <item xsi:type="xsd:string">10	2	2	219 Martin Lake Drive	Lake 
Echo	NS	10	2002-11-07 00:00:00.0	2002-11-08 00:00:00.0	null	1	1	null	Eric 
W Vallis	RET - Retail</item>
   <item xsi:type="xsd:string">11	2	2	1 Glenbourne 
Court	Halifax	NS	11	2002-11-04 00:00:00.0	2002-11-04 
00:00:00.0	null	1	1	null	Angela J Fong	ALT - Alternate Dist.</item>
   <item xsi:type="xsd:string">12	2	2	3587 Connaught 
Avenue	Halifax	NS	12	2002-11-05 00:00:00.0	2002-11-05 
00:00:00.0	34	1	1	null	Gerald J Blackmore	RET - Retail</item>
   <item xsi:type="xsd:string">13	2	2	10 Regency Park Drive Unit 
#510	Halifax	NS	13	2002-11-06 00:00:00.0	2002-11-06 
00:00:00.0	null	1	1	null	Marie A Mirhashem	RET - Retail</item>
   <item xsi:type="xsd:string">14	2	2	232 Parklea Drive	Head Of St. 
Margaret&apos;s Bay	NS	14	2002-11-05 00:00:00.0	2002-11-05 
00:00:00.0	null	2	2	null	Robert Roberts	RET - Retail</item>
   <item xsi:type="xsd:string">15	2	2	14 Eaton 
Avenue	Dartmouth	NS	15	2002-11-06 00:00:00.0	2002-11-06 
00:00:00.0	null	1	1	null	Tanya Brown And Henry Mah	EIM - Eastern 
IMAC</item>
   <item xsi:type="xsd:string">16	2	2	5215 Green 
Street	Halifax	NS	16	2002-11-11 00:00:00.0	2002-11-11 
00:00:00.0	null	1	1	null	James F Crowley	RET - Retail</item>
   <item xsi:type="xsd:string">17	2	2	71 Rosewood Lane	Eastern 
Passage	NS	17	2002-11-12 00:00:00.0	2002-11-12 
00:00:00.0	null	1	1	null	Trevor W Macdonald	RET - Retail</item>
   <item xsi:type="xsd:string">18	2	2	7 Skyline 
Drive	Harrietsfield	NS	18	2002-11-08 00:00:00.0	2002-11-08 
00:00:00.0	1	1	1	null	Ronald Osborne	RET - Retail</item>
   <item xsi:type="xsd:string">19	2	2	12 Flinn&apos;s 
Hill	Bedford	NS	19	2002-11-12 00:00:00.0	2002-11-12 
00:00:00.0	null	2	2	null	Gregory Stephen Skidmore	RET - Retail</item>
  </multiRef>
 </soapenv:Body>
</soapenv:Envelope> 

Re: Mozilla Success, But a New Problem....

Posted by Tom Myers <to...@dreamscape.com>.
Roy Wood wrote:

> I got Mozilla working by adding an "actionURI" to the SOAPCall object.  ...
>
> Now, the only complication is that I am returning back a Vector of
> Strings, and can't figure out how to process them in JavaScript.
> Following along the examples I've Googled, I can access the single return
> parameter of "GetAppraisalIndexReturn" which is the Vector, but not the
> associated String elements. ...
> Anyone have any suggestions as to how to deal with this?  I just want to
> access the data coming back!

>    <GetAppraisalIndexReturn href="#id0"/>

okay, your returned value is a multiref, and that multiref is a Vector id="id0"
>   <multiRef id="id0" soapenc:root="0" 
> ...
> xsi:type="ns2:Vector" 
> ...
> ...>
>    <item xsi:type="xsd:string">1	2	2	Lot 25...RET - Retail</item>
>    <item xsi:type="xsd:string">2	2	2	28 Lan...RET - Retail</item>

If it's always going to be that way, with the data being in "item" tags which are
actually siblings, and no "item" tags which aren't your data, perhaps something like
   var soapResponse = soapCall.invoke();
  // deal with fault issues, return if needed
   var node= soapResponse.message.getElementsByTagName("item")[0]; // first item.
   var res=node.nodeValue;
   while(null!=(node=node.nextSibling))res+=node.nodeValue;
   return res;
Of course that's traversing the sibs of the first item; if that's not the same
as the the getElementsByTagName list, then maybe you go up a level and traverse
the NodeList itself. Or if you can't count on always getting the multiref
structure the same way then you might have to be clever about looking at the
DOM structure.

Or maybe I've just misunderstood what's going on. Wouldn't be unusual.

Tom Myers