Download presentation
Presentation is loading. Please wait.
1
Handling SOAP Faults
2
When you complete this lesson you should be able to:
Overview When you complete this lesson you should be able to: Describe what a SOAP Fault is Describe the parts of a SOAP message Describe the elements of a SOAP Fault Implement the 4GL code to handle a SOAP Fault
3
Ignoring a SOAP Fault Web service 4GL application 2 1 3 4 5
operations: . . . GetInvoice: { RETURN ERROR “Invoice not found”. } 4GL application GetInvoice_Request (iInvoiceNum) 2 1 RUN GetInvoice IN hPortType (INPUT iInvoiceNum, OUTPUT cInvoice). GetInvoice_Response ( ) SOAP Fault 3 4 5 NO-ERROR was not used
4
From Web service (success) From Web service (failure)
The SOAP Message SOAP Envelope SOAP Body To Web service operation name input parameters SOAP Envelope SOAP Body From Web service (success) operation name output parameters SOAP Envelope SOAP Body From Web service (failure) SOAP Fault
5
SOAP Fault element <SOAP-ENV:Envelope . . .>
<SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>An error was detected while executing the Web Service request. (10893)</faultstring> <detail> . . . </detail> <faultactor> using urn:OpenEdgeServices:NewCoService </faultactor> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
6
SOAP Fault detail element
<FaultDetail xmlns:ns1=" SOAP-ENV:encodingStyle=" <errorMessage xsi:type="xsd:string"> msg=The server application returned the error: Invoice not found; targetException=ERROR condition: The Server application has returned an error. (7243) (7211)]</errorMessage> <requestID xsi:type="xsd:string"> 172247e5b58beb30:5bb966:fb5df25c30:-7fff#8c </requestID> </FaultDetail> </detail>
7
Lab 7-1: Generating and viewing a SOAP Fault
8
Handling a SOAP Fault RUN SendOrders IN hPortType ( INPUT cOrders,
OUTPUT iInvoiceNum) NO-ERROR. IF ERROR-STATUS:NUM-MESSAGES > 0 THEN DO: /* now look into what the content is for the SOAP Fault */ END. 1 2
9
ERROR-STATUS object hierarchy
ERROR-OBJECT-DETAIL SOAP-FAULT-DETAIL
10
The faultstring in a SOAP message
<?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=" xmlns:xsi=" xmlns:xsd=" <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>An error was detected while executing the Web Service request. (10893)</faultstring> <detail> <ns1:FaultDetail SOAP-ENV:encodingStyle=" xmlns:ns1=" <errorMessage xsi:type="xsd:string">msg=The server application returned the error: Invoice not found; targetException=ERROR condition: The Server application has returned an error. (7243) (7211)]</errorMessage> <requestID xsi:type="xsd:string">172247e5b58beb30:5bb966:fb4fdb744a:-7fff#9</requestID> </ns1:FaultDetail> </detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
11
The detail in a SOAP message
<?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=" xmlns:xsi=" xmlns:xsd=" <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>An error was detected while executing the Web Service request. (10893)</faultstring> <detail> <ns1:FaultDetail SOAP-ENV:encodingStyle=" xmlns:ns1=" <errorMessage xsi:type="xsd:string">msg=The server application returned the error: Invoice not found; targetException=ERROR condition: The Server application has returned an error. (7243) (7211)]</errorMessage> <requestID xsi:type="xsd:string">172247e5b58beb30:5bb966:fb4fdb744a:-7fff#9</requestID> </ns1:FaultDetail> </detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
12
Accessing the SOAP-FAULT-DETAIL
GET-NODE() GET-SERIALIZED() X-NODEREF LONGCHAR
13
Content used for SOAP-FAULT-DETAIL
<?xml version='1.0' encoding='UTF-8'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=" xmlns:xsi=" xmlns:xsd=" <SOAP-ENV:Body> <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>An error was detected while executing the Web Service request. (10893)</faultstring> <detail> <ns1:FaultDetail SOAP-ENV:encodingStyle=" xmlns:ns1=" <errorMessage xsi:type="xsd:string">msg=The server application returned the error: Invoice not found; targetException=ERROR condition: The Server application has returned an error. (7243) (7211)]</errorMessage> <requestID xsi:type="xsd:string">172247e5b58beb30:5bb966:fb4fdb744a:-7fff#9</requestID> </ns1:FaultDetail> </detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
14
Lab 7-2: Handling a SOAP Fault
15
You should now be able to:
Summary You should now be able to: Describe what a SOAP Fault is Describe the parts of a SOAP message Describe the elements of a SOAP Fault Implement the 4GL code to handle a SOAP Fault
16
Review
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.