How to catch and communicate soap faults to the webservice client

0
We have published different webservices and we want to handle errors like: "Couldn't handle input parameters" Attribute 'SOSInbound.IC.IC_HLPPLAN' has a maximum length of 5, tried setting a value of length 7. The client does only get an Soap fault "Internal server error" We would like to communicate the details of the error (exception) to the client. Is this possible in Mendix without using java code?
asked
2 answers
0

AFAIK this isn't possible yet. The only way to handle too large input is by mapping the attributes on temporary objects and then do some custom validations in microflows and return that input to the webservice caller.

Edit:

Problem is that the caller tries to input a attribute which is larger than the attribute size in your model. Problem is that Mendix doesn't use the attribute size in your model to use this in the wsdl/xsd of the published webservice. Instead of giving an 'internal server error' it would be better to throw a validation exception, because the input xml is not of the correct size. I filed ticket 14613 for this purpose a year ago, but it's still scheduled for backlog.

answered
0

On the web service call, right-click and set error handling. Have the error flow Show Message. In the message you can use $lastSoapFaultCode, $lastSoapFaultReason, $lastSoapFaultNode, etc. to display to the user. These are global variables Mendix holds that you can access from any scope, and at any given time - if I'm understanding what you're asking.

Edit: As I understand the question now. One option (although not great) is to accept any length of data and check it before performing the normal ws operation (microflow). If criteria are not met, you could return back an 'Exception' object with a custom message. Of course, you would need to anticipate this on the other end as well. Not a great solution I know, but it's something.

answered