While on the topic of java2wsdl, I have a similar question.  I have
the following class.

public class Result
{
        private boolean success;
        private String errorMessage;

        public Result(){}

        public boolean getSuccess()
        {
                return success;
        }
        public void setSuccess(boolean success)
        {
                this.success = success;
        }
        public String getErrorMessage()
        {
                return errorMessage;
        }

        public void setErrorMessage(String errorMessage)
        {
                this.errorMessage = errorMessage;
        }
}

In my wsdl i want to define an error message so thats its an
enumeration type as follows.

<xs:simpleType name="ErrorMessage">
        <xs:restriction base="xs:string">
                <xs:enumeration value="General server failure" />
                <xs:enumeration value="Invalid username or password" />
                <xs:enumeration value="Invalid session" />
                <lots of other errors>
        </xs:restriction>
</xs:simpleType>

Currently after running java2wsdl i have to add that block manually
into the WSDL file, is there a way this can be done automatically by
java2wsdl?  I then need to change the Result type to point to the
simpleType ErrorMessage as follows.

<xs:complexType name="Result">
        <xs:sequence>
                <xs:element name="errorMessage" nillable="true" 
type="ns:ErrorMessage" />
                <xs:element name="success" type="xs:boolean" />
        </xs:sequence>
</xs:complexType>

Our SOAP API is currently changing a lot in our project as its early
on in the project, everytime it changes i need to regenerate the WSDL
and put in a ton of custon tweaks like this (and the min/max
inclusive, etc).  Is it possible to change my POJO files in a way that
this makes its way into the WSDL everytime its generated, i think
other SOAP frameworks support this, so i'm hoping axis does also.

Thanks.

Jon

On 10/25/07, Jon Horsman <[EMAIL PROTECTED]> wrote:
> Hey,
>
> I have some POJO classes that I use java2wsdl to generate a wsdl file
> for me.  I'm curious if there is any syntax that can be used in those
> java classes that will automatically add min/max inclusive to the
> generated WSDL?
>
> Lets say i have a simple class like
>
> public class TestClass
> {
>   private int testInt;
>   public void setTestInt(int i)
>   {
>     testInt = i;
>   }
>   public int getTestInt()
>   {
>     return 0;
>   }
> }
>
> Say that i want the WSDL to insure that setTestInt only accepts values
> between 0 and 10, is there a way to make a change in TestClass so that
> min/max Inclusive gets put into the WSDL or do you have to manually
> tweak the generated WSDL and add some like the following?
>
> <xs:minInclusive value="0" />
> <xs:maxInclusive value="10" />
>
> Thanks,
>
> Jon.
>

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

Reply via email to