Skip to main content

a void method that throws an exception

1 reply [Last post]
mwnorman
Offline
Joined: 2008-03-12
Points: 0

I have a WebService and I wish to have a void method that
updates something, but allow for runtime exceptions:

@WebService
public class SimpleWebService {

@WebMethod
public Simple findByPrimaryKey(int id) {
...
}

@WebMethod
public List findAll() {
...
}

@WebMethod
@Oneway
public void update(Simple theInstance) throws WebServiceException {
...
}
}

The wsgen utility is throwing an exception when generating the WSDL for this
service:
Problem encountered during annotation processing;
see stacktrace below for more information.
com.sun.tools.internal.ws.processor.modeler.ModelerException: modeler error: The method update(test.Simple) of class test.SimpleWebS
ervice is annotated @Oneway but declares the exception javax.xml.ws.WebServiceException
at com.sun.tools.internal.ws.processor.modeler.annotation.WebServiceAP.onError(WebServiceAP.java:221)

Why doesn't this just produce WSDL as follows:
...

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Fabian Ritzmann

On 17. Oct 2008, at 22:03, metro@javadesktop.org wrote:

> The wsgen utility is throwing an exception when generating the WSDL
> for this
> service:
> Problem encountered during annotation processing;
> see stacktrace below for more information.
> com.sun.tools.internal.ws.processor.modeler.ModelerException:
> modeler error: The method update(test.Simple) of class test.SimpleWebS
> ervice is annotated @Oneway but declares the exception
> javax.xml.ws.WebServiceException
> at
> com
> .sun
> .tools
> .internal
> .ws
> .processor.modeler.annotation.WebServiceAP.onError(WebServiceAP.java:
> 221)
>
>
> Why doesn't this just produce WSDL as follows:
> ...
>
> > soapAction="urn:simpleService:update_simpleType"/>
>
>
>
>
>
>

>

You have declared a one-way method, i.e. there is no way to return the
SOAP fault to the caller.

Fabian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net