[jboss-user] [JBoss Seam] - Seam and Web Services

modoc do-not-reply at jboss.com
Mon Mar 12 01:07:42 EDT 2007


I was trying to expose some methods on a Seam component as web services using the @WebMethod annotations as per the JBoss WS documentation.  It almost worked, except that the web service called a non-instantiated class, so all the seam stuff didn't work.  Which makes sense.  (It's my first time making a web service).

At any rate, I then tried using the following code:


  | Class[] args1 = new Class[2];
  |         args1[0] = String.class;
  |         args1[1] = String.class;
  |         String[] zipsArray = new String[2];
  |         zipsArray[0] = pZip1;
  |         zipsArray[1] = pZip2;
  |         Component comp = Seam.componentForName("carbonCalculator");
  |         Double cost = 0.0;
  |         try {
  |             cost = (Double) comp.callComponentMethod(comp, CarbonCalculator.class.getMethod("calculateCost", args1),
  |                     (Object[]) zipsArray);
  |         } catch (SecurityException e) {
  |             // TODO Auto-generated catch block
  |             e.printStackTrace();
  |         } catch (NoSuchMethodException e) {
  |             // TODO Auto-generated catch block
  |             e.printStackTrace();
  |         }
  |         return cost;
  | 


I kept getting a no such method error.  The method exists on the seam component.  

Anyway, I didn't know if there were any examples or documentation or approaches for exposing seam component's as web services?  For the time being I have a non-seam copy of the code to support the web service, but that's clearly a bad approach.

Ideas?

Thanks!

Devon

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

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



More information about the jboss-user mailing list