PDA

View Full Version : RPC issue with nightly build 4.0.x


vernid
09-11-2007, 05:56 AM
Hi,

I just downloaded the nightly build 4.0.x and after recieving the soap response I get the following error, this doesn't happen with version 4.0.3

... loadmc= «LoadObj#1| soap://soap (loading)»
...responseheaders= null
ERROR: rpc/library/swf/rpc.js:138: call to undefined method 'valueToElement'
ERROR: rpc/library/swf/rpc.js:140: undefined object does not have a property 'childNodes'
WARNING: rpc/library/swf/rpc.js:140: reference to undefined property 'childNodes'

Regards
Dominique

senshi
09-11-2007, 02:30 PM
Sounds strange, this should be fixed since OL4.0.3, see "LPP-4289" (http://www.openlaszlo.org/jira/browse/LPP-4289).

Which version did you download? So which revision-no., branch ("wafflecone" or "legals"), etc.
Any infos for me?

vernid
09-11-2007, 11:39 PM
I downloaded from the legal one. 6426 and in attach the log file.

Regards
Dominique

__LZloaderReturnData data= {..., stubinfo: [object Object], stub: [object Object]}
... loadmc= «LoadObj#1| soap://soap (loading)»
...responseheaders= undefined
{..., stubinfo: [object Object], stub: [object Object]}
loaded
«Object#2| {...}» {
BookFlight: «Function»
GetFlights: «Function»
GetFrequentFlyerMileage: «Function»
}<gfr:GetFlightsRequest xmlns:myxsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gfr="http://www.springframework.org/spring-ws/samples/airline/schemas"><gfr:from>AMS</gfr:from><gfr:to>VCE</gfr:to><gfr:departureDate>2006-01-31</gfr:departureDate></gfr:GetFlightsRequest>
Request= <gfr:GetFlightsRequest xmlns:myxsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gfr="http://www.springframework.org/spring-ws/samples/airline/schemas"><gfr:from>AMS</gfr:from><gfr:to>VCE</gfr:to><gfr:departureDate>2006-01-31</gfr:departureDate></gfr:GetFlightsRequest>
--------REQUEST------- «lz.dataset#6| <request><gfr:GetFlightsRequest xmlns:myxsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:gfr=\"http://www.springframework.org/spring-ws/samples/airline/schemas\"><gfr:from>AMS</gfr:from><gfr:to>VCE</gfr:to><gfr:departureDate>2006-01-31</gfr:departure...»
<gfr:GetFlightsRequest xmlns:myxsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:gfr="http://www.springframework.org/spring-ws/samples/airline/schemas"><gfr:from>AMS</gfr:from><gfr:to>VCE</gfr:to><gfr:departureDate>2006-01-31</gfr:departureDate></gfr:GetFlightsRequest>
__LZloaderReturnData data= [<GetFlightsResponse><flight><number>KL1653</number><departureTime>2006-01-31T10:05:00.000+01:00</departureTime><from><code>AMS</code><name>Schiphol Airport</name><city>Amsterdam</city></from><arrivalTime>2006-01-31T12:25:00.000+01:00</arrivalTime><to><code>VCE</code><name>Marco Polo Airport</name><city>Venice</city></to><serviceClass>economy</serviceClass></flight><flight><number>KL1655</number><departureTime>2006-01-31T17:05:00.000+01:00</departureTime><from><code>AMS</code><name>Schiphol Airport</name><city>Amsterdam</city></from><arrivalTime>2006-01-31T19:25:00.000+01:00</arrivalTime><to><code>VCE</code><name>Marco Polo Airport</name><city>Venice</city></to><serviceClass>economy</serviceClass></flight></GetFlightsResponse>]
... loadmc= «LoadObj#1| soap://soap (loading)»
...responseheaders= null
ERROR: rpc/library/swf/rpc.js:138: call to undefined method 'valueToElement'
ERROR: rpc/library/swf/rpc.js:140: undefined object does not have a property 'childNodes'
WARNING: rpc/library/swf/rpc.js:140: reference to undefined property 'childNodes'
rpc.lzx _handler {status: ok, message: ok, data: <GetFlightsResponse><flight><number>KL1653</number><departureTime>2006-01-31T10:05

senshi
09-12-2007, 12:45 AM
That's very strange, the bugfix has been implemented in that revision...

What is your output in the debug-window if you simply type:

LzDataElement.valueToElement([1,2,3])


It should be:

«LzDataElement#1| <element><item>1</item><item>2</item><item>3</item></element>»

vernid
09-12-2007, 12:50 AM
It works:

}lzx> LzDataElement.valueToElement([1,2,3])
«LzDataElement#6| <element><item>1</item><item>2</item><item>3</item></element>»
lzx>

?!?

senshi
09-12-2007, 08:18 AM
Ah, got it!

I always looked at the "LzDataElement.lzx"-file of "legals" and "wafflecone", but just at the "rpc.js" of the "wafflecone"-branch.
As this issue was really annoying, I've finally taken a look at "rpc.js" of the "legals"-branch. There it was, the source of all evil...ah the source of this bug:


if (delegate['dataobject'] != null) {
if ( delegate.dataobject instanceof LzDataset ) {
var element = LzDataElement.prototype.valueToElement(data);
// the child nodes of element will be placed in datasets childNodes
delegate.dataobject.setData( element.childNodes );
} else if ( delegate.dataobject instanceof LzDataElement ) {
var element = LzDataElement.prototype.valueToElement(data);
// xpath: element/value
delegate.dataobject.appendChild( element );
} else {
Debug.write('WARNING: dataobject is not LzDataset or LzDataElement:', delegate.dataobject);
}
}


So what you can do:

fix this issue by changing "LzDataElement.prototype.valueToElement(..)" to "LzDataElement.valueToElement(..)"
download the wafflecone-branch nightly as this is / was the actual working-branch
just wait some days, so you can get the next official release

vernid
09-12-2007, 10:03 PM
Thanks Senshi, I will wait for few days and in the mean time working with the 4.0.3.

Thanks again
Dominique