[jboss-user] [JBoss jBPM] - Consuming webservice in jBPM JPDL (Eclipse)

chrlyck do-not-reply at jboss.com
Tue Sep 9 04:06:49 EDT 2008


Hi guys

Starting to get better at this stuff - i have a really annoying problem with consuming webservices in jBPM though.

Until now i have been making processes calling internal stuff, and using a lot of examples.

My first step into the real world is consuming a webservice.

I made the webservice myself, its a simple java webservice adding two numbers together. I have tested it by implementing a client in NetBeans IDE 6.1, and it works like a charm. I have copied the code to jBPM and made a simple process executing it.

To make things even more simple i have put the webservices code in the same package as the client itself, i was unsure whether it actually deployed the files...

Here it is:

package com.sample.action;
  | 
  | import org.apache.commons.logging.Log;
  | import org.apache.commons.logging.LogFactory;
  | import org.jbpm.graph.def.ActionHandler;
  | import org.jbpm.graph.exe.ExecutionContext;
  | 
  | public class isbncheck implements ActionHandler {
  | 
  |   private static final long serialVersionUID = 1L;
  |   
  |   public void execute(ExecutionContext executionContext) throws Exception 
  |   {
  |       String msg;
  |       try
  |       {
  |           log.info("##############################");
  |           log.info("Debug:1");
  |           CalculatorWSService service = new CalculatorWSService();
  |           log.info("Debug:2");
  |           CalculatorWS port = service.getCalculatorWSPort(); //TODO: Error - wtf?
  |           log.info("Debug:3");
  |           int i = 3;
  |           int j = 400000;
  |           int result = port.add(i, j);
  |           msg = "Result = "+result;
  |       }
  | 	  catch (Exception ex) 
  | 	  {
  | 		  msg = "Error: " + ex.getMessage();
  | 	  }
  | 	  log.info(msg);
  | 	  log.info("##############################");
  | 	  executionContext.leaveNode();
  |   }
  | 
  |   private static final Log log = LogFactory.getLog(isbncheck.class);
  | }

When running this, my webserver (tomcat 6) sends the following output.

anonymous wrote : 09:42:45,912 INFO  [isbncheck] ##############################
  | 09:42:45,912 INFO  [isbncheck] Debug:1
  | 09:42:45,943 INFO  [isbncheck] Debug:2
  | 09:42:45,975 INFO  [isbncheck] Error: Cannot load service endpoint interface: com.sample.action.CalculatorWS
  | 09:42:45,975 INFO  [isbncheck] ##############################

As you might have guessed by the name of the class i have tried with another webservice with the same error (an ISBN check webservice). In both cases i can create the service, but when calling the service.get*Whatever*Port() i get the error. I've been googling like a mad-man but nobody seems to have this problem, so what am i doing wrong?

Btw. i'm sure it's a simple question, but how do i do the "printstacktrace" to the webserver console so i can see the full error?

Thanks in advance.

Nibe

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

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



More information about the jboss-user mailing list