Results 1 to 2 of 2
Thread: Web services help
- 01-21-2012, 03:49 AM #1
Member
- Join Date
- Jan 2012
- Posts
- 1
- Rep Power
- 0
Web services help
i am new to java and i need to create web services. i am trying to create WS to a maven project ( blog application creating
articles. etc) i am not sure if i am doing it right. I created a web service and a web client. when i call the service from client (simple method hello) is working but when i am trying to call articles from database i get an error.
here is the WS code:
import edu.city.set.eia.citypress.beans.ArticleFacadeLoca l;
import edu.city.set.eia.citypress.model.RegisUser;
import java.util.List;
import javax.ejb.EJB;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.ejb.Stateless;
@WebService(serviceName = "Article")
@Stateless()
public class Article {
@EJB
private ArticleFacadeLocal artBean;
@WebMethod(operationName = "findByAuthor")
public @WebResult(name="byAuthor") List<Article> findByAuthor(@WebParam(name = "id") RegisUser id) {
return artBean.findByAuthor(id);
}
and the web client code:
Article_Service client = new Article_Service();
Article port = client.getArticlePort();
System.out.println(port.findByAuthor());
Thanks in advanceLast edited by dayton; 01-21-2012 at 03:54 AM.
- 01-21-2012, 12:35 PM #2
Similar Threads
-
Web Services
By nikosdi in forum Web FrameworksReplies: 3Last Post: 06-04-2011, 01:28 PM -
Web Services
By Cbani in forum Advanced JavaReplies: 6Last Post: 01-24-2010, 02:15 PM -
web services
By k_paramesh82 in forum Java SoftwareReplies: 5Last Post: 04-02-2009, 12:03 PM -
Web Services: Axis vs Metro vs Spring Web Services
By davidbaker29 in forum Advanced JavaReplies: 0Last Post: 01-28-2009, 11:20 AM -
Web services
By Sharmistha in forum Web FrameworksReplies: 0Last Post: 06-02-2008, 01:06 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks