• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to stop all methods in a class from published as WebService in JBoss AS 7 ?

 
Rohan Bhanderi
Greenhorn
Posts: 4
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a session bean for which I use @WebService annotation to publish the class for web-service.
but I want that only perticuler methods of that class should be published but in JBoss 7 all the methods are getting published as web service.
I am using @WebMethod annotation to do so.

Actually my real probleam is that eariler I was working on JBoss 4.2.
And I used two methods with same name but different arguments(method overloading) and only one of the methods was published in web service.

But when I switched to JBoss 7 all the methods in th class are getting published by default so JBoss gives me error about having the same service name for two different services.
Ex.
@WebService
public class ServiceOk implements Service {

@WebMethod
public void foo(int a) {
}

public void foo(String bar) {
}
}

since both the methods are published in JBoss 7 I am getting this error !!.
Is there any configuration for JBoss 7 to publish only the methods annotated with @WebMethod and not all the methods in the class.
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which exact version of AS7 is this?
 
Rohan Bhanderi
Greenhorn
Posts: 4
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using jboss-as-7.1.1
My question is if there is any alternative to beacause in my application all the methods in the class annoted with are published in webservice.
And since my class has overloaded methods (with same number of arguments but of different types) I am forced to write on all the methods which I don't want to publish in webservice which was not the case with jboss-4.2.2.GA
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic