[jboss-user] [JBossWS] - wsconsume and implementing interface top-down

delicjapatrycja do-not-reply at jboss.com
Wed Aug 5 08:04:17 EDT 2009


Hi
(It's my first post, I was trying to find something about my problem but I couldn't )

I have some problem with deploy my Jax WS Web service.
I'm trying to do this using top-down method - wsconsume. When I generate java classes from WSDL which I have written before, I get one which is the interface. 
How should I implement it  ? 
How should I write the web.xml ? which class name should I write inside <servlet-class> </servlet-class> tags ? 

If i write the generated class name, how jax-ws knows where (in which java class) is implementing class ? 
If I write the class name inside, which impelements generated interface, I can't deploy the web service. (maybe I do something wrong?)


part of Service class generated by Jax-WS:

  | // [...]
  | @WebService(name = "XXXService", targetNamespace = "http://xxx.com/XXX/ws")
  | public interface XXXService {
  | 
  | 
  |     /**
  |      * 
  |      * @param in
  |      * @return
  |      *     returns int
  |      * @throws Method1FaultMsg
  |      */
  |     @WebMethod
  |     @WebResult(name = "out", targetNamespace = "")
  |     @RequestWrapper(localName = "method1", targetNamespace = "http://xxx.com/XXX/ws", className = "com.xxx.xxx.ws.Method1")
  |     @ResponseWrapper(localName = "method1Response", targetNamespace = "http://xxx.com/xxx/ws", className = "com.xxx.xxx.ws.Method1Response")
  |     public int method1(
  |         @WebParam(name = "in", targetNamespace = "")
  |         int in)
  |         throws Method1FaultMsg
  |     ;
  | // [...]
  | 
  | 

My implementation class:


  | 
  | public class XXXServiceImpl implements com.xxx.xxx.ws.XXXService {
  | 
  | 	
  | 	 @WebMethod
  | 	    @WebResult(name = "out", targetNamespace = "")
  | 	    @RequestWrapper(localName = "method1", targetNamespace = "http://xxx.com/xxx/ws", className = "com.xxx.xxx.ws.Method1")
  | 	    @ResponseWrapper(localName = "method1Response", targetNamespace = "http://xxx.com/xxx/ws", className = "com.xxx.xxx.ws.Method1Response")
  | 	    public int method1(int in) throws Method1FaultMsg
  | 	{
  | 		try 
  | 		{
  | 			return in*2;
  | 		}
  | 		catch(Exception e)
  | 		{
  | 			new Method1FaultMsg("Server Exception", new ServerException(), e);
  | 		}
  | 		return in;
  | 	}
  | 
  | 

Any tips? 

Anyway, sorry for my English :/

View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4248099#4248099

Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4248099



More information about the jboss-user mailing list