我有一個Web服務,我生成一個示例請求,然後取代所有的?最簡單的情況是0。它工作正常。然後我更換這樣的一個值:soapui 2.0.2給我NumberFormatException甚至最簡單的表達式
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://interfaces.mypackage.foo.com">
<soapenv:Header/>
<soapenv:Body>
<int:getCheckResults>
<criteria>
<startTm>
<time>${=0}</time>
</startTm>
</criteria>
</int:getCheckResults>
</soapenv:Body>
</soapenv:Envelope>
(我想是這樣的,最終,我想通過讀取日期這樣當接口需要一個很長毫秒值的原因):
<startTm>
<time>${= new java.util.SimpleDateFormat("MM/dd/yyyy hh:mm z").parse("01/01/2012 04:00 GMT"}</time>
</startTm>
它總是給我同樣的答案,而不是調用服務 - 這曾經工作,但我不知道現在有什麼不同,也許它在舊版本的SoapUI中工作?
<soapenv:Fault>
<faultcode>soapenv:Server.generalException</faultcode>
<faultstring>java.lang.NumberFormatException: For input string: "" Message being parsed:</faultstring>
</soapenv:Fault>
幫助!!
謝謝 - 我明白你的意思,但是因爲我試圖從SOAP UI運行它,所以我沒有任何地方可以事先運行這個goovy腳本。這個問題似乎是在SOAPUI本身,它擴展$ {=一些java表達式}(或不)。我將吹走2.0.2並嘗試最新的4.5(win7 64bit)並看看如何去... –
有一個Groovy測試步驟,您可以添加到您的肥皂UI測試中。也許你沒有看到它,因爲你還沒有創建TestSuite> TestCase等。如果你直接從「I」圖標下的生成步驟運行,那麼你不能添加Groovy測試步驟。 – chrismead