看了YanHua同学的《 用JRuby轻松搞定SOAP消息 》也手痒了那我就用Groovy来实现一个吧) 下载jar包 并将其放置于/lib目录中 定义Hello类如下(保存为Hellogroovy并放在classpath中使Groovy能够找到该类) class Hello {String hello(String name){return hello + name}} 启动SoapServer import soapSoapServerdef server = new SoapServer( localhost )serversetNode( Hello )serverstart() 创建SoapClient并调用相关服务 import soapSoapClientdef proxy = new SoapClient( //localhost:/HelloInterface?wsdl )println proxyhello( Daniel ) 结果如下所示 helloDaniel |