Sunday, 20 November 2011

Grails + CXF Example - Contract First WSDL

There is an excellent tutorial for doing contract first WSDL with CXF in grails here:
http://docs.codehaus.org/pages/viewpage.action?pageId=85983334

After a bit of mucking about I managed to improve it slightly.

Still couldn't get the cxf simpleBean tag to allow injection of grails services - it works but the resultant service fails with errors like:


[Namespace] [method] was not recognized.  (Does it exist in service WSDL?)</faultstring></soap:Fault></soap:Body></soap:Envelope>"

I think this is because spring / grails is proxying the beans set up in resources.xml so the object passed to simpleServer does not have the annotation necessary to publish the webservice.  Found this:
http://www.techper.net/2009/12/03/cxf-method-not-found-when-further-annotated/

Anyway, the solution is to not use simpleServer and do it yourself in Bootstrap as follows:
1) Inject the grails service that implements the web service into bootstrap
2) start the web service in Bootstrap init:


        System.out.println("Starting Security WebService");
        Object implementor = injectedService
        String address = "/serviceAddress";
        Endpoint.publish(address, implementor);
    }



Thursday, 3 November 2011

Git Command - Including Deleting Remote Branch

Handy site to remember git commands:
http://gitref.org

The daddy of refs:
http://progit.org/book

A non obvious command to delete a remote branch.

First do git branch -d [branchName] locally
Then: git push origin :[branchName]

This is based on refspecs - doco for which is can be found here:
http://progit.org/book/ch9-5.html

Basically this is saying push an empty reference to [branchName] on the remote system.  That has the effect of deleting it.