Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

SOAP フォルト生成のテスト

ターミナルを使用すると、SOAPTutorial.SOAPService に追加した SOAP フォルト生成コードをテストできます。GetContact を呼び出して、無効な ID 値を渡すだけです。

  1. ターミナルを開きます。ZN コマンドを使用して、サンプル・アプリケーションをインストールしたネームスペースに切り替えます。

  2. サービス・クラスのインスタンスを作成し、その GetContact を呼び出して、無効な ID 値を渡します。

    
    USER>Set service = ##class(SOAPTutorial.SOAPService).%New()
    USER>Do service.GetContact(0)
    
    
  3. このメソッドからは次のような SOAP フォルトが返されます。

    
    <?xml version='1.0' encoding='UTF-8' standalone='no' ?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'
    xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
    xmlns:s='http://www.w3.org/2001/XMLSchema' >
      <SOAP-ENV:Body>
        <SOAP-ENV:Fault>
          <faultcode>SOAP-ENV:ContactNotFound</faultcode>
          <faultstring>application error</faultstring>
          <detail>Contact with id 0 could not be found!</detail>
        </SOAP-ENV:Fault>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    
FeedbackOpens in a new tab