我正在阅读新的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