Forums
Niels,
Does IceBreak support SOAP standard faults as described here: http://www.w3schools.com/soap/soap_fault.asp ?
Regards,
David.
Niels,
Does IceBreak support SOAP standard faults as described here: http://www.w3schools.com/soap/soap_fault.asp ?
Regards,
David.
Re: IceBreak - SOAP Faults
Hi David;
Short and easy : Yes !!
Your code is place in a "monitor" and if that fails, the client will receive the SOAP-fault.
...The fault tag, It has been around since 24/09/2012.
Try this:
N will be divided by zero in this code:
<%@ language="RPGLE" pgmtype="webservice"%> <% h nomain debug /include qasphdr,ilob /* ----------------------------------------------------------------------------------- save file ----------------------------------------------------------------------------------- */ p saveFile... p b export d pi d file * input // Local variables d outilob s * d n s 10U 0 /free // ---------------------------------------------------------------------------------------------------------- // Decode the BASE64 and save the binary contents outilob = sesGetIlob('out'); ilob_Base64Decode(outilob:file); ilob_SaveToBinaryStream(outilob:'/www/john.jpg'); n = 1 / n; /end-free p saveFile... p eWhich will produce what you see on the attached screen shot.
Best regards,
Niels Liisberg
Re: IceBreak - SOAP Faults
Niels,
Thanks for that, can the user send back custom messages or will it always be the monitor information ?
Regards,
David.
Re: IceBreak - SOAP Faults
Hi David;
Since the normal control of the SOAP envelope is so much different, your only option now is to send an escape message within your code, which terminates the SOAP procedure and response the fault document.
But that can be done relatively simply by something like:
D SendEscMsg pr extpgm('QMHSNDPM') D MsgID 7 const D MsgFile 20 const D MsgDta 80 const D MsgDtaLen 10i 0 const D MsgType 10 const D MsgQ 10 const D MsgQNbr 10i 0 const D MsgKey 4 D ErrorDS 16 D ErrorDS ds 16 D BytesProv 10i 0 inz(16) D BytesAvail 10i 0 D ExceptionID 7 D MsgDta s 256 D MsgKey s 4 …. // Send the escape message MsgDta = 'My SOAP failed' SendEscMsg ('CPF9898': 'QCPFMSG QSYS': MsgDta: %len(%trimr(MsgDta)): '*ESCAPE': '*': <==== Not sure about this 2: <==== And this MsgKey: ErrorDS)Best regards,
Niels Liisberg
%status()
This is very useful Niels.
When Icebreak catches an error using the monitor, what is the format of the data it returns in the faultactor tag? Is there a datastructure for this somewhere?
Does it include the %status() code of the error anywhere?
Thanks,
Craig
%status
Hi Craig;
It will return the messages id of the escape message + the error text.
The error list wil contain the program name info.
Regards
Niels