About Question enthuware.ocejws.v6.2.76 :

Moderators: Site Manager, fjwalraven

Post Reply
sathishkumar
Posts: 5
Joined: Mon Jan 27, 2014 3:32 am
Contact:

About Question enthuware.ocejws.v6.2.76 :

Post by sathishkumar » Thu Jan 30, 2014 2:53 am

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...

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

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

Post by fjwalraven » Thu Jan 30, 2014 2:44 pm

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

jeffreywang629
Posts: 1
Joined: Tue Apr 12, 2016 3:26 pm
Contact:

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

Post by jeffreywang629 » Tue Apr 12, 2016 3:39 pm

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();       
		}    
	} 
}

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

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

Post by fjwalraven » Tue Apr 12, 2016 10:31 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests