Skip to main content

Testing SOAP Fault Generation

You can use the Terminal to test the SOAP Fault generation code that you added to SOAPTutorial.SOAPService. Simply invoke GetContact and pass it an invalid ID value.

  1. Open the Terminal. Use the ZN command to switch to the namespace in which you have installed the sample application.

  2. Create an instance of the service class and invoke its GetContact, passing it an invalid ID value.

    USER>Set service = ##class(SOAPTutorial.SOAPService).%New()
    USER>Do service.GetContact(0)
  3. The method returns a SOAP Fault that looks something like this

    <?xml version='1.0' encoding='UTF-8' standalone='no' ?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV=''
    xmlns:s='' >
          <faultstring>application error</faultstring>
          <detail>Contact with id 0 could not be found!</detail>
FeedbackOpens in a new tab