[jboss-user] [EJB 3.0] - Webservice error

z_idane do-not-reply at jboss.com
Fri May 22 02:45:25 EDT 2009


Hi,
I am trying to extend a stateless sesssion bean BookSearchActionService to webservice.
After deploying, when i try to invoke the webserice. I get following error.

java.lang.IllegalArgumentException: Wrong target. class webservices.action.BookSearchActionService for public webservices.beans.Book[] webservices.action.BookSearchActionService.searchBooks(java.lang.String)

Here is my SLB code


  | package webservices.action;
  | 
  | import java.util.ArrayList;
  | 
  | import javax.ejb.Stateless;
  | import javax.jws.WebMethod;
  | import javax.jws.WebService;
  | import javax.jws.soap.SOAPBinding;
  | import javax.jws.soap.SOAPBinding.ParameterStyle;
  | import javax.jws.soap.SOAPBinding.Style;
  | import javax.jws.soap.SOAPBinding.Use;
  | import javax.persistence.EntityManager;
  | import javax.persistence.PersistenceContext;
  | 
  | import webservices.beans.Book;
  | @Stateless
  | @WebService(name="booksearch",
  | 		serviceName="booksearch",
  | 		targetNamespace="URN:ejbmodule.bookserch")
  | @SOAPBinding(parameterStyle=ParameterStyle.WRAPPED,style=Style.DOCUMENT,use=Use.LITERAL)
  | public class BookSearchActionService {
  | 
  | 	@PersistenceContext
  | 	private EntityManager mgr;
  | 	@WebMethod(operationName="searchBooksByAuthor",action="searchBooksByAuthor")
  | 	public Book[] searchBooks(String author) {
  | 		ArrayList<Book> list = (ArrayList<Book>) mgr.createNamedQuery("findBooksByAuthor").setParameter("author", author).getResultList();
  | 		Book[] books = new Book[list.size()];
  | 		for (int i = 0; i < list.size(); i++) {
  | 			books = list.get(i);
  | 		}
  | 		return books;
  | 	}
  | 	
  | }
  | 
  | 

Am I missing anything here ?
thanks in advance.
Mayuresh

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

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



More information about the jboss-user mailing list