jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Groovy Modules
  • GMOD-82

GroovyWS and CaDSRDataService, multiple issues

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: GroovyWS-0.5.0
  • Fix Version/s: GroovyWS-0.5.0
  • Component/s: GroovyWS
  • Labels:
    None
  • Environment:
    Windows XP, JDK 1.5.0_07, Groovy 1.6.0

Description

This is a description of multiple issues encountered, and workarounds employed while writing a script that uses GroovyWS to query the caDSR data service hosted by the National Cancer Institute. In addition to this writeup, the attached ZIP file contains scripts to help illustrate the issues and workarounds.

The caDSR data service is a public web service, with WSDL available at the following URL:

http://cadsr-dataservice.nci.nih.gov/wsrf/services/cagrid/CaDSRDataService?wsdl

My program needs to connect with the service from within grails, so I used the (tiny, ~25k) released groovyws-0.5.0.jar file available here:

http://repository.codehaus.org/org/codehaus/groovy/modules/groovyws/0.5.0/groovyws-0.5.0.jar

To resolve dependencies for the tiny groovyws-0.5.0.jar file, I separately obtained the other third-party JAR files listed on the "Using WSClient in Grails" wiki page:

http://groovy.codehaus.org/Using+WSClient+in+Grails

cxf-bundle-2.1.4.jar
wstx-asl-3.2.7.jar
commons-logging-1.1.1.jar
bcprov-jdk15-140.jar
XmlSchema-1.4.4.jar
FastInfoset-1.2.2.jar
jaxen-1.1.1.jar
jaxb-xjc-2.1.9.jar
jaxb-impl-2.1.9.jar
jaxb-api-2.1.jar
geronimo-ws-metadata_2.0_spec-1.1.2.jar
geronimo-stax-api_1.0_spec-1.0.1.jar
geronimo-jaxws_2.1_spec-1.0.jar
geronimo-javamail_1.4_spec-1.5.jar
geronimo-annotation_1.0_spec-1.1.1.jar
geronimo-activation_1.1_spec-1.0.2.jar
xmlsec-1.4.2.jar
xml-resolver-1.2.jar
xalan-2.7.1.jar
wss4j-1.5.6.jar
wsdl4j-1.6.2.jar
serializer-2.7.1.jar
saaj-impl-1.3.2.jar
saaj-api-1.3.jar
neethi-2.0.4.jar
jdom-1.1.jar

The Goal: Create a GroovyWS-based script that uses the CaDSRDataService to execute the equivalent of the following SOAP request and prints out the longName for each Form returned by the query.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dat="http://gov.nih.nci.cagrid.data/DataService" xmlns:gov="http://CQL.caBIG/1/gov.nih.nci.cagrid.CQLQuery">
<soapenv:Header/>
<soapenv:Body>
<dat:QueryRequest>
<dat:cqlQuery>
<gov:CQLQuery>
<gov:Target name="gov.nih.nci.cadsr.domain.Form">
<gov:Group logicRelation="AND">
<gov:Attribute name="workflowStatusName" predicate="EQUAL_TO" value="RELEASED"/>
<gov:Association name="gov.nih.nci.cadsr.domain.Context" roleName="context">
<gov:Attribute name="name" predicate="EQUAL_TO" value="NHLBI"/>
</gov:Association>
</gov:Group>
</gov:Target>
</gov:CQLQuery>
</dat:cqlQuery>
</dat:QueryRequest>
</soapenv:Body>
</soapenv:Envelope>

(The validity of the above SOAP request was verified using soapUI.)

In the attached ZIP file, the wstest.bat first sets the CLASSPATH environment variable to include the required JAR files, then executes the wstestX.groovy script (e.g. wstest1.groovy, wstest2.groovy, wstest3.groovy, wstest4.groovy) specified by the command line parameter.

Issue #1: "Error compiling schema from WSDL" ... "Two declarations cause a collision"

