my dog learned polymorphism*
The moose likes JBoss/WildFly and the fly likes How to stop all methods in a class from published as WebService in JBoss AS 7 ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "How to stop all methods in a class from published as WebService in JBoss AS 7 ?" Watch "How to stop all methods in a class from published as WebService in JBoss AS 7 ?" New topic
Author

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

Rohan Bhanderi
Greenhorn

Joined: May 19, 2012
Posts: 4

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

Joined: Jul 20, 2005
Posts: 10102
    
165

Which exact version of AS7 is this?

[My Blog] [JavaRanch Journal]
Rohan Bhanderi
Greenhorn

Joined: May 19, 2012
Posts: 4

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to stop all methods in a class from published as WebService in JBoss AS 7 ?