Skip to content
Skip to breadcrumbs
Skip to header menu
Skip to action menu
Skip to quick search
Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Groovy
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<table class="wysiwyg-macro" data-macro-name="excerpt" data-macro-parameters="atlassian-macro-output-type=BLOCK|hidden=true" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2V4Y2VycHQ6aGlkZGVuPXRydWV8YXRsYXNzaWFuLW1hY3JvLW91dHB1dC10eXBlPUJMT0NLfQ&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>GroovySOAP replacement that uses CXF and Java5 features</p></td></tr></table><table class="wysiwyg-macro" data-macro-name="note" data-macro-parameters="title=Be Careful" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e25vdGU6dGl0bGU9QmUgQ2FyZWZ1bH0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"><p>Due to low availability the project is currently dormant, you might consider <a href="https://github.com/jwagenleitner/groovy-wslite">groovy-wslite</a> as a replacement module</p></td></tr></table><h1>Module Overview</h1><p>If you need to quickly consume and/or publish WS-I compliant <a href="http://www.w3schools.com/webservices/default.asp">web services</a>, GroovyWS can help you.</p><h1>Installation</h1><p>If you are online and using the <a href="http://groovy.codehaus.org/Download">latest groovy</a> version, here is the no-brainer way to use GroovyWS:</p><table class="wysiwyg-macro" data-macro-name="code" data-macro-default-parameter="java" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGU6amF2YX0&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>@Grab(group='org.codehaus.groovy.modules', module='groovyws', version='0.5.2') import groovyx.net.ws.WSClient proxy = new WSClient("http://www.w3schools.com/webservices/tempconvert.asmx?WSDL", this.class.classLoader) proxy.initialize() result = proxy.CelsiusToFahrenheit(0) println "You are probably freezing at ${result} degrees Farhenheit" </pre></td></tr></table><p><img class="emoticon emoticon-warning" data-emoticon-name="warning" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/warning.png" alt="(warning)" title="(warning)" /> Make sure to have the correct <a class="confluence-link" href="/display/GROOVY/GroovyWS+grape+config+file" data-linked-resource-id="120258808" data-linked-resource-type="page" data-linked-resource-default-alias="GroovyWS grape config file" data-base-url="http://docs.codehaus.org">GroovyWS grape config file</a><br /> <img class="emoticon emoticon-warning" data-emoticon-name="warning" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/warning.png" alt="(warning)" title="(warning)" /> Make sure that you have javac in your path - this is required for automatic generation of the classes on the client side<br /> <img class="emoticon emoticon-warning" data-emoticon-name="warning" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/warning.png" alt="(warning)" title="(warning)" /> Groovy 1.6.3 relies on Ivy 2.0 which has problem computing some dependencies checksums - if you experience this problem, you have to either download a Groovy snapshot or upgrade Ivy to version 2.1.0 (or above) in your $GROOVY_HOME directory.</p><p>If you need more control, see the <a class="confluence-link" href="/display/GROOVY/GroovyWS+installation" data-linked-resource-id="120258773" data-linked-resource-type="page" data-linked-resource-default-alias="GroovyWS installation" data-base-url="http://docs.codehaus.org">GroovyWS installation</a> notes.</p><h1>Getting Started</h1><p>GroovyWS comes with two sets of APIS that are briefly described below using a simple example.</p><ul><li><a class="confluence-link" href="/display/GROOVY/Publishing+a+web-service" data-linked-resource-id="120258717" data-linked-resource-type="page" data-linked-resource-default-alias="Publishing a web-service" data-base-url="http://docs.codehaus.org">Publishing a web-service</a></li><li><a class="confluence-link" href="/display/GROOVY/Consuming+a+web+service" data-linked-resource-id="120258720" data-linked-resource-type="page" data-linked-resource-default-alias="Consuming a web service" data-base-url="http://docs.codehaus.org">Consuming a web service</a></li></ul><p>When your service is using groovy beans on the server side, you may want to control the fields that are serialized. This is done using a small xml file located next to your script. A small example is demonstrating this:</p><ul><li><a class="confluence-link" href="/display/GROOVY/Using+the+Aegis+mapping" data-linked-resource-id="120258729" data-linked-resource-type="page" data-linked-resource-default-alias="Using the Aegis mapping" data-base-url="http://docs.codehaus.org">Using the Aegis mapping</a></li></ul><p>When consuming a web service, you may also be using some complex types. Those types are automatically generated from the WSDL, compiled and made available via your classloader. The client API is providing you a method to easily instantiate such a complex object from its name. Obviously, knowing the class name can be difficult when using a complex web service and may require to study the contract (WSDL). In order to help the user, GroovyWS is logging the names of the classes generated on the fly.</p><ul><li><a class="confluence-link" href="/display/GROOVY/Using+the+client+with+complex+objects" data-linked-resource-id="120258736" data-linked-resource-type="page" data-linked-resource-default-alias="Using the client with complex objects" data-base-url="http://docs.codehaus.org">Using the client with complex objects</a></li></ul><p>The client side integrates seamlessly with <a href="http://www.grails.org">Grails</a> applications.</p><ul><li><a class="confluence-link" href="/display/GROOVY/Using+WSClient+in+Grails" data-linked-resource-id="120258802" data-linked-resource-type="page" data-linked-resource-default-alias="Using WSClient in Grails" data-base-url="http://docs.codehaus.org">Using WSClient in Grails</a></li><li><a class="confluence-link" href="/display/GROOVY/Using+the+Grails+XFire+plugin+and+GroovyWS" data-linked-resource-id="120258786" data-linked-resource-type="page" data-linked-resource-default-alias="Using the Grails XFire plugin and GroovyWS" data-base-url="http://docs.codehaus.org">Using the Grails XFire plugin and GroovyWS</a></li><li><a class="confluence-link unresolved" data-content-title="Using the Grails Axis2 plugin and GroovyWS" data-linked-resource-default-alias="Using the Grails Axis2 plugin and GroovyWS" href="#">Using the Grails Axis2 plugin and GroovyWS</a></li></ul><p>You can also used secured web-services with GroovyWS. If you wish to do so check <a class="confluence-link" href="/display/GROOVY/Using+WS-Security" data-linked-resource-id="134840627" data-linked-resource-type="page" data-linked-resource-default-alias="Using WS-Security" data-base-url="http://docs.codehaus.org">Using WS-Security</a>.</p><p>There exists a lot of public web services. We provide two examples that show how easy it is to use GroovyWS to tap on these resources.</p><ul><li><a class="confluence-link" href="/display/GROOVY/Currency+rate+calculator" data-linked-resource-id="120258739" data-linked-resource-type="page" data-linked-resource-default-alias="Currency rate calculator" data-base-url="http://docs.codehaus.org">Currency rate calculator</a></li><li><a class="confluence-link" href="/display/GROOVY/TerraServer-USA+by+Microsoft" data-linked-resource-id="120258743" data-linked-resource-type="page" data-linked-resource-default-alias="TerraServer-USA by Microsoft" data-base-url="http://docs.codehaus.org">TerraServer-USA by Microsoft</a></li></ul><p>More <a class="confluence-link" href="/display/GROOVY/WSClient+configuration" data-linked-resource-id="120258771" data-linked-resource-type="page" data-linked-resource-default-alias="WSClient configuration" data-base-url="http://docs.codehaus.org">WSClient configuration</a> is available if you need to use proxies, basic authentication and security related features.</p><p>The <a href="http://groovy.codehaus.org/modules/groovyws/docs/javadoc/">javadoc</a> is probably the ultimate place to the missing bits. If you are missing a feature email us <a href="mailto:user@groovy.codehaus.org">user@groovy.codehaus.org</a>.</p><p>CXF is generating tons of logging information. If you want to reduce the amount of information, you need to set the <strong>-Djava.util.logging.config.file</strong> property.</p><h1>Articles</h1><ol><li>A nice article from Geertjan's blog with several examples: <a href="http://blogs.sun.com/geertjan/entry/groovy_web_service">http://blogs.sun.com/geertjan/entry/groovy_web_service</a></li><li>An article explaining the difference between the different WSDL styles <a href="http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/">http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/</a></li></ol><h1>They use GroovyWS</h1><p>If you use GroovyWS, please let us know and feel free too add a quote in this section.</p><h1>Community</h1><ul><li><a href="http://svn.codehaus.org/gmod/groovyws">Source repository </a></li></ul><ul><li><p>The build process is using <a href="http://www.gradle.org">gradle</a>. In order to build the sources from svn, just run:</p><table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> ./gradlew </pre></td></tr></table><p>in the directory containing the source tree.</p></li></ul><ul><li>Feel free to contribute by testing, giving your feedback, <a href="http://jira.codehaus.org/secure/IssueNavigator.jspa?reset=true&mode=hide&pid=11901&sorter/order=DESC&sorter/field=priority&resolution=-1&component=13623">reporting bugs</a> and sending patches.</li></ul>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced