in Technology

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 😉

Write a Comment

Comment

  1. Hi,
    I’m just started to work on Open Laszlo. So Can you tell me, some nice tutorial sites and books for reference.
    Since you might gone through tutorials and materials for guidence that may help me.

    Thanks in Advance. 🙂
    Meena.

  2. Hi Meena,

    Most of what I learnt about OpenLaszlo was from their manual. I also went through the example applications that come with the software. The rest was hacking around.

    There is a book about OL, but I haven’t read it. The Amazon reviews are also not too good about it!

    HTH.

    :Nirav

Webmentions

  • OpenLaszlo Project Blog » Debugging Web Services October 16, 2008

    […] Nirav Mehta has some tips about debugging web services in OpenLaszlo. 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. […]