[ 
https://issues.apache.org/jira/browse/MUSE-227?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Erik Rissanen updated MUSE-227:
-------------------------------

    Description: 
For resource properties wsdl2java generates an interface like this (this is the 
sample from the tutorial):

public interface MyCapability
{
    String PREFIX = "tns";

    String NAMESPACE_URI = "http://ws.apache.org/muse/test/wsrf";;

    public int getMessageInterval();

    public void setMessageInterval(int param0);

    public String getServerName();

    public void setServerName(String param0);
}

Notice that the generated setters/getters do not declare any exceptions. This 
is fine for the sample where the property is implemented as a simple member 
variable. However, if I store the data somewhere else, for instance in a 
database somewhere, then getting and setting of the actual resource data can 
fail with an exception.

As the interface declaration is now, I have to catch any exceptions and turn 
them into unchecked RuntimeExceptions, which is a bit uggly.

Suggested fix: the interface declares either throws Exception or throws 
SOAPFault

  was:
For resource properties wsdl2java generates an interface like this (this is the 
sample from the tutorial):

public interface MyCapability
{
    String PREFIX = "tns";

    String NAMESPACE_URI = "http://ws.apache.org/muse/test/wsrf";;

    public int getMessageInterval();

    public void setMessageInterval(int param0);

    public String getServerName();

    public void setServerName(String param0);
}

Notice that the generated setters/getters do not declare any exceptions. This 
is fine for the sample where the property is implemented as a simple member 
variable. However, if I store the data somewhere else, for instance in a 
database somewhere, then getting and setting of the actual resource data can 
fail with an exception.

As the interface declaration is now, I have to catch any exceptions and turn 
them into unchecked RuntimeExceptions, which is a bit uggly.

Suggested workaround: the interface declares either throws Exception or throws 
SOAPFault


Corrected typo in description

> No exceptions allowed in generated WSRF property setters/getters
> ----------------------------------------------------------------
>
>                 Key: MUSE-227
>                 URL: https://issues.apache.org/jira/browse/MUSE-227
>             Project: Muse
>          Issue Type: Bug
>          Components: Tooling - Code Generation
>    Affects Versions: 2.3.0
>         Environment: Linux. Muse nightly build 2.3.0-2007-04-16-02-00
>            Reporter: Erik Rissanen
>         Assigned To: Dan Jemiolo
>            Priority: Minor
>
> For resource properties wsdl2java generates an interface like this (this is 
> the sample from the tutorial):
> public interface MyCapability
> {
>     String PREFIX = "tns";
>     String NAMESPACE_URI = "http://ws.apache.org/muse/test/wsrf";;
>     public int getMessageInterval();
>     public void setMessageInterval(int param0);
>     public String getServerName();
>     public void setServerName(String param0);
> }
> Notice that the generated setters/getters do not declare any exceptions. This 
> is fine for the sample where the property is implemented as a simple member 
> variable. However, if I store the data somewhere else, for instance in a 
> database somewhere, then getting and setting of the actual resource data can 
> fail with an exception.
> As the interface declaration is now, I have to catch any exceptions and turn 
> them into unchecked RuntimeExceptions, which is a bit uggly.
> Suggested fix: the interface declares either throws Exception or throws 
> SOAPFault

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to