Groovy SOAP

Deprecated Module

Before using GroovySOAP, make sure to check GroovyWS

Introduction


SOAP is a lightweight protocol intended for exchanging structured information in a decentralized, distributed environment. Groovy has a SOAP implementation based on
Xfire which allows you to create a SOAP server and/or make calls to remote SOAP servers using Groovy.

Installation

 You just need to download this jar file in your ${user.home}/.groovy/lib directory. This jar file embeds all the dependencies.

Getting Started

The Server

You can develop your web service using a groovy script and/or a groovy class. The following two groovy files are valid for building a web-service.

  1. MathService.groovy
    public class MathService {
        double add(double arg0, double arg1) {
          return (arg0 + arg1)
        }
        double square(double arg0) {
          return (arg0 * arg0)
        }
    }

  2. You can also using something more Groovy
    double add(double arg0, double arg1) {
      return (arg0 + arg1)
    }
    double square(double arg0) {
      return (arg0 * arg0)
    }

  3. Then the easy part ... no need for comments
    import groovy.net.soap.SoapServer
    
    def server = new SoapServer("localhost", 6980)
    
    server.setNode("MathService")
    
    server.start()

    That's all !

The Client

  1. Oh ... you want to test it ... two more lines.
    import groovy.net.soap.SoapClient
    
    def proxy = new SoapClient("http://localhost:6980/MathServiceInterface?wsdl")
    
    def result = proxy.add(1.0, 2.0)
    assert (result == 3.0)
    
    result = proxy.square(3.0)
    assert (result == 9.0)
  2. You're done!

Custom Data Types

This example shows how to use custom data types with Groovy SOAP. The code can be downloaded from here.

The Server

The PersonService.groovy script contains the service implementation and the custom data type (Person).

PersonService.groovy
class Person {
  int id
  String firstname
  String lastname
}