C:\groovywstest>.\wstest.bat 1
Caught: java.lang.reflect.UndeclaredThrowableException
...
Caused by: java.lang.RuntimeException: Error compiling schema from WSDL at {http ://cadsr-dataservice.nci.nih.gov/wsrf/services/cagrid/CaDSRDataService?wsdl}: Tw
o declarations cause a collision in the ObjectFactory class.
...
Caused by: com.sun.istack.SAXParseException2: Two declarations cause a collision

The above issue was caused by a problem mapping between XML and Java namespaces. To resolve this issue, I created a custom local copy of the WSDL files and annotated the <schema> elements with <jxb:package> bindings. In one case, a <jxb:typeName> XML tranform was also needed. I think it will be common for GroovyWS users to encounter this type of namespace mapping problem, so the GroovyWS documentation should include some information about how to customize JAXB bindings (see also http://java.sun.com/webservices/docs/1.5/tutorial/doc/JAXBUsing4.html).

Issue #2: No method to create an instance of an enumerated data type.

C:\groovywstest>.\wstest.bat 2
...
INFO: Created classes: gov.nih.nci.cagrid.metadata.dataservice.DomainModel,
...
Caught: java.lang.AssertionError: Expression: (EQUAL_TO != null). Values: EQUAL_TO = null
java.lang.AssertionError: Expression: (EQUAL_TO != null). Values: EQUAL_TO = null
...

This issue is also mentioned in GMOD-4 (see http://jira.codehaus.org/browse/GMOD-4), which includes a patch that adds a createEnum() method to the WSClient class. To work around this issue, I added a createEnum() method to the script.

Issue #3: Attempt to invoke the CaDSRDataService "query" web service operation returns null.

C:\groovywstest>.\wstest.bat 3
...
INFO: Created classes: gov.nih.nci.cagrid.metadata.dataservice.DomainModel,
...
Caught: java.lang.AssertionError: Expression: (result != null). Values: result =
null
java.lang.AssertionError: Expression: (result != null). Values: result = null
...

I think this is a severe defect in GroovyWS. Further testing with a soapUI MockService indicated that, although proxy.query(cqlQuery) returned a null result, it was not even issuing a request to the web service.

To troubleshoot further, I looked for GroovyWS source code and found something interesting in this file:

http://svn.codehaus.org/gmod/groovyws/trunk/src/main/java/groovyx/net/ws/AbstractCXFWSClient.java

An excerpt from that file indicates the AbstractCXFWSClient.invokeMethod method returns null if unable to get BindingOperationInfo for the method:

public Object invokeMethod(String name, Object args) {
Object[] objs = InvokerHelper.asArray(args);

try {
QName qname = new QName(getServiceNamespaceURI(), name);
BindingOperationInfo op = getBindingOperationInfo(qname);

if (op == null) { return null; }
...

I think this is dangerous, because it causes WSClient to fail silently when attempting to invoke a method or web service operation that doesn't exist . Additionally, I didn't see any links to the (tiny ~25k) released groovyws-0.5.0.jar file, or any source code package for that release, on the GroovyWS web pages (http://groovy.codehaus.org/GroovyWS).

To get past this issue, I did some further investigation and discovered that proxy.getServiceNamespaceURI() returned an incorrect QName. As a workaround, I added code to the script, to get BindingOperationInfo using the correct QName, construct a QueryRequest, and invoke the web service operation.

So, the wstest4.groovy script is now able to successfully accomplish the goal:

C:\groovywstest>.\wstest.bat 4
...
INFO: Created classes: gov.nih.nci.cagrid.metadata.dataservice.DomainModel,
...
Bad QName: {http://dataservice.cadsr.nci.nih.gov/CaDSRDataService/service}query
null
Apr 28, 2009 6:09:32 PM groovyx.net.ws.AbstractCXFWSClient getBindingOperationInfo
WARNING: Using SOAP version: 1.1
Good QName: {http://dataservice.cadsr.nci.nih.gov/CaDSRDataService}query
[BindingOperationInfo: {http://dataservice.cadsr.nci.nih.gov/CaDSRDataService}query]
2450 - Post-Transplant Essential Data (TED)
2006 - Hematopoietic Stem Cell Transplant (HSCT) Infusion
2400 - Pre-Transplant Essential Data (TED)
2005 - Confirmation of HLA typing
2004 - Infectious Disease Markers
2900 - RECIPIENT DEATH DATA
2110 - Acute Myelogenous Leukemia Post-HSCT Data
2111 - Acute Lymphoblastic Leukemia Post-HSCT Data

I was unable to run these scripts under Eclipse (with Groovy 1.5.7 plugin), but I haven't yet investigated that problem any further (possible classloader issue?). Additionally, the time required to parse the WSDL and compile classes for the CaDSRDataService is quite noticeable, so it would be nice if there were a way to avoid recompiling each time the web service is accessed.

This experience has highlighted several issues with GroovyWS which I think should be considered:

1. Documentation should include information about how to set up local WSDL with customized JAXB bindings, to control Java <-> XML serialization.
2. The WSClient class should include a method, such as createEnum(), to create an instance of an enumerated type.
3. When unable to get BindingOperationInfo for a method, the AbstractCXFWSClient.invokeMethod method should throw an exception instead of returning null.
4. The AbstractCXFWSClient.getServiceNamespaceURI() method was returning an incorrect value; this should be fixed.
5. The huge groovyws-standalone-0.5.0.jar and groovyws-minimal-0.5.0.jar JAR files linked on the GroovyWS web site are not suitable for some environments. The web site should also include a link to the tiny groovyws-0.5.0.jar file (i.e.
http://repository.codehaus.org/org/codehaus/groovy/modules/groovyws/0.5.0/groovyws-0.5.0.jar).
6. The GroovyWS web site does not include a link to source code for the 0.5.0 release. Please add a link to the source code.

Aside, from the issues described here, I am very impressed with GroovyWS, and would like to use it in the future.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Hide
    Zip Archive
    groovywstest.zip
    30/Apr/09 2:15 PM
    110 kB
    Joel Schneider
    1. File
      groovywstest/wstest.bat 1 kB
    2. File
      groovywstest/wstest1.groovy 0.2 kB
    3. File
      groovywstest/wstest2.groovy 0.4 kB
    4. File
      groovywstest/wstest3.groovy 2 kB
    5. File
      groovywstest/wstest4.groovy 3 kB
    6. XML File
      groovywstest/.../CaDSRDataService.root.wsdl 0.8 kB
    7. XML File
      groovywstest/.../MockCaDSRDataService.root.wsdl 0.8 kB
    8. XML File
      groovywstest/.../1_gov.nih.nci.cagrid.CQLQuery.xsd 4 kB
    9. XML File
      groovywstest/.../1_gov.nih.nci.cagrid.CQLResultSet.xsd 4 kB
    10. XML File
      groovywstest/.../CaDSRDataService.wsdl 9 kB
    11. XML File
      groovywstest/.../CaDSRDataServiceTypes.xsd 1 kB
    12. XML File
      groovywstest/.../CaDSRDataService_bindings.wsdl 4 kB
    13. XML File
      groovywstest/.../CaDSRDataService_CQLResultTypes.xsd 8 kB
    14. XML File
      groovywstest/resources/.../DataService.wsdl 8 kB
    15. XML File
      groovywstest/.../DataServiceExceptions.xsd 1 kB
    16. XML File
      groovywstest/.../DataServiceTypes.xsd 0.9 kB
    17. XML File
      groovywstest/.../gov.nih.nci.cadsr.domain.xsd 88 kB
    18. XML File
      groovywstest/.../gov.nih.nci.cadsr.umlproject.domain.xsd 19 kB
    19. XML File
      groovywstest/.../ServiceSecurity.wsdl 7 kB
    20. XML File
      groovywstest/.../caGridMetadata.xsd 2 kB
    21. XML File
      groovywstest/resources/.../common/common.xsd 6 kB
    22. XML File
      groovywstest/resources/.../data/data.xsd 4 kB
    23. XML File
      groovywstest/resources/.../security.xsd 3 kB
    24. XML File
      groovywstest/resources/.../servicemodel.xsd 7 kB
    25. XML File
      groovywstest/resources/.../WS-Addressing.xsd 6 kB
    26. XML File
      groovywstest/resources/.../ws/xml.xsd 5 kB
    27. XML File
      groovywstest/.../WS-BaseFaults.wsdl 3 kB
    28. XML File
      groovywstest/resources/.../WS-BaseFaults.xsd 5 kB
    29. XML File
      groovywstest/.../WS-ResourceLifetime.wsdl 9 kB
    30. XML File
      groovywstest/.../WS-ResourceLifetime.xsd 3 kB
    Showing 30 of 66 items Download Zip
    Show
    Zip Archive
    groovywstest.zip
    30/Apr/09 2:15 PM
    110 kB
    Joel Schneider

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Guillaume ALLEON added a comment - 01/May/09 3:54 PM

Thanks for this very exhaustive bug report - your work is impressive.
I have started to address your 6 issues. A full report and solution will come in few days - as I am finalizing the fixes.

Show
Guillaume ALLEON added a comment - 01/May/09 3:54 PM Thanks for this very exhaustive bug report - your work is impressive. I have started to address your 6 issues. A full report and solution will come in few days - as I am finalizing the fixes.
Hide
Permalink
Guillaume ALLEON added a comment - 05/May/09 7:38 AM

0.5.1-SNAPSHOT has just been published for test and addresses most of these issues.
http://www.nabble.com/-ANN--GroovyWS-0.5.1-snapshots-td23386605.html

Show
Guillaume ALLEON added a comment - 05/May/09 7:38 AM 0.5.1-SNAPSHOT has just been published for test and addresses most of these issues. http://www.nabble.com/-ANN--GroovyWS-0.5.1-snapshots-td23386605.html
Hide
Permalink
Guillaume ALLEON added a comment - 29/Nov/09 8:50 AM

Solved.

Show
Guillaume ALLEON added a comment - 29/Nov/09 8:50 AM Solved.
Hide
Permalink
Tomislav Nakic-Alfirevic added a comment - 05/Jan/11 10:06 AM

The part of the issue related to enum handling does not seem to be solved as described here: http://groovy.329449.n5.nabble.com/ANN-GroovyWS-0-5-1-snapshots-td366865.html

Using gmaven and groovysh (invoked as mvn groovy:shell) I am using GroovyWS 0.5.2 and am trying to do the following:

import groovyx.net.ws.WSClient
proxy = new WSClient("http://localhost:9090/MyServicePort?wsdl", this.class.classLoader)
proxy.initialize()
t = proxy.create("my.package.MyEnumClass.specificValue")

and get the following stack trace:

x = proxy.create("my.package.MyEnumClass.specificValue")
java.lang.ClassNotFoundException: my.package.MyEnumClass.specificValue
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at groovyx.net.ws.WSClient.create(WSClient.java:134)
at groovyx.net.ws.WSClient$create.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124)
at groovysh_evaluate.run(groovysh_evaluate:4)
at groovysh_evaluate$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43)
at groovysh_evaluate$run.call(Unknown Source)
at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67)
at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source)
at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:143)
at org.codehaus.groovy.tools.shell.Groovysh$execute.callCurrent(Unknown Source)
at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114)
at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source)
at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:88)
at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266)
at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:146)
at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86)
at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1061)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:127)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:147)
at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:64)
at java_lang_Runnable$run.call(Unknown Source)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
at org.codehaus.groovy.tools.shell.Groovysh.run(Groovysh.groovy:433)
at org.codehaus.groovy.maven.runtime.v1_6.ShellFeature$DefaultTask.run(ShellFeature.java:151)
at org.codehaus.groovy.maven.runtime.v1_6.ShellFeature$ShellImpl.execute(ShellFeature.java:77)
at org.codehaus.groovy.maven.plugin.tools.ShellMojo.process(ShellMojo.java:145)
at org.codehaus.groovy.maven.plugin.ComponentMojoSupport.doExecute(ComponentMojoSupport.java:60)
at org.codehaus.groovy.maven.plugin.MojoSupport.execute(MojoSupport.java:69)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
ERROR java.lang.NullPointerException: null
at groovyx.net.ws.WSClient.create (WSClient.java:140)
at groovyx.net.ws.WSClient$create.call (Unknown Source)
at groovysh_evaluate.run (groovysh_evaluate:4)
...

