JBoss Community

Re: Jboss Native - EJB based Webservice top down approach

created by Jason Shepherd in JBoss Web Services - View the full discussion

If you are top-down development of a web service, from an existing WSDL, you should use the documentation [0], to generate the webservice. Then if you are trying to deploy that webservice as a war file, you should use the webservice annotations on your web service implementation like below [1].

 

Some people have had trouble getting their namespaces to work without specifying the "wsdlLocation" attribute of the WebSerivce annotation. In that case you will need to place the generated WSDL in /WEB-INF/wsdl/ and reference it like this:


@WebService( name="ExampleService",      targetNamespace="http://www.jboss.com/exampe/ws",      wsdlLocation="/WEB-INF/wsdl/generated.wsdl")

 

 

[0] http://docs.jboss.org/jbossas/docs/Administration_And_Configuration_Guide/5/html_single/index.html#d0e1664

 

[1]

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

 


@WebService(name = "ExampleService", targetNamespace = "http://www.jboss.com/example/ws",
        wsdlLocation="/WEB-INF/wsdl/generated.wsdl")
public class Echo {

 

    @WebMethod
    public String echo(
        @WebParam(name = "msg")
        String msg){
            return msg;
    }

 

}

Reply to this message by going to Community

Start a new discussion in JBoss Web Services at Community