[jboss-user] [JBoss Web Services] - Unable to deploy a simple web service with WebServiceProvider annotation

raits do-not-reply at jboss.com
Fri Feb 4 06:25:17 EST 2011

raits [http://community.jboss.org/people/raits] created the discussion

"Unable to deploy a simple web service with WebServiceProvider annotation"

To view the discussion, visit: http://community.jboss.org/message/585470#585470

Hello, I'm trying to build a simple web service using javax.xml.ws.WebServiceProvider. The code compiles fine and no errors are reported while deploying in JBoss but when I try to load the wsdl I get an error message stating the class isn't a servlet.

The code for the provider itself:
package org.raits;
import java.io.StringWriter;
import javax.servlet.http.HttpServlet;
import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.ws.Provider;
import javax.xml.ws.ServiceMode;
import javax.xml.ws.WebServiceProvider;
@WebServiceProvider(wsdlLocation = "WEB-INF/Test.wsdl")
public class TestService implements Provider<Source>{
    public Source invoke(Source request) {
            StringWriter requestXmlWriter = new StringWriter();
            Transformer trans = TransformerFactory.newInstance().newTransformer();
            trans.transform(request, new StreamResult(requestXmlWriter));
        }catch(Exception e){
        return null;

And I'm mapping it my web.xml file as follows:



I'm also using a fairly old JBoss build (Release ID: JBoss [Zion] 4.0.4.GA (build: CVSTag=JBoss_4_0_4_GA date=200605151000)), which I can't upgrade due to the rest of the system tied into it. A regular @WebService worked just fine using this method, am I missing something in the setup?

Any help would be greatly appreciated.

Thank you in advance

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110204/11f6b18b/attachment.html 

More information about the jboss-user mailing list