I can get an instance of the class itself like so:

x = proxy.create("my.package.MyEnumClass")

but I don't think I can accomplish much with it.

I assume the issue might be reopened or a new one opened.

Show
Tomislav Nakic-Alfirevic added a comment - 05/Jan/11 10:06 AM The part of the issue related to enum handling does not seem to be solved as described here: http://groovy.329449.n5.nabble.com/ANN-GroovyWS-0-5-1-snapshots-td366865.html Using gmaven and groovysh (invoked as mvn groovy:shell) I am using GroovyWS 0.5.2 and am trying to do the following: import groovyx.net.ws.WSClient proxy = new WSClient("http://localhost:9090/MyServicePort?wsdl", this.class.classLoader) proxy.initialize() t = proxy.create("my.package.MyEnumClass.specificValue") and get the following stack trace: x = proxy.create("my.package.MyEnumClass.specificValue") java.lang.ClassNotFoundException: my.package.MyEnumClass.specificValue at java.net.URLClassLoader$1.run(URLClassLoader.java:217) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:205) at java.lang.ClassLoader.loadClass(ClassLoader.java:321) at java.lang.ClassLoader.loadClass(ClassLoader.java:266) at groovyx.net.ws.WSClient.create(WSClient.java:134) at groovyx.net.ws.WSClient$create.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:124) at groovysh_evaluate.run(groovysh_evaluate:4) at groovysh_evaluate$run.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43) at groovysh_evaluate$run.call(Unknown Source) at org.codehaus.groovy.tools.shell.Interpreter.evaluate(Interpreter.groovy:67) at org.codehaus.groovy.tools.shell.Interpreter$evaluate.call(Unknown Source) at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:143) at org.codehaus.groovy.tools.shell.Groovysh$execute.callCurrent(Unknown Source) at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:114) at org.codehaus.groovy.tools.shell.Shell$leftShift$0.call(Unknown Source) at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:88) at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrapNoCoerce.invoke(PogoMetaMethodSite.java:266) at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:51) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:146) at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:57) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:86) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:234) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1061) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:127) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:147) at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:64) at java_lang_Runnable$run.call(Unknown Source) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:43) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at org.codehaus.groovy.tools.shell.Groovysh.run(Groovysh.groovy:433) at org.codehaus.groovy.maven.runtime.v1_6.ShellFeature$DefaultTask.run(ShellFeature.java:151) at org.codehaus.groovy.maven.runtime.v1_6.ShellFeature$ShellImpl.execute(ShellFeature.java:77) at org.codehaus.groovy.maven.plugin.tools.ShellMojo.process(ShellMojo.java:145) at org.codehaus.groovy.maven.plugin.ComponentMojoSupport.doExecute(ComponentMojoSupport.java:60) at org.codehaus.groovy.maven.plugin.MojoSupport.execute(MojoSupport.java:69) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:569) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:539) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:284) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:616) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) ERROR java.lang.NullPointerException: null at groovyx.net.ws.WSClient.create (WSClient.java:140) at groovyx.net.ws.WSClient$create.call (Unknown Source) at groovysh_evaluate.run (groovysh_evaluate:4) ... I can get an instance of the class itself like so: x = proxy.create("my.package.MyEnumClass") but I don't think I can accomplish much with it. I assume the issue might be reopened or a new one opened.
Hide
Permalink
Tomislav Nakic-Alfirevic added a comment - 05/Jan/11 10:23 AM