Person findPerson(int id) {
  return new Person(id:id, firstname:'First', lastname:'Last')

Server.groovy is equivalent to the previous example.
Server.groovy
import groovy.net.soap.SoapServer;

def server = new SoapServer("localhost", 6980);
server.setNode("PersonService");
server.start();

For each class compiled by the groovy compiler a metaClass property is added to the bytecode. This property must be excluded from being mapped by XFire, otherwise an error will be reported when trying to obtain the WSDL document from http://localhost:6980/PersonServiceInterface?wsdl. The reason is that XFire cannot map groovy.lang.MetaClass. To ignore the metaClass property a custom type mapping must be defined (for details refer to Aegis Binding).
Person.aegis.xml
<?xml version="1.0" encoding="UTF-8"?>
<mappings xmlns:sample="http://DefaultNamespace">
  <mapping name="sample:Person">
    <property name="metaClass" ignore="true"/>
  </mapping>
</mappings>

However, if you compile custom data types from Java the bytecode won't contain a metaClass property and, hence, there is no need to define a custom mapping.

The Client


Client.groovy
import groovy.net.soap.SoapClient

def proxy = new SoapClient('http://localhost:6980/PersonServiceInterface?wsdl')
def person = proxy.findPerson(12)
println 'Person (' + person.id + ') = ' +
  person.firstname + ' ' + person.lastname


More Information

Current limitations (and workaround)

  1. No authentication (see JIRA issue 1457)
  2. No proxy support (see JIRA issue 1458)
  3. Numeric values are represented as strings in custom data types and arrays.
  4. Custom data types cannot be processed on client side when using the Groovy SOAP module with the current groovy-1.0 release.
  5. It looks like the XFire dynamic client does not support complex datatypes. This may be a concern if you need for example to transfer an Image as a byte array. The workaround I use is to transform this in a String an transfer that String - As this is a bit painful I am investigating moving to the regular XFire client. Here is a little program demo-ing this (look at this "disco age" image - Is Groovy that old ?

The client (ImageClient.groovy)

import groovy.swing.SwingBuilder
import groovy.net.soap.SoapClient
import javax.swing.ImageIcon
import org.apache.commons.codec.binary.Base64

proxy = new SoapClient("http://localhost:6980/ImageServiceInterface?WSDL")

// get the string, transform it to a byte array and decode this array
b64 = new Base64()
bbytes = b64.decode(proxy.getImage().getBytes())


swing = new groovy.swing.SwingBuilder()

// this is regular SwingBuilder stuff
i1 = swing.label(icon:new ImageIcon(bbytes))
frame = swing.frame(title:'Groovy logo', defaultCloseOperation:javax.swing.WindowConstants.DISPOSE_ON_CLOSE) {
  panel(){
    widget(i1)
  }
}
frame.pack()
frame.show()

The (ugly) server part embedding the image which is Base64 encoded (ImageServer.groovy):
import groovy.net.soap.SoapServer

def server = new SoapServer("localhost", 6980)
server.setNode("ImageService")
server.start()

and the missing and secred part is here.

Demos with public web services

There exist a lot of web-services available for testing. One which is pretty easy to evaluate is the currency rate calculator from webservicex.net.
Here is a small swing sample that demonstrate the use of the service. Enjoy !

import groovy.swing.SwingBuilder
import groovy.net.soap.SoapClient

proxy = new SoapClient("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL")

def currency = ['USD', 'EUR', 'CAD', 'GBP', 'AUD']
def rate = 0.0

swing = new SwingBuilder()

refresh = swing.action(
  name:'Refresh',
  closure:this.&refreshText,
  mnemonic:'R'
)

frame = swing.frame(title:'Currency Demo') {
  panel {
    label 'Currency rate from '
    comboBox(id:'from', items:currency)
    label ' to '
    comboBox(id:'to', items:currency)
    label ' is '
    textField(id:'currency', columns:10, rate.toString())
    button(text:'Go !', action:refresh)
  }
}
frame.pack()
frame.show()

def refreshText(event) {
  rate = proxy.ConversionRate(swing.from.getSelectedItem(), swing.to.getSelectedItem())
  swing.currency.text = rate
}

And here is the result:

 

Labels

 
(None)
  1. Mar 30, 2006

    Jonathan Carlson says:

    I have a couple of questions: 1) Is there no stub generation required?&nbsp; May...

    I have a couple of questions:

    1) Is there no stub generation required?  Maybe that's just the beauty of Groovy!

    2) Is it demonstrated to be able to communicate with an Axis server?   I suppose this question belongs on the XFire mailing list so I'll ask there.

  2. Apr 01, 2006

    galleon says:

    Hehe, no you don't need to generate any stubs \! I have not yet trying to use it...

    Hehe, no you don't need to generate any stubs !

    I have not yet trying to use it with an Axis server.

    Thanks for considering GroovySOAP and keep me informed of your progress as well as new requirements.

  3. Apr 10, 2006

    carlos manuel antonio fernandes says:

    Hello, I'm using groovy version 1.0jsr05 but the class SoapClient isnt in the Li...

    Hello, I'm using groovy version 1.0-jsr-05 but the class SoapClient isnt in the Lib.

    I need to download another jar?

    Thanks.

    Carlos Fernandes 

  4. Apr 14, 2006

    Kevin Slater says:

    Guillaume, I've downloaded GSOAP and have built and run it. Can it be integrated...

    Guillaume,

    I've downloaded GSOAP and have built and run it. Can it be integrated with my normal Groovy JSR-05 release? Or do I have to use the JSR-05-Snapshot release that it came with? I'd like to be able to use the GSoap stuff in my normal groovy env if possible.

     ...Kevin

  5. Apr 15, 2006

    galleon says:

    Kevin, &nbsp;Fine, you answered to Carlos ;) : currrently GroovySOAP is not part...

    Kevin,

     Fine, you answered to Carlos : currrently GroovySOAP is not part of the Groovy release. I guess it will be part of the next release. Then you have to download it from the CVS.

     Of course, you can use it with your own Groovy release and not necessarily with the attached Groovy version. you just need the jar file.

    Hope this help

    Guillaume

  6. Apr 16, 2006

    Tom Zeng says:

    Guillaume, Any plan to support writing the services in Groovy? Thanks,&nbsp; Tom

    Guillaume,

    Any plan to support writing the services in Groovy?

    Thanks, 

    Tom

  7. May 04, 2006

    Peter Tillemans says:

    Guillaime, I get a 404 when clicking on the link to the groovysoapall200600503.j...

    Guillaime,

    I get a 404 when clicking on the link to the groovysoap-all-2006*00503.jar. I think the fat underlined *0 is too much?

    I succeeded in downloading it from here. 

    regards,

    Peter 

  8. May 08, 2006

    Peter Tillemans says:

    Hi, &nbsp;getting over the hurdle of the broken link was not the end... Apparent...

    Hi,

     getting over the hurdle of the broken link was not the end...

    Apparently the XFire people use a sort of special classloader with as a result that the stax jars do not get found (Always complaining of not finding the com.bea.... stuff which is basically the hardcoded default). This is solved by installing the needed stax jar's in the $

    Unknown macro: {JAVA_HOME}
    /jre/lib/endorsed  directory.

    Now I get a array index error when using webservices without a parameter. And by some strange coincidence, all the services I need, do not have any parameters....

    I have seen similar postings on the XFire mailing lists.

    regards,

    Peter 

  9. May 08, 2006

    galleon says:

    Hi peter, Thanks for trying GroovySOAP. Can you be more specific on your problem...

    Hi peter,

    Thanks for trying GroovySOAP. Can you be more specific on your problem and maybe give a sample ?

    Thanks

    Guillaume 

  10. May 09, 2006

    Don Stewart says:

    Does GroovySOAP only work with basic types ? I got the simple maths example wor...

    Does GroovySOAP only work with basic types ?

    I got the simple maths example working. Then I moved on to super complex example :o)

    I'm trying to use XMLBeans generated classes. I know XFire works with these. I added the required types to the interface and specified the imports and types in the .groovy source file (a class) and it showed errors in the Groovy source file in Eclipse (using the latest CVS build of the GroovyEclipse plugin). I added the XMLBEans generated JAR to the classpath and the errors markers were removed (i.e. could not resolve the complex return type but is able to after the classpath update).

    The JAVA interface gets compiled to a .class but no .class is generated from the .groovy file. If I use groovy or groovyc from the command line I get unable to resolve class even though I have added the JAR to the groovy\lib directory. Is there something else I need to do in order to get the service to compile ... and run

    Many thanks in advance

    Don

  11. May 09, 2006

    galleon says:

    Don, I am also experiencing problems when trying to use complex types directly i...

    Don,

    I am also experiencing problems when trying to use complex types directly in Groovy while this is working when the interface is done in Java. I am currently trying to solve that problem. Could you describe more precisely your process using XMLBeans. You can join me at galleon@codehaus.org

    Thanks for trying GroovySOAP. 

    Guillaume

  12. May 10, 2006

    carlos manuel antonio fernandes says:

    &nbsp;I'm invoking a relative simple WebService from amazon, after the math exam...

     I'm invoking a relative simple WebService from amazon, after the math example  :

     import groovy.net.SoapClient

    def proxy= new SoapClient("http://soap.amazon.com/schemas2/AmazonWebServices.wsdl")

    def result = proxy.KeywordSearchRequest("Borges","2","books","","lite","")

    I got  a classCastException. Reading the debug log, I think only the first parameter is passed to the server.

    Any sugestion?

  13. May 11, 2006

    Peter Tillemans says:

    This is my sample program. It is supposed to return an array of strings (and do...

    This is my sample program. It is supposed to return an array of strings (and
    does so using ruby, python, perl, PHP, Java with varying amounts of success)

    import groovy.net.soap.SoapClient
    def proxy = new SoapClient("http://dynip-56-144:8080/xxmlx_lov/LovServiceBean?wsdl")
    rslt = proxy.getPackageNames()
    print rslt

    Then I get this stack dump::

    HH:mm:ss z, EEE, dd-MM-yyyy HH:mm:ss z]
    2006-05-11 13:54:42,637

    Unknown macro: { main}

    [DEBUG,DefaultHttpParams] Set parameter http.useragent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; XFire Client +http://xfire.codehaus.org)
    2006-05-11 13:54:42,646

    [DEBUG,DefaultHttpParams] Set parameter http.protocol.expect-continue = true
    2006-05-11 13:54:42,646
    Unknown macro: { main}
    [DEBUG,DefaultHttpParams] Set parameter http.protocol.version = HTTP/1.1
    org.codehaus.xfire.fault.XFireFault: 0
    at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
    at org.codehaus.xfire.client.Client.invoke(Client.java:351)
    at org.codehaus.xfire.client.Client.invoke(Client.java:377)
    at groovy.net.soap.SoapClient.invokeMethod(Unknown Source)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:161)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:104)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod(ScriptBytecodeAdapter.java:85)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeNoArgumentsMethod(ScriptBytecodeAdapter.java:175)
    at test4.run(test4.groovy:5)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    ... snip ...
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:131)
    at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:160)
    Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
    at org.codehaus.xfire.service.binding.AbstractBinding.getClientParam(AbstractBinding.java:260)
    at org.codehaus.xfire.service.binding.DocumentBinding.writeMessage(DocumentBinding.java:61)
    at org.codehaus.xfire.soap.SoapSerializer.writeMessage(SoapSerializer.java:81)
    at org.codehaus.xfire.transport.http.HttpChannel.writeWithoutAttachments(HttpChannel.java:111)
    at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.getByteArrayRequestEntity(CommonsHttpMessageSender.java:209)
    at org.codehaus.xfire.transport.http.CommonsHttpMessageSender.send(CommonsHttpMessageSender.java:158)
    at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:167)
    at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:66)
    at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:98)
    at org.codehaus.xfire.client.Client.invoke(Client.java:347)
    ... 50 more

    hope it helps,

    Peter

  14. May 15, 2006

    galleon says:

    Hi all You are probaly aware that the main codehaus server is out. Therefore I ...

    Hi all

    You are probaly aware that the main codehaus server is out. Therefore I have put a new version of GroovySOAP on this server (http://grideads.dyndns.org/groovysoap-all-20060515.jar) until it is up again. This should solve much of yours problems - if not post me a message.

    cheers

    tog

  15. May 17, 2006

    Steffen Thorhauer says:

    Hi, I'm trying the MathService Sample, but all what I get from

    Hi,

    I'm trying the MathService Sample, but all what I get from

    http://localhost:6980/MathWebServiceInterface?wsdl

     is

    HTTP ERROR: 500

    Provider com.bea.xml.stream.MXParserFactory not found
    RequestURI=/MathWebServiceInterface

    Powered by Jetty://

    I'm using
     Groovy Version: 1.0-jsr-05 JVM: 1.5.0_06-b05

    activation.jar from jaf1.1

    mail.jar from javamail-1.4

     groovysoap-all-20060508.jar or groovysoap-all-20060515.jar

    Regards,

      Steffen
     

  16. May 23, 2006

    galleon says:

    Hi steffen, looks like stax libraries are mandatory now for xfire1.1. You can fe...

    Hi steffen,

    looks like stax libraries are mandatory now for xfire-1.1. You can fetch them from http://dist.codehaus.org/stax/jars/. I will make them available in the next release.

    cheers

    tog

  17. May 23, 2006

    Leo Tu says:

    Hi, Does it support JDK 1.4.2 ? I found that current groovysoapallxxx.jar only s...

    Hi,

    Does it support JDK 1.4.2 ? I found that current groovysoap-all-xxx.jar only support JSE 5.0.

    Leo.

  18. Jan 17, 2007

    Jeff Stout says:

    Any idea when it will support auth?

    Any idea when it will support auth?

  19. Jan 24, 2007

    Matthew Churcher says:

    I'm having great difficulty accessing a web services generated following a netbe...

    I'm having great difficulty accessing a web services generated following a netbeans tutorial:
    http://www.netbeans.org/kb/55/websvc-jax-ws.html

    The method add() is part of CalculatorWSPort, but I am unsure how to access a service 'port' from groovy.

    MyCode:-
    ..
    def proxy = new SoapClient("http://localhost:8084/CalculatorWSApplication/CalculatorWS?wsdl")
    def result = proxy.add(1, 2)
    ..

    Any Ideas? Cheers Matt.

  20. Jan 26, 2007

    Mike Westaway says:

    The implementation of the SoapClient class uses the JDK5style annotation, Proper...

    The implementation of the SoapClient class uses the JDK5-style annotation, Property. I can't find the defintion of this.classSource.append(" @Property ");So I get exceptions when the SoapClient tries to build the deserialiser...
    Object back = new GroovyShell(binding).evaluate(classSource.toString());Also, the syntax of the code generated doesn't seem to be valid in my JDK5.result = new ns1vesselContent (nsnotFoundFlag:"false",nsfoundVessel:new nsfoundVessel(nsparentContainer:new nsparentContainer(ns1barCode:"XXX",ns1parentContainerBarCode:"ZZZ",...From what I've read, the constructor for annotation uses '=' so the code should read

    (nsnotFoundFlag="false",...

    Great idea ! Just wish I could get it to work.

  21. Jan 26, 2007

    Martin Krasser says:

    Hi Mike, I added a JIRA issue (GROOVY1677) releated to the problem you describe...

    Hi Mike,

    I added a JIRA issue (GROOVY-1677) releated to the problem you described. As a temporary workaround (until the bug is fixed), use Groovy SOAP with the groovy-1.0-JSR-06 release which accepts @Property annotations.

    Cheers,
    Martin

  22. Jan 29, 2007

    galleon says:

    Mike, This issue as been soved please use the latest version of GroovySOAP. Chee...

    Mike, This issue as been soved please use the latest version of GroovySOAP. Cheers Tog

  23. Feb 12, 2007

    Peter Crosbie says:

    This is excellent, thank you.&nbsp; I am using it as the tinest bit of glue to c...

    This is excellent, thank you.  I am using it as the tinest bit of glue to connect algorithms in POJO with MS Excel.

    Can I name the Windows service that is created by server.start()?  This would make it much easier to stop, at the moment the only way I know is to guess which jvm the service is running in.

    Thanks, Peter 

  24. Feb 19, 2007

    Bryan Taylor says:

    I saved the currency demo code copied from above to a source file conv.groovy an...

    I saved the currency demo code copied from above to a source file conv.groovy and downloaded the groovysoap jar to my groovy lib director, but I get an error:

    [btaylor@office100-59 ~]$ groovy conv.groovy
    Caught: java.lang.NoSuchMethodError: org.w3c.dom.Element.getTextContent()Ljava/lang/String;
            at conv.run(conv.groovy:4)
            at conv.main(conv.groovy)

     [btaylor@office100-59 ~]$ ls /home/btaylor/.groovy/lib/groovysoap*
    /home/btaylor/.groovy/lib/groovysoap-all-1.0-0.3-snapshot_jdk1.5.0.jar

     [btaylor@office100-59 ~]$ groovy -version
    Groovy Version: 1.0 JVM: 1.5.0_09-b01

    I checked and org.w3c.dom.Element does not have a getTextContext(String) method in java 1.5. See http://java.sun.com/j2se/1.5.0/docs/api/org/w3c/dom/Element.html&nbsp;

    Any ideas? I looked in you SoapClient code, but didn't see the offending code. I also tried building it from the trunk, and I get the same error running it with groovysoap-all-1.0-0.3-snapshot.jar

  25. Mar 06, 2007

    Roger Warner says:

    This isn't strictly speaking a groovySOAP issue, but it occurs while I'm using g...

    This isn't strictly speaking a groovySOAP issue, but it occurs while I'm using groovySoap.   I trying to access legacy web services using GS.   However, in the complex return XML the field I need to access is named 'return'.    Groovy gets an interpreter/compiler exception when i try to grab the field.   Some sample code and the response follows.     Net-net how do you can you access a groovy keyword as a regular token?

     def url='http://rhel4dev2.<...>.local:7777/t2services/LoginService?WSDL'
    def remote = new SoapClient(url)

    def result = remote.login(name.value , pass.value)
    def out = result.return

    Tue Mar 06 09:13:07 PST 2007:ERROR:org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Script1.groovy: 13: unexpected token: return @ line 13, column 18.
    1 error

    Ideas on how to parse out 'return' from the response?

  26. Mar 21, 2007

    Jochen Vajda says:

    @Roger just use def out = result.'return' If you use the following code, the S...

    @Roger
    just use
    def out = result.'return'

    If you use the following code, the SoapClient generates a ConnectException and prints a stack trace, but it processes without throwing the exception. It will not reach the catch block. Is that the intended behaviour?

    try
    {
    	def clientProxy = new SoapClient('http://unreachableservice');
    	println 'Proxy object was created successfully.';
    }
    catch (ConnectException e)
    {
    	println "Error: Could not connect to webservice"
    	println e.message
    }

    Greetings.

  27. Apr 26, 2007

    zuokun says:

    To Bryan Taylor: I have the same problem using groovy 1.0. I got a work around b...

    To Bryan Taylor:

    I have the same problem using groovy 1.0.

    I got a work around by just delete xml-apis-1.0.b2.jar file under groovy_home/lib directory.

    good luck!

  28. Aug 20, 2007

    Valeria says:

    Hello Guillaume, I have downloaded the: https://dav.codehaus.org/dist/groovy/jar...

    Hello Guillaume, I have downloaded the: https://dav.codehaus.org/dist/groovy/jars/groovysoap-all-1.0-0.3.1-snapshot_jdk1.5.0.jar but I'm still having troubles with the packages. If I do the example of the server and  MathService, but put them into packages I have problems. I read the conversation you have in: http://archive.codehaus.org/groovy/user/200703220805.11854.list.groovy@newgenesys.com
    but with the groovysoap jar that you fix Im still having troubles. What can i do? here is the exception I have:
    Cannot parse Interface class:
    interface com.ikatu.kat.WebService.MathServiceInterface {
    double add(double arg0, double arg1);
    double square(double arg0);
    }
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, script1187638928061.groovy: 1: unexpected token: interface @ line 1, column 1.
    1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:326)
    at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:173)
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:143)
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:155)
    at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:382)
    at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:87)
    at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:279)
    at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:184)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:833)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:480)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:306)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:275)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:270)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:242)
    at groovy.net.soap.SoapServer.setNode(SoapServer.java:185)
    at groovy.net.soap.SoapServer.setNode(SoapServer.java:213)
    at gjdk.groovy.net.soap.SoapServer_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:560)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:450)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:119)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
    at com.ikatu.kat.WebService.Server.run(Server.groovy:5)
    at gjdk.com.ikatu.kat.WebService.Server_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:560)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:450)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:131)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:408)
    at gjdk.org.codehaus.groovy.runtime.InvokerHelper_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:664)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:111)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
    at com.ikatu.kat.WebService.Server.main(Server.groovy)
    Cannot parse Implementation class:
    class com.ikatu.kat.WebService.MathServiceImpl implements com.ikatu.kat.WebService.MathServiceInterface {
    def service = new com.ikatu.kat.WebService.MathService()

    double add(double arg0, double arg1)

    Unknown macro: { return service.add(arg0, arg1) }

    double square(double arg0)

    Unknown macro: { return service.square(arg0) }

    }
    org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, script1187638928295.groovy: 1: unexpected token: class @ line 1, column 1.
    1 error

    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:326)
    at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:173)
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:143)
    at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:155)
    at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:382)
    at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:87)
    at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:279)
    at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:184)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:833)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:480)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:306)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:275)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:270)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:242)
    at groovy.net.soap.SoapServer.setNode(SoapServer.java:193)
    at groovy.net.soap.SoapServer.setNode(SoapServer.java:213)
    at gjdk.groovy.net.soap.SoapServer_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:560)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:450)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:119)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
    at com.ikatu.kat.WebService.Server.run(Server.groovy:5)
    at gjdk.com.ikatu.kat.WebService.Server_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:560)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:450)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:131)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:408)
    at gjdk.org.codehaus.groovy.runtime.InvokerHelper_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:664)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:111)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
    at com.ikatu.kat.WebService.Server.main(Server.groovy)
    Exception in thread "main" java.lang.NullPointerException
    at org.codehaus.xfire.util.ServiceUtils.makeServiceNameFromClassName(ServiceUtils.java:27)
    at org.codehaus.xfire.service.binding.ObjectServiceFactory.makeServiceNameFromClassName(ObjectServiceFactory.java:361)
    at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:380)
    at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:356)
    at org.codehaus.xfire.service.binding.ObjectServiceFactory.create(ObjectServiceFactory.java:337)
    at groovy.net.soap.SoapServer.setNode(SoapServer.java:201)
    at groovy.net.soap.SoapServer.setNode(SoapServer.java:213)
    at gjdk.groovy.net.soap.SoapServer_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:560)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:450)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:119)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
    at com.ikatu.kat.WebService.Server.run(Server.groovy:5)
    at gjdk.com.ikatu.kat.WebService.Server_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:560)
    at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:450)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:131)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:408)
    at gjdk.org.codehaus.groovy.runtime.InvokerHelper_GroovyReflector.invoke(Unknown Source)
    at groovy.lang.MetaMethod.invoke(MetaMethod.java:115)
    at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
    at groovy.lang.MetaClassImpl.invokeStaticMethod(MetaClassImpl.java:664)
    at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:111)
    at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:111)
    at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:187)
    at com.ikatu.kat.WebService.Server.main(Server.groovy)
     

  29. Aug 20, 2007

    Valeria says:

    Im sorry but I make a mistake because I was working with https://dav.codehaus.or...
  30. Oct 30, 2007

    G.Schoepp says:

    Where is the jar file gone. It is not here anymore:

    Where is the jar file gone.
    It is not here anymore:
    http://dist.codehaus.org/groovy/jars/groovysoap-all-1.0-0.3-snapshot_jdk1.5.0.jar

    Guido

  31. Feb 13

    Jesse Barnum says:

    Can somebody please correct the download link? It is broken.

    Can somebody please correct the download link? It is broken.

  32. Feb 19

    lizardu says:

    I'm also having problems with the groovy soap download link.&nbsp; Until someone...

    I'm also having problems with the groovy soap download link.  Until someone gets around to fixing, you can download the jar from here:

     http://momupload.com/files/77499/groovysoap-all-1.0-0.3-snapshot_jdk1.5.0.jar.html

  33. Feb 26

    lizardu says:

    I don't know how I missed this before but there's a new module: GroovyWS

    I don't know how I missed this before but there's a new module: GroovyWS

    http://docs.codehaus.org/display/GROOVY/GroovyWS

    GroovyWS is taking over GroovySOAP as CXF replaces XFire. The major difference here is that GroovyWS is using Java5 so if you need to stick to 1.4 please continue to use GroovySOAP.