[jboss-user] [JBossWS] - Re: New to WS... Need help...

PeterJ do-not-reply at jboss.com
Tue May 27 11:53:53 EDT 2008


Try something simpler. The web service (class only, no interface):

import javax.ejb.Stateless;
  | import javax.jws.WebMethod;
  | import javax.jws.WebService;
  | import javax.jws.soap.SOAPBinding;
  | 
  | @Stateless
  | @WebService
  | @SOAPBinding(style = SOAPBinding.Style.RPC)
  | public class ProfileMgmtBean {
  | 	@WebMethod
  | 	public int summ(int a, int b){
  | 		return a+b;
  | 	}
  | }

Compile that, place in jar, and deploy it. Then use wsconsume to generate the client stubs. The client:

public class WSClient {
  |   public static void main(String[] args) {
  |     ProfileMgmtBeanService svc = new ProfileMgmtBeanService();
  |     ProfileMgmtBean inst = svc.getProfileMgmtBeanPort();
  |     System.out.println("And summ = " + inst.summ(1, 1));
  |   }
  | }

Compile the client along with the stubs generated by wsconsume. Then use wsrunclient to run it.

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

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



More information about the jboss-user mailing list