我正在閱讀新的Java Web Services: Up and Running書中的第一個示例。我嘗試通過第13頁的SOAP客戶端Java示例,但在Groovy中。無法從Groovy調用Web服務
因此,這裏是我的Groovy shell代碼:
import javax.xml.namespace.QName
import javax.xml.ws.Service
import java.net.URL
url = new URL("http://someURL?wsdl")
qname = new QName("http://someURL", "SomeURLImplService")
service = Service.create(url, qname)
但這種失敗,此錯誤:
ERROR groovy.lang.MissingMethodException: No signature of method: \
static javax.xml.ws.Service.create() is applicable for argument types: \
(java.net.URL, javax.xml.namespace.QName) values: {http://someURL?wsdl, \
{http://someURL}SomeURLImplService}
我不明白這一點,因爲Groovy的告訴我,這個方法與簽名確實存在:
groovy:000> Service.class.getMethods().each {println it}
public static javax.xml.ws.Service \
javax.xml.ws.Service.create(java.net.URL,javax.xml.namespace.QName)
...
有人知道我在做什麼錯嗎?
它也適用於我。 – chanwit 2009-02-24 16:39:36