SoapFault

Asked by Ales Klimsa on 2011-12-05

I'm getting strange behaviour of ladonize when exception is raised from WS method. In this case ladonize returns empty string in response :(
Could you help me with this problem or this is standard behaviour?

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
ladon Edit question
Assignee:
No assignee Edit question
Solved by:
Ales Klimsa
Solved:
2011-12-12
Last query:
2011-12-12
Last reply:
2011-12-11
jsgaarde (jakob-simon-gaarde) said : #1

Hi Ales.
Please send an example service class that creates this behaviour.
You can use pastebin.com.

Best regards Jakob Simon-Gaarde

Ales Klimsa (ales-klimsa) said : #2

here it is: http://pastebin.com/0GgmBLNM

here is the WS client: https://ws.dev.savvy.cz/client.php, when you run this script you can see request and response and response si blank :(

thanks for help

Ales

jsgaarde (jakob-simon-gaarde) said : #3

Hi Ales.

I will take a look at it friday evening, I am very busy at work these days, sorry :-(

Best Regards
Jakob

jsgaarde (jakob-simon-gaarde) said : #4

Hi Ales.

Sorry, there is currently no SoapFault handling in Ladon. You can however make a soapfault response object yourself using the CustomResponse class defined in:

ladon.server.customresponse

Best Regards
Jakob Simon-Gaarde

jsgaarde (jakob-simon-gaarde) said : #5

Hi Ales.

Forget my previous answer, I am implementing fault handling correctly now. It should be done later today.

Best Regards Jakob Simon-Gaarde

Ales Klimsa (ales-klimsa) said : #6

Thanks a lot,
please let me know when it will be finished

Ales

jsgaarde (jakob-simon-gaarde) said : #7

Hi Ales.

Ladon 0.6.5 now released. I have been pushing ahead the implementation of fault handling way too long. So I guess I should say thanks for reminding me :-)

Here is how it works:
* There are 2 new exceptions ServerFault and ClientFault implemented in ladon.exceptions.service
* These 2 fault classes are raised automatically by the dispatcher if an exception occures during request parsing (ClientFault) or method invocation (ServerFault)
* You can blame the client for ie. bad argument logic within your service method by raising the ClientFault exception manually
* You can also raise the ServerFault exception manually from within your service method.
* Raising ServerFault, ClientFault or user-defined Faults inheriting one of the first two, are called managed faults. All other exceptions are caught by the dispatcher and called unmanaged faults.

There is a usage example here on launchpad:
http://bazaar.launchpad.net/~ladon-dev-team/ladon/ladon/view/head:/frameworks/python/support/answers/181006/testservice.py

Best Regards
Jakob Simon-Gaarde

Ales Klimsa (ales-klimsa) said : #8

Thanks a lot, it will help us. I believe, that it will help ladonize itself, because it is really important feature.

jsgaarde (jakob-simon-gaarde) said : #9

Can you please give me a little feedback on the topic when you have tried it? Namely if it works as it should, and I would also like to know if you are satisfied with the way you as service developer apply Fault handling in service methods.

Best Regards
Jakob Simon-Gaarde

Ales Klimsa (ales-klimsa) said : #10

good job, it is working fine ;) maybe you should return also <faultactor> subelement as is described in specification.
In any case thanks a lot!!

Ales

jsgaarde (jakob-simon-gaarde) said : #11

Hi Ales.
Thanks for the feed-back. I hope you'll enjoy using Ladon. I have put FaultActor on Ladon's Todo-list, so it will be implemented in the near future.

http://bazaar.launchpad.net/~ladon-dev-team/ladon/ladon/view/head:/frameworks/python/todo

Best Regards
Jakob Simon-Gaarde