Web Service with XFIRE

i will mention about writng web service using xfire. if you have spring knowledge, it will be quite easy to read and understand how to open your pojo as a web service.

But first of all, i should clarify about pros and cons of using xfire.then, i will show 4 critical steps.

Last version of xfire is, 1.2.6(released at may 3 2007) and you can download from here

Support for important Web Service standards – SOAP, WSDL, WS-I Basic Profile, WS-Addressing, WS-Security, etc.
High performance SOAP Stack
Pluggable bindings POJOs, XMLBeans, JAXB 1.1, JAXB 2.0, and Castor support
JSR 181 API to configure services via Java 5 and 1.4 (Commons attributes JSR 181 syntax)
Support for many different transports – HTTP, JMS, XMPP, In-JVM, etc.
Embeddable and Intuitive API
Spring, Pico, Plexus, and Loom support. (Demo will come with spring integration)
JBI Support
Client and server stub generation
JAX-WS early access support
Disadvantage is, you do not have a test suit or test screen after you write your code. You should write your own test code, or you should use soap-ui to test your web service.
As compared to weblogics servicegen, this is worse , since when you write your web service with servicegen and deploy it on weblogic you will have a test screen. (By the way you cannot use this for stress testing.)

1. On your web.xml file you will specify your servlet name. (in this case localization)
2. You will have a X-servlet.xml file, to specify this servlets properties.(X=localization)(This is spring containers rule)
3. in your servlet properties file you will specify which bean you will use as service.
4.You will put this bean and inject in application-context.xml file.

You will deploy your application as a web arcihve(.war file) , You should include xfire.jar and dependend related jars into your WEB-INF/lib folder.
If you do not include them, after deployment you will give HTTP 500 (Internal Server Error) with the exception Class Not Found Exception.

After deployment you can user this url to take your web services wsdl ,

http://yourip.yourport/servletName/services?wsdl

http://yourip.yourport/servletName/services is your service url.

  • Share/Bookmark

About this entry