それは一種の苦痛になりますが、これがあなたができることです:
1)アサーションタブを使用してXpathの「ベース」を把握します(すでにここにいるように聞こえます)。この公開サイトを使用してテストしました:http: //graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl
単一のパラメータとして「hawaii」を使用してCornerPointsメソッドを使用しました。
私はこの「ベース」xpathを作成しました:
declare namespace ns1='http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl';
declare namespace SOAP-ENC='http://schemas.xmlsoap.org/soap/encoding/';
declare namespace SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/';
/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:CornerPointsResponse/listLatLonOut
(it will write the declare statements for you if you click declare)
(which you can test out in the assertions window)
2)プロパティステップを作成します
3)プロパティ転送ステップを作成します
4)Groovyスクリプトを作成する
5)プロパティを追加します...私は私のその他と呼びました
6)転送ステップを追加します
* transfer from the CornerPoints - Request 1 --- Response
* paste the Xpath stuff in the box under the 'transfer from'
* Transfer to your property
(You can test with the little play button)
7)Groovyスクリプトに次のようなものを追加します。
def x = context.expand( '${Properties#misc}' )
def parts = x.tokenize(',')
for (def part in parts)
{
log.info(part)
if (part.startsWith("-153"))
log.info("good")
}
グルーヴィーなステップでは、(部分的な)データを取得するために必要なことは何でもできます。追加したサンプルコードは、CDATAでラップされた長い行からlat / lonsを取得し、一部のデータの開始部分のみをチェックします。単なる例です。
groovyおよびjava文字列メソッドを使用できることを忘れないでください。
http://groovy.codehaus.org/groovy-jdk/java/lang/String.html
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/String.html
その他のGroovyのヒント:
http: //www.soapui.org/Scripting-Properties/tips-a-tricks.html