I forgot to add:

The test cases in the attached .zip file attempt to instantiate an enum value like so:

EQUAL_TO = proxy.createEnum('gov.nih.nci.cagrid.CQLQuery.Predicate', 'EQUAL_TO')

However, this announcement (http://groovy.329449.n5.nabble.com/ANN-GroovyWS-0-5-1-snapshots-td366865.html) suggests using a different method: http://groovy.329449.n5.nabble.com/ANN-GroovyWS-0-5-1-snapshots-td366865.html

Finally, my proxy offers the following capabilities:

groovy:000> proxy.metaClass.methods*.name
===> [equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait, getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty, changeEndpointAddress, create, createClient, createClient, invokeMethod, create, initialize, setBasicAuthentication, setConnectionTimeout, setMtom, setPreferredSoapVersion, setProxyProperties, setSSLProperties]
groovy:000>

So, in other words, no createEnum(def a, def b) method and the create(def a) method doesn't seem to work.

Show
Tomislav Nakic-Alfirevic added a comment - 05/Jan/11 10:23 AM I forgot to add: The test cases in the attached .zip file attempt to instantiate an enum value like so: EQUAL_TO = proxy.createEnum('gov.nih.nci.cagrid.CQLQuery.Predicate', 'EQUAL_TO') However, this announcement (http://groovy.329449.n5.nabble.com/ANN-GroovyWS-0-5-1-snapshots-td366865.html) suggests using a different method: http://groovy.329449.n5.nabble.com/ANN-GroovyWS-0-5-1-snapshots-td366865.html Finally, my proxy offers the following capabilities: groovy:000> proxy.metaClass.methods*.name ===> [equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait, getMetaClass, getProperty, invokeMethod, setMetaClass, setProperty, changeEndpointAddress, create, createClient, createClient, invokeMethod, create, initialize, setBasicAuthentication, setConnectionTimeout, setMtom, setPreferredSoapVersion, setProxyProperties, setSSLProperties] groovy:000> So, in other words, no createEnum(def a, def b) method and the create(def a) method doesn't seem to work.
Hide
Permalink
Tomislav Nakic-Alfirevic added a comment - 22/Feb/11 8:33 AM

Please disregard my previous comment, I have managed to use enums with GroovyWS (ver.0.5.2). For anyone who might wander here looking for a prod in the right direction, the correct way to use enums with GroovyWS is as follows:

...
wsProxy = new WSClient(wsdlUrl, this.class.classLoader)
wsProxy.initialize()
def anObject = wsProxy.create("some.package.AClass")
def anEnum = wsProxy.create("some.package.AnEnum")
anObject.anEnumProperty = anEnum.AN_ENUM_VALUE
...

Show
Tomislav Nakic-Alfirevic added a comment - 22/Feb/11 8:33 AM Please disregard my previous comment, I have managed to use enums with GroovyWS (ver.0.5.2). For anyone who might wander here looking for a prod in the right direction, the correct way to use enums with GroovyWS is as follows: ... wsProxy = new WSClient(wsdlUrl, this.class.classLoader) wsProxy.initialize() def anObject = wsProxy.create("some.package.AClass") def anEnum = wsProxy.create("some.package.AnEnum") anObject.anEnumProperty = anEnum.AN_ENUM_VALUE ...

People

  • Assignee:
    Guillaume ALLEON
    Reporter:
    Joel Schneider
Vote (0)
Watch (0)

Dates

  • Created:
    30/Apr/09 2:15 PM
    Updated:
    22/Feb/11 8:33 AM
    Resolved:
    29/Nov/09 8:50 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.