정적 WSDL 사용

  • 릴리스 버전: Xanadu
  • 업데이트 날짜 2024년 08월 01일
  • 읽기1분
  • 정적 WSDL을 SOAP 클라이언트로 로드하여 SOAP 웹 서비스를 요청합니다.

    웹 서비스 클라이언트는 다음을 제공합니다.
    • FakeStockValue 프로젝트입니다.
    • StockQuoteBinding 웹 서비스입니다.
    • 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>
    이 웹 서비스 엔드포인트에 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>