スタティック WSDL の使用

  • リリースバージョン: Xanadu
  • 更新日 2024年08月01日
  • 所要時間:1分
  • スタティック WSDL を SOAP クライアントにロードして、SOAP Web サービスに要求を行います。

    Web サービスクライアントは次を提供します。
    • FakeStockValue プロジェクト
    • StockQuoteBinding Web サービス
    • GetLastTradePrice SOAP 関数この関数は、実行時に要求レコードを生成します。
    図 : 1. ロードされた WSDL
    スタティック WSDL でデフォルトの要求 XML を変更して、銘柄コードを含めることができます。
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:stoc="http://example.com/stockquote.xsd">
       <soapenv:Header/>
       <soapenv:Body>
          <stoc:TradePriceRequest>IBM</stoc:TradePriceRequest>
       </soapenv:Body>
    </soapenv:Envelope>
    この Web サービスエンドポイントに SOAP 要求を送信すると、要求元の SOAP クライアントに次が返されます。
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <SOAP-ENV:Body>
          <GetLastTradePriceOutput xmlns="https://www.service-now.com/vws/FakeStockValue">
             <message>admin2, You were looking for a quote on IBM</message>
          </GetLastTradePriceOutput>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>