About Question enthuware.ocejws.v6.2.13 :
Moderators: Site Manager, fjwalraven
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
About Question enthuware.ocejws.v6.2.13 :
LogSuper is not annotated by any @WebService, so logParent() is not supposed to be exposed.
Also, if LogService is an explicit SEI, all methods in this SEI will be exposed by the SIB.
But if LogService is an implicit SEI, the method with @WebMethod(exclude=true) won't be exposed.
In NetBean platform, @WebMethod(exclude=true) or false in an SEI won't even compile.
Also, if LogService is an explicit SEI, all methods in this SEI will be exposed by the SIB.
But if LogService is an implicit SEI, the method with @WebMethod(exclude=true) won't be exposed.
In NetBean platform, @WebMethod(exclude=true) or false in an SEI won't even compile.
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.13 :
That annotation is not necessary, from JSR-181:LogSuper is not annotated by any @WebService, so logParent() is not supposed to be exposed.
andAll methods on the service endpoint interface, including methods inherited from super-interfaces, are mapped to WSDL operations regardless of whether they include a @WebMethod annotation. A method MAY include a @WebMethod annotation to customize the mapping to WSDL, but is not REQUIRED to do so.
That is possible, but it is not required by the specs.@WebMethod(exclude=true) or false in an SEI won't even compile.
Regards,
Frits
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question enthuware.ocejws.v6.2.13 :
Thanks. I got it.
I played with the code by changing all the interface into class like this:
When I published the LogImpService, the WSDL shows log, logSuper, logSuperResponse.
Obviously, logParent() is inherited from LogSuper class. But logParent()/LogSuper is not annotated by @WebMethod or @WebService. So, it won't be exposed by LogImp class.
I played with the code by changing all the interface into class like this:
Code: Select all
@WebService
public class LogSuperSuper {
public void logSuper(String msg) {}
}
Code: Select all
public class LogSuper extends LogSuperSuper{
public void logParent(String msg){}
}
Code: Select all
@WebService
public class LogService extends LogSuper {
@Oneway
public void log(String msg){}
@WebMethod(exclude=true)
public void logN(String msg){}
}
Code: Select all
@WebService
public class LogImp extends LogService{
}
Obviously, logParent() is inherited from LogSuper class. But logParent()/LogSuper is not annotated by @WebMethod or @WebService. So, it won't be exposed by LogImp class.
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.ocejws.v6.2.13 :
Is it correct statement?But logParent()/LogSuper is not annotated by @WebMethod or @WebService. So, it won't be exposed by LogImp class.
LogImp inherits logParent() and LogSuper() method, why they are not exposed?
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.13 :
Yes, you might want to read the explanation of a similar question here: viewtopic.php?f=40&t=4084&p=15887#p15887
Regards,
Frits
Regards,
Frits
-
- Posts: 197
- Joined: Mon Jun 20, 2016 5:06 pm
- Contact:
Re: About Question enthuware.ocejws.v6.2.13 :
Surprisingly I tried to emulate this behavior in GlassFish4
and I got all methods exposed
Code: Select all
class SuperC2{
public String superC2M(){
return null;
}
}
class superC extends SuperC2 {
public String superCM(){
return null;
}
}
@WebService
public class inhClasses extends superC {
public String inhClass(){
return null;
}
}
Code: Select all
<portType name="inhClasses">
<operation name="inhClass">
<input wsam:Action="http://classes.inheritance.com/inhClasses/inhClassRequest" message="tns:inhClass"/>
<output wsam:Action="http://classes.inheritance.com/inhClasses/inhClassResponse" message="tns:inhClassResponse"/>
</operation>
<operation name="superCM">
<input wsam:Action="http://classes.inheritance.com/inhClasses/superCMRequest" message="tns:superCM"/>
<output wsam:Action="http://classes.inheritance.com/inhClasses/superCMResponse" message="tns:superCMResponse"/>
</operation>
<operation name="superC2M">
<input wsam:Action="http://classes.inheritance.com/inhClasses/superC2MRequest" message="tns:superC2M"/>
<output wsam:Action="http://classes.inheritance.com/inhClasses/superC2MResponse" message="tns:superC2MResponse"/>
</operation>
</portType>
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.13 :
That is indeed surprising!
Conclusion: Glassfish doesn't follow the specs here.
Note: for the exam: follow the specs.
Regards,
Frits
Conclusion: Glassfish doesn't follow the specs here.
Note: for the exam: follow the specs.
Regards,
Frits
Who is online
Users browsing this forum: No registered users and 2 guests