开发者

How to use xfire plugin in Spring Security based application developed with Grails Spring framework?

I have developed a small application in Grails by using Spring Security plug in and it's working fine.

Now I want to make it a web service. By searching the web I found xfire plug in and installed it in my app and followed instructions as:

Made copied login controller code in login service and used static expose=['xfire']. When I run app getting wsdl code in browser, I am not understa开发者_如何学Pythonnding what to do next?


If you're getting wsdl code in your browser, then you're all set. All the METHODS in the service class (not closures, methods) will be accessible as webservice methods.

For example, if your service was called "MyService", like:

class MyService {
   static expose=['xfire']

   public String reverse( String inp ) { return inp.reverse(); }
}

Now, someone can create a webservice client from your wsdl (http://yourhost/yourcontext/services/my?WSDL), and that client should be able to use the method "reverse", passing it a String, and getting the reversed String as the result.

If you'd like to know how to set up the web service client that USES your webservice. Check out groovyWS or CXF.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