Entries Tagged 'OpenLaszlo' ↓

Debugging Webservices in Laszlo

Have been working on web services with Laszlo and I am hitting on some errors! Guess they will be helpful for anybody who’s going to use this.

Background
We are using the SOAP methods for consuming web services. Also using the remotecall tags.

Error 1: ws1.lzx:108: reference to undefined property
WARNING: ws1.lzx:108: reference to undefined property 'checkEmailId'
WARNING: ws1.lzx:108: undefined object does not have a property ‘invoke’
«LzWarning#10| WARNING: ws1.lzx:108: reference to undefined property…» {
file: ws1.lzx
line: 108
message: «LzMessage(46)#12| “reference to undefined property \’checkEmailId\’…»
}

This error comes up when you do not have <remotecall>’s defined for your web service methods. Ensure you have these stubs defined for ALL methods in the web service AND that the parameter counts match. “checkEmailId” is the method I was trying to call here, but there was not remotecall stub defined for it.

Error 2: reference to undefined property ‘message’
WARNING: rpc/rpc.lzx:296: reference to undefined property 'message'
error: «undefined»
«LzWarning#10| WARNING: rpc/rpc.lzx:296: reference to undefined prop…» {
file: rpc/rpc.lzx
line: 296
message: «LzMessage(41)#11| “reference to undefined property \’message\’”»
}

This error occurs when you have a remotecall stub for the method, but the parameters do not match with the web service. Ensure the number of parameters match correctly with the web service.

Error 3: Object hasn’t property
error: SOAP-ERROR: Encoding: object hasn't 'xyz' property

This error occurs when your WSDL specifies a property to be there for the returning object, but the object actually does not have it. You may need to refresh your WSDL or check your webservice code.

Error 4: data source error for soap
error: data source error for soap://soap: SAXException: The markup in the document following the root element must be well-formed.

As the error suggests, the WSDL was not a valid XML document. Most probably this means there was an error in your code that prevented the WSDL from generating. E.g. a parse / syntax error in your webservice file.

Tip
If you have the Debug panel open while you are viewing your LZX file, you can enter some code in the small text box and hit “eval” to execute it. I have found it quite useful. When working with webservices, I use it to reinitialize my webservice after making a few changes on the backend. This way, I do not have to reload the whole LZX file. I do it like this:
canvas.glancerService.init()

I will add more things here as I hit upon more errors ;)

 

OpenLaszlo

Macromedia has Flex. Flex is a set of tools and technologies to allow developers to easily build rich internet applications - without the need to learn the Flash authoring environment. Using an XML file to control the user interface, and with interweaved / external Actionscript code, developers can create compelling applications online.

Flex is great as a product and Macromedia is working on to make it better, and probably more cost effective :) But I am not talking about Flex here…

It’s about OpenLaszlo.

Laszlo Systems created Laszlo a while ago and open sourced it as OpenLaszlo. OpenLaszlo is very similar to Flex - XML based language to create RIA, deployed on the web. A good lineup of companies is already using Laszlo - Earthlink, Yahoo, La Quinta etc.

Laszlo has been around for long. They started out with developing smaller things and the project has grown well over the years. The open source version is generating good interest - especially because of the “free of cost” tag, as compared to the hefty price of Flex. I have not dabbled into OpenLaszlo so far, but it’s time to jump in.

We are developing Glancer using OpenLaszlo. And I will post things as I learn them!