{"id":50389585,"url":"https://github.com/grails-plugins/grails-cxf","last_synced_at":"2026-05-30T17:30:57.917Z","repository":{"id":782440,"uuid":"474954","full_name":"grails-plugins/grails-cxf","owner":"grails-plugins","description":"CXF Plugin for the Grails web framework","archived":false,"fork":false,"pushed_at":"2026-05-28T16:52:25.000Z","size":33073,"stargazers_count":38,"open_issues_count":12,"forks_count":48,"subscribers_count":9,"default_branch":"5.0.x","last_synced_at":"2026-05-28T18:23:23.559Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Groovy","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grails-plugins.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2010-01-16T14:44:57.000Z","updated_at":"2026-05-28T16:52:31.000Z","dependencies_parsed_at":"2022-07-05T14:31:26.126Z","dependency_job_id":null,"html_url":"https://github.com/grails-plugins/grails-cxf","commit_stats":null,"previous_names":["grails-plugins/grails-cxf"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/grails-plugins/grails-cxf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grails-plugins%2Fgrails-cxf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grails-plugins%2Fgrails-cxf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grails-plugins%2Fgrails-cxf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grails-plugins%2Fgrails-cxf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grails-plugins","download_url":"https://codeload.github.com/grails-plugins/grails-cxf/tar.gz/refs/heads/5.0.x","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grails-plugins%2Fgrails-cxf/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33703064,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-05-30T17:30:57.475Z","updated_at":"2026-05-30T17:30:57.911Z","avatar_url":"https://github.com/grails-plugins.png","language":"Groovy","funding_links":[],"categories":[],"sub_categories":[],"readme":"Grails CXF Plugin\n=========\n\nThe 3.x branch of the plugin is a grails plugin that contains simplified features to get simple soap endpoints exposed in grails 3 applications.\n\nGetting Started\n-----------\n\nAt the core, this plugin is a simple wrapper for geeting grails service classes wired up as direct soap endpoints.  As many of the previous features from the 2.x branch as could be ported for the initial release were ported.  There will be continued support added for the more complex CXF features going forward.\n \nBasic Usage\n---------\n\nExposing a service class is as simple as adding the `GrailsCxfEndpoint` annotation and annotating the methods you wish to expose in the service with `WebMethod` and `WebResult`\n\n```\npackage com.gpc.demo\n\nimport grails.transaction.Transactional\nimport org.grails.cxf.utils.GrailsCxfEndpoint\n\nimport javax.jws.WebMethod\nimport javax.jws.WebResult\n\n@Transactional\n@GrailsCxfEndpoint\nclass DemoService {\n\n    @WebMethod\n    @WebResult\n    String demoMethod() {\n        return \"demo\"\n    }\n}\n```\n\nReturning Domain Classes\n----\n\nIf you wish to return domain classes you will need to make sure to add the xml annotations to the domain class.\n\n```\npackage org.grails.cxf.test.example\n\nimport grails.transaction.Transactional\nimport org.grails.cxf.utils.GrailsCxfEndpoint\n\nimport javax.jws.WebMethod\nimport javax.jws.WebParam\nimport javax.jws.WebResult\n\n@Transactional\n@GrailsCxfEndpoint\nclass PersonService {\n\n\t@WebMethod\n\t@WebResult(name = \"Person\", targetNamespace = \"\")\n\tPerson createPerson(@WebParam(name = 'name') String name) {\n\t\tPerson.findOrSaveByName(name)\n\t}\n}\n```\n\n```\npackage org.grails.cxf.test.example\n\nimport javax.xml.bind.annotation.XmlAccessType\nimport javax.xml.bind.annotation.XmlAccessorType\nimport javax.xml.bind.annotation.XmlElement\n\n@XmlAccessorType(XmlAccessType.NONE)\nclass Person {\n\n    @XmlElement\n    Long id\n\n    @XmlElement\n    String name\n\n    static constraints = {\n        name nullable: false, blank: false\n    }\n}\n```\n\nCustom Interceptors\n-----\n\nDo add a custom interceptor you should define an bean in your application or imported config class.  The reference to the logging interceptor is the name of the defined bean.\n \n```\npackage org.grails.cxf.test.soap.interceptor\n\nimport org.apache.cxf.common.injection.NoJSR250Annotations\nimport org.apache.cxf.common.logging.LogUtils\nimport org.apache.cxf.interceptor.AbstractLoggingInterceptor\nimport org.apache.cxf.interceptor.Fault\nimport org.apache.cxf.message.Message\nimport org.apache.cxf.phase.Phase\nimport org.springframework.beans.factory.annotation.Autowired\n\nimport java.util.logging.Logger\n\n/**\n */\n@NoJSR250Annotations\nclass CustomLoggingInInterceptor extends AbstractLoggingInterceptor {\n\n    private static final Logger LOG = LogUtils.getLogger(CustomLoggingInInterceptor)\n    def name\n\n    CustomLoggingInInterceptor() {\n        super(Phase.RECEIVE)\n        log LOG, 'Creating the custom interceptor bean'\n    }\n\n    void handleMessage(Message message) throws Fault {\n        //get another web service bean here by name and call it\n\n        //Check to see if cxf annotations will inject the bean (looks like no!)\n        log LOG, injectedBean?.name ?: 'FAIL - NOT SET'\n        log LOG, \"$name :: I AM IN CUSTOM IN LOGGER!!!!!!!\"\n    }\n\n    @Override\n    protected Logger getLogger() {\n        LOG\n    }\n}\n```\n\n```\npackage grails.cxf.demo\n\nimport grails.boot.GrailsApp\nimport grails.boot.config.GrailsAutoConfiguration\nimport org.grails.cxf.test.soap.interceptor.CustomLoggingInInterceptor\nimport org.springframework.context.annotation.Bean\nimport org.springframework.context.annotation.ImportResource\n\nclass Application extends GrailsAutoConfiguration {\n    static void main(String[] args) {\n        GrailsApp.run(Application, args)\n    }\n\n    @Bean\n    public CustomLoggingInInterceptor customLoggingInInterceptor(){\n        return new CustomLoggingInInterceptor(name: 'injected value')\n    }\n}\n```\n\n```\npackage org.grails.cxf.test.example\n\nimport grails.transaction.Transactional\nimport org.grails.cxf.utils.GrailsCxfEndpoint\n\nimport javax.jws.WebMethod\nimport javax.jws.WebParam\nimport javax.jws.WebResult\n\n@Transactional\n@GrailsCxfEndpoint(inInterceptors = ['customLoggingInInterceptor'])\nclass PersonService {\n\n\t@WebMethod\n\t@WebResult(name = \"Person\", targetNamespace = \"\")\n\tPerson createPerson(@WebParam(name = 'name') String name) {\n\t\tPerson.findOrSaveByName(name)\n\t}\n}\n```\n\nSERVLET MAPPING\n---------\nThe default behavior is to expose the CxfServlet at the `/services/*` endpoint.  If you with to override this behavior you can set the following config:\n\n```yml\ncxf:\n    servlet:\n        mapping: /webservices/*\n```\n\nEXPOSING CLASSES VIA ANNOTATION\n-----------------\nWhen using the annotation, the property values will only be used if the corresponding annotation value is not provided or is set to the default value.  The following are available to configure via the annotation:\n\n```groovy\n/**\n * Annotation to be use to expose a Service or Endpoint class as a CXF Service via Grails.\n */\n@Retention(RetentionPolicy.RUNTIME)\n@Target(ElementType.TYPE)\n@interface GrailsCxfEndpoint {\n    String address() default ''\n    String name() default ''\n    EndpointType expose() default EndpointType.JAX_WS\n    boolean soap12() default false\n    String wsdl() default ''\n    //Interceptors\n    String[] inInterceptors() default []\n    String[] outInterceptors() default []\n    String[] inFaultInterceptors() default []\n    String[] outFaultInterceptors() default []\n    GrailsCxfEndpointProperty[] properties() default []\n}\n\n@Target(ElementType.METHOD)\n@interface GrailsCxfEndpointProperty {\n    public String name() default ''\n    public String value() default ''\n}\n\n```\n\n**ADDRESS**\n\nThe address property is used to adjust the endpoint address that the service will be deployed to.  By default if not provided or is the value is empty (\"\"), this will be the name of the Service or Endpoint with the first letter lowercase and the word Endpoint or Service removed from the end of the name.  The default behavior would deploy the `BoatService` as `/services/boat`.\n\nIf you wish to override this and provide your own service name or address (for versioning support for example) you may set this value.\n\n```groovy\n@GrailsCxfEndpoint(address='/v2/custom/path')\nclass CarService {\n    ...\n}\n```\n\nThe above would be deployed to `/services/v2/custom/path`.\n\n**EXPOSE**\n\nThe `expose` property will tell the plugin how you wish to expose.  The default is `EndpointType.JAX_WS` which is the same as the following:\n\n```groovy\n@GrailsCxfEndpoint(expose=EndpointType.JAX_WS)\nclass CarService {\n    ...\n}\n```\n\nSimple and JaxRS types are currently not supported.  *TODO*\n\n**NAME**\n\nThe `name` property will tell the plugin how you wish to name the service.  This will change the wsdl name property from the default for the example below from `CarService` to simply just `Car` like this `\u003cwsdl:definitions name=\"Car\" targetNamespace=\"http://demo.gpc.com\"\u003e`\n\n```groovy\n@GrailsCxfEndpoint(name='Car')\nclass CarService {\n    ...\n}\n```\n\n**PORT**\n\nThe `port` property will tell the plugin how you wish to name the service port binding.  This will change the wsdl name property of the port from the default for the example below from `CarServicePort` to simply just `CarPort` like this `\u003cwsdl:port binding=\"tns:CarServiceSoapBinding\" name=\"CarPort\"\u003e`\n\n```groovy\n@GrailsCxfEndpoint(port='CarPort')\nclass CarService {\n    ...\n}\n```\n\n**SOAP12**\n\nTo tell a service to default to SOAP 1.2 instead of 1.1 simply set this to `true`. The default value is `false` which will use SOAP 1.1.\n\n```groovy\n@GrailsCxfEndpoint(soap12=true)\nclass CarService {\n    ...\n}\n```\n\n**WSDL**\n\nTo expose as a wsdl first jax web service endpoint \u003chttp://cxf.apache.org/docs/jax-ws-configuration.html\u003e add the wsdl property and classpath to the wsdl as well as setting the endpoint type to `EndpointType.JAX_WS_WSDL`.\n\n```groovy\n@WebService(name = 'CustomerServiceWsdlEndpoint',\ntargetNamespace = 'http://test.cxf.grails.org/',\nserviceName = 'CustomerServiceWsdlEndpoint',\nportName = 'CustomerServiceWsdlPort')\n@GrailsCxfEndpoint(wsdl = 'org/grails/cxf/test/soap/CustomerService.wsdl', expose = EndpointType.JAX_WS_WSDL)\nclass AnnotatedCustomerServiceWsdlEndpoint {\n\n    CustomerServiceEndpoint customerServiceEndpoint\n\n    List\u003cCustomer\u003e getCustomersByName(final String name) {\n        customerServiceEndpoint.getCustomersByName(name)\n    }\n}\n```\n\nExample *TODO* \n\n\u003ca name=\"interceptors\"\u003e\u003c/a\u003e\n**ININTERCEPTORS**\n\nThis is a list of bean names in `List\u003cString\u003e` to inject to the cxf service endpoint.  You will need to define your interceptor beans via normal spring dsl (in resources.groovy for example).\n\nThis is helpful when the default cxf annotation of `@org.apache.cxf.interceptor.InInterceptors (interceptors = {\"com.example.Test1Interceptor\" })` does not satisfy your needs.\n\nWhen chosing between the this property and the cxf provided one, if you require value injection, the cxf provided annotation will most likely **NOT** meet your needs and you should use this property instead.\n\n*Note: Make sure to set any beans you wish injected into your interceptors to `bean.autowire = 'byName'` or use the `@Autowire` annotation.*\n\n**OUTINTERCEPTORS**\n\nIf you wish to inject a custom in interceptor bean, use this property.  This is helpful when the default cxf annotation of `@org.apache.cxf.interceptor.OutInterceptors (interceptors = {\"com.example.Test1Interceptor\" })` does not satisfy your needs.\n\nSee above for examples of using inInterceptor which should be very similar.\n\n**INFAULTINTERCEPTORS**\n\nIf you wish to inject a custom in interceptor bean, use this property.  This is helpful when the default cxf annotation of `@org.apache.cxf.interceptor.InFaultInterceptors (interceptors = {\"com.example.Test1Interceptor\" })` does not satisfy your needs.\n\nSee above for examples of using inInterceptor which should be very similar.\n\n**OUTFAULTINTERCEPTORS**\n\nIf you wish to inject a custom in interceptor bean, use this property.  This is helpful when the default cxf annotation of `@org.apache.cxf.interceptor.OutFaultInterceptors (interceptors = {\"com.example.Test1Interceptor\" })` does not satisfy your needs.\n\nSee above for examples of using inInterceptor which should be very similar.\n\n**CONCLUSION**\n\nUsing the annotation will help reduce the clutter of having many static properties in your class to configure cxf.\n\n\nDemo Project\n---------\nhttps://github.com/Grails-Plugin-Consortium/grails-cxf-demo\n\nLICENSE\n---------------\n\nCopyright 2013 Christian Oestreich\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrails-plugins%2Fgrails-cxf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrails-plugins%2Fgrails-cxf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrails-plugins%2Fgrails-cxf/lists"}