追加のコーディングなしでこの問題に取り組むためのフィクスチャを作成しました: XmlHttpTest。リクエストの作成は、XML 構造を模倣する (カスタム) Java コードを使用して処理されません。代わりに、プレースホルダーを置き換える必要があるテキスト値を生成するものとして扱われます。チェックは XPath 式を使用して実行されます。
1 回の呼び出しの使用例 (プロジェクトの GitHub wiki ページの 1 つから抜粋):
!define POST_BODY { {{{
<s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
  <s11:Body>
    <ns1:GetCityWeatherByZIP xmlns:ns1="http://ws.cdyne.com/WeatherWS/">
      <ns1:ZIP>90210</ns1:ZIP>
    </ns1:GetCityWeatherByZIP>
  </s11:Body>
</s11:Envelope>
}}} }
|script         |xml http test                                                       |
|post           |${POST_BODY}   |to                   |${URL}                        |
|check          |response status|200                                                 |
|show           |response                                                            |
|register prefix|weather        |for namespace        |http://ws.cdyne.com/WeatherWS/|
|check          |xPath          |//weather:City/text()|Beverly Hills                 |
(結果)
または(シナリオを使用して複数の呼び出しを行う)
!*> Scenario definition
!define POST_BODY_2 { {{{
<s11:Envelope xmlns:s11="http://schemas.xmlsoap.org/soap/envelope/">
  <s11:Body>
    <ns1:GetCityWeatherByZIP xmlns:ns1="http://ws.cdyne.com/WeatherWS/">
      <ns1:ZIP>@{zip}</ns1:ZIP>
    </ns1:GetCityWeatherByZIP>
  </s11:Body>
</s11:Envelope>
}}} }
|script|xml http test|
|table template |send request                                                        |
|post           |${POST_BODY_2} |to                   |${URL}                        |
|check          |response status|200                                                 |
|show           |response                                                            |
|register prefix|weather        |for namespace        |http://ws.cdyne.com/WeatherWS/|
|check          |xPath          |//weather:City/text()|@{City}                       |
*!
|send request       |
|zip  |City         |
|10007|New York     |
|94102|San Francisco|
(結果)
より複雑なリクエストの場合、フィクスチャは Freemarker テンプレートの使用も許可します(オプションの要素や反復など)。