Page 1 of 1

About Question enthuware.ocejws.v6.2.76 :

Posted: Thu Jan 30, 2014 2:53 am
by sathishkumar

Code: Select all

@WebService
public class LogImpl {
    @Oneway
    public void log(String msg) throws EmptyStrException {
        if ("".equals(msg)) {
            throw new EmptyStrException();
        }
    }
}
[/size]Above code is getting compiled and deploying fine. JAX-WS runtime just skips the fault. so the answer to this question is
This Web Service will deploy and run without errors.
Please correct me if i am wrong...

Re: About Question enthuware.ocejws.v6.2.76 :

Posted: Thu Jan 30, 2014 2:44 pm
by fjwalraven
Above code is getting compiled and deploying fine. JAX-WS runtime just skips the fault.
If that is the case, then your application server is not fully compliant to the JAX-WS specifications. What application server are you using?

From the JSR-181 specs:
A JSR-181 processor is REQUIRED to report an error if an operation marked @Oneway has a return value, declares any checked exceptions or has any
INOUT or OUT parameters.
The reference implementation server (Glassfish) will give you the following error on deployment of the application:
Oneway operation should not throw any checked exceptions class: notes.ws.LogServiceImpl method: log throws: notes.ws.EmptyStrException
Regards,
Frits

Re: About Question enthuware.ocejws.v6.2.76 :

Posted: Tue Apr 12, 2016 3:39 pm
by jeffreywang629
The code won't compile. The right round bracket is missing. Please correct it.

Code: Select all

@WebService public class LogServiceImpl implements LogService {
	@Override
	@Oneway
	public void log(String msg) throws EmptyStrException {
	if(msg.equals("") {                                   //<------------- Missing ")"
		throw new EmptyStrException();       
		}    
	} 
}

Re: About Question enthuware.ocejws.v6.2.76 :

Posted: Tue Apr 12, 2016 10:31 pm
by fjwalraven
Hi!
The code won't compile. The right round bracket is missing. Please correct it.
Yes, you are right. Fixed it! It will come to you with the next update.

Thanks for your feedback!

Regards,
Frits