You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Mauro Molinari (JIRA)" <ji...@apache.org> on 2007/10/25 15:36:51 UTC

[jira] Created: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
----------------------------------------------------------------------------------

                 Key: AXIS2-3300
                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: Tools
    Affects Versions: 1.3
            Reporter: Mauro Molinari


When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:

public Integer a(String, Integer)
public String b(Integer, String) 

Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 

When generating clients using .NET WebService Studio 2.0, the result is the following:
- all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
- all the generated C# methods return parameters are void, except for the string ones

The actual result are clients with methods like these:

public void a(string, int, bool);
public string b(int, bool, string);

This is obviously a problem, particularly for the "void" return type.

If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.

The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


AW: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by Ma...@t-systems.com.
Hi,

I see your point about having contract first, but this is a philosophical question. I would have loved something like an option in java2wsdl to specify minOccurs="1" or minOccurs="0". Axis1 did generate everything without minOccurs which results basically in minOccurs="1". I guess, I'll have to find a way to make it work for me.

Thank you for your comments anyways, so I know that I don't have to wait for any changes in this direction.

Matthias.
 
-----Ursprüngliche Nachricht-----
Von: WJ Krpelan [mailto:krpelan_wj@yahoo.com] 
Gesendet: Freitag, 31. Juli 2009 11:33
An: axis-dev@ws.apache.org
Betreff: Re: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation


Hi folks,
Right - by pure doctrine. However, the need to master xml-schema and wsdl doesnt make life so much easier for web service developers, does it?
Cheers Wolfgang

--- On Thu, 7/30/09, Ajith Ranabahu <aj...@gmail.com> wrote:

> From: Ajith Ranabahu <aj...@gmail.com>
> Subject: Re: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated  by Java2WSDL - problems with .NET client generation
> To: axis-dev@ws.apache.org
> Date: Thursday, July 30, 2009, 11:06 PM
> Well said Andreas :)
> 
> On Thu, Jul 30, 2009 at 11:00 AM,
> Andreas Veithen <an...@gmail.com>
> wrote:
> 
> What this example really shows is that to achieve
> interoperability and
> 
> to make everybody's life easier (in an environment
> where different
> 
> platforms are used), you should not use a code first
> approach, but a
> 
> contract first.
> 
> 
> 
> Andreas
> 
> 
> 
> On Thu, Jul 30, 2009 at 11:26, WJ Krpelan<kr...@yahoo.com>
> wrote:
> 
> >
> 
> > Hi Matthias,
> 
> > in my personal view you are asking to much.
> 
> > to achieve interoperability, its not unusual that one
> has to adjust automatically generated wsdls/schemes
> manually.
> 
> > if you try to do webservices fully dynamically
> you'd better make sure the same webservice-engine is
> present on both sides
> 
> >
> 
> > Seen from the java side, how could the generator tell
> from the code whether a variable is meant to be optional or
> obligatory or even nullable?
> 
> > Usually it can't so it generates the most general
> approach, which is optional and nullable obviously.
> 
> >
> 
> > Cheers,
> 
> > Wolfgang
> 
> >
> 
> >
> 
> > --- On Wed, 7/29/09, Matthias.Gaiser@t-systems.com
> <Ma...@t-systems.com>
> wrote:
> 
> >
> 
> >> From: Matthias.Gaiser@t-systems.com
> <Ma...@t-systems.com>
> 
> >> Subject: AW: [jira] Commented: (AXIS2-3300)
> minOccurs="0" always generated by Java2WSDL -
> problems with .NET client generation
> 
> >> To: axis-dev@ws.apache.org
> 
> >> Date: Wednesday, July 29, 2009, 2:10 PM
> 
> >> Hi Chris (or someone else),
> 
> >>
> 
> >> maybe it is just a misunderstanding on my side.
> 
> >>
> 
> >> I am generating a wsdl from a java class via
> java2wsdl. I
> 
> >> am using a simple method like
> 
> >> public String login(String user, String
> password);
> 
> >>
> 
> >> java2wsdl now generates a wsdl where the
> parameters are
> 
> >> marked with minOccurs="0", which should
> not be the case for
> 
> >> my webservice. Is there a possibility to set the
> standard
> 
> >> behavior to minOccurs="1"? As far as I
> have seen in the
> 
> >> DefaultSchemaGenerator the minOccurs="0"
> is hardcoded.
> 
> >> Generated wsdl fragment:
> 
> >> <xs:element name="login">
> 
> >>     <xs:complexType>
> 
> >>         <xs:sequence>
> 
> >>
> 
> >> <xs:element minOccurs="0"
> name="user" nillable="true"
> 
> >> type="xs:string"/>
> 
> >>
> 
> >> <xs:element minOccurs="0"
> name="password" nillable="true"
> 
> >> type="xs:string"/>
> 
> >>         </xs:sequence>
> 
> >>     </xs:complexType>
> 
> >> </xs:element>
> 
> >>
> 
> >>
> 
> >> Please help me in clarfying this issue.
> 
> >>
> 
> >> Thank you,
> 
> >> Matthias.
> 
> >>
> 
> >> -----Ursprüngliche Nachricht-----
> 
> >> Von: Chris van Es (JIRA) [mailto:jira@apache.org]
> 
> >> Gesendet: Dienstag, 28. Juli 2009 14:49
> 
> >> An: axis-dev@ws.apache.org
> 
> >> Betreff: [jira] Commented: (AXIS2-3300)
> minOccurs="0"
> 
> >> always generated by Java2WSDL - problems with .NET
> client
> 
> >> generation
> 
> >>
> 
> >>
> 
> >>     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736053#action_12736053
> 
> 
> >> ]
> 
> >>
> 
> >> Chris van Es commented on AXIS2-3300:
> 
> >> -------------------------------------
> 
> >>
> 
> >> I patched the DefaultSchemaGenerator in that
> fashion and we
> 
> >> haven't had any problems to date.
> 
> >>
> 
> >> Chris.
> 
> >>
> 
> >> > minOccurs="0" always generated by
> Java2WSDL - problems
> 
> >> with .NET client generation
> 
> >> >
> 
> >>
> ----------------------------------------------------------------------------------
> 
> >> >
> 
> >> >
> 
> >>    Key: AXIS2-3300
> 
> >> >
> 
> >>    URL: https://issues.apache.org/jira/browse/AXIS2-3300
> 
> >
> 
> >> >
> 
> >>    Project: Axis 2.0 (Axis2)
> 
> >> >          Issue Type: Bug
> 
> >> >          Components: Tools
> 
> >> >    Affects Versions: 1.3
> 
> >> >            Reporter:
> 
> >> Mauro Molinari
> 
> >> >            Assignee:
> 
> >> Deepal Jayasinghe
> 
> >> >         Attachments:
> 
> >> axis2-1.4.1.diff
> 
> >> >
> 
> >> >
> 
> >> > When you try to expose a POJO as a
> webservice, suppose
> 
> >> you have two Java methods with the following
> signatures:
> 
> >> > public Integer a(String, Integer)
> 
> >> > public String b(Integer, String)
> 
> >> > Java2WSDL adds the minOccurs="0"
> for each element of
> 
> >> each complex type, both for the input parameters
> and for the
> 
> >> output parameters.
> 
> >> > When generating clients using .NET WebService
> Studio
> 
> >> 2.0, the result is the following:
> 
> >> > - all the generated C# methods input
> parameters are
> 
> >> doubled, except for the string ones: the doubled
> parameters
> 
> >> are booleans whose meaning is: "is the
> previous parameter
> 
> >> specified or not?"
> 
> >> > - all the generated C# methods return
> parameters are
> 
> >> void, except for the string ones
> 
> >> > The actual result are clients with methods
> like
> 
> >> these:
> 
> >> > public void a(string, int, bool);
> 
> >> > public string b(int, bool, string);
> 
> >> > This is obviously a problem, particularly for
> the
> 
> >> "void" return type.
> 
> >> > If I remove minOccurs="0", clients
> are generated
> 
> >> correctly by .NET WebService Studio 2.0.
> 
> >> > The issue is this: why does Java2WSDL always
> adds
> 
> >> minOccurs="0"? If its meaning were
> "it can be null", I think
> 
> >> nillable="true" attribute should be more
> appropriate...
> 
> >> Moreover, if I substitute Integer with int in the
> original
> 
> >> Java class methods, minOccurs="0" is
> still added by
> 
> >> Java2WSDL, even if an int cannot be null.
> 
> >>
> 
> >> --
> 
> >> This message is automatically generated by JIRA.
> 
> >> -
> 
> >> You can reply to this email to add a comment to
> the issue
> 
> >> online.
> 
> >>
> 
> >>
> 
> >
> 
> >
> 
> >
> 
> >
> 
> 
> 
> 
> -- 
> Ajith Ranabahu
> 
> Reading, after a certain age, diverts the mind too much
> from its creative pursuits. Any man who reads too much and
> uses his own brain too little falls into lazy habits of
> thinking - Albert Einstein
> 
> 
> 
> 


      

Re: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by WJ Krpelan <kr...@yahoo.com>.
Hi folks,
Right - by pure doctrine. However, the need to master xml-schema and wsdl doesnt make life so much easier for web service developers, does it?
Cheers Wolfgang

--- On Thu, 7/30/09, Ajith Ranabahu <aj...@gmail.com> wrote:

> From: Ajith Ranabahu <aj...@gmail.com>
> Subject: Re: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated  by Java2WSDL - problems with .NET client generation
> To: axis-dev@ws.apache.org
> Date: Thursday, July 30, 2009, 11:06 PM
> Well said Andreas :)
> 
> On Thu, Jul 30, 2009 at 11:00 AM,
> Andreas Veithen <an...@gmail.com>
> wrote:
> 
> What this example really shows is that to achieve
> interoperability and
> 
> to make everybody's life easier (in an environment
> where different
> 
> platforms are used), you should not use a code first
> approach, but a
> 
> contract first.
> 
> 
> 
> Andreas
> 
> 
> 
> On Thu, Jul 30, 2009 at 11:26, WJ Krpelan<kr...@yahoo.com>
> wrote:
> 
> >
> 
> > Hi Matthias,
> 
> > in my personal view you are asking to much.
> 
> > to achieve interoperability, its not unusual that one
> has to adjust automatically generated wsdls/schemes
> manually.
> 
> > if you try to do webservices fully dynamically
> you'd better make sure the same webservice-engine is
> present on both sides
> 
> >
> 
> > Seen from the java side, how could the generator tell
> from the code whether a variable is meant to be optional or
> obligatory or even nullable?
> 
> > Usually it can't so it generates the most general
> approach, which is optional and nullable obviously.
> 
> >
> 
> > Cheers,
> 
> > Wolfgang
> 
> >
> 
> >
> 
> > --- On Wed, 7/29/09, Matthias.Gaiser@t-systems.com
> <Ma...@t-systems.com>
> wrote:
> 
> >
> 
> >> From: Matthias.Gaiser@t-systems.com
> <Ma...@t-systems.com>
> 
> >> Subject: AW: [jira] Commented: (AXIS2-3300)
> minOccurs="0" always generated by Java2WSDL -
> problems with .NET client generation
> 
> >> To: axis-dev@ws.apache.org
> 
> >> Date: Wednesday, July 29, 2009, 2:10 PM
> 
> >> Hi Chris (or someone else),
> 
> >>
> 
> >> maybe it is just a misunderstanding on my side.
> 
> >>
> 
> >> I am generating a wsdl from a java class via
> java2wsdl. I
> 
> >> am using a simple method like
> 
> >> public String login(String user, String
> password);
> 
> >>
> 
> >> java2wsdl now generates a wsdl where the
> parameters are
> 
> >> marked with minOccurs="0", which should
> not be the case for
> 
> >> my webservice. Is there a possibility to set the
> standard
> 
> >> behavior to minOccurs="1"? As far as I
> have seen in the
> 
> >> DefaultSchemaGenerator the minOccurs="0"
> is hardcoded.
> 
> >> Generated wsdl fragment:
> 
> >> <xs:element name="login">
> 
> >>     <xs:complexType>
> 
> >>         <xs:sequence>
> 
> >>
> 
> >> <xs:element minOccurs="0"
> name="user" nillable="true"
> 
> >> type="xs:string"/>
> 
> >>
> 
> >> <xs:element minOccurs="0"
> name="password" nillable="true"
> 
> >> type="xs:string"/>
> 
> >>         </xs:sequence>
> 
> >>     </xs:complexType>
> 
> >> </xs:element>
> 
> >>
> 
> >>
> 
> >> Please help me in clarfying this issue.
> 
> >>
> 
> >> Thank you,
> 
> >> Matthias.
> 
> >>
> 
> >> -----Ursprüngliche Nachricht-----
> 
> >> Von: Chris van Es (JIRA) [mailto:jira@apache.org]
> 
> >> Gesendet: Dienstag, 28. Juli 2009 14:49
> 
> >> An: axis-dev@ws.apache.org
> 
> >> Betreff: [jira] Commented: (AXIS2-3300)
> minOccurs="0"
> 
> >> always generated by Java2WSDL - problems with .NET
> client
> 
> >> generation
> 
> >>
> 
> >>
> 
> >>     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736053#action_12736053
> 
> 
> >> ]
> 
> >>
> 
> >> Chris van Es commented on AXIS2-3300:
> 
> >> -------------------------------------
> 
> >>
> 
> >> I patched the DefaultSchemaGenerator in that
> fashion and we
> 
> >> haven't had any problems to date.
> 
> >>
> 
> >> Chris.
> 
> >>
> 
> >> > minOccurs="0" always generated by
> Java2WSDL - problems
> 
> >> with .NET client generation
> 
> >> >
> 
> >>
> ----------------------------------------------------------------------------------
> 
> >> >
> 
> >> >
> 
> >>    Key: AXIS2-3300
> 
> >> >
> 
> >>    URL: https://issues.apache.org/jira/browse/AXIS2-3300
> 
> >
> 
> >> >
> 
> >>    Project: Axis 2.0 (Axis2)
> 
> >> >          Issue Type: Bug
> 
> >> >          Components: Tools
> 
> >> >    Affects Versions: 1.3
> 
> >> >            Reporter:
> 
> >> Mauro Molinari
> 
> >> >            Assignee:
> 
> >> Deepal Jayasinghe
> 
> >> >         Attachments:
> 
> >> axis2-1.4.1.diff
> 
> >> >
> 
> >> >
> 
> >> > When you try to expose a POJO as a
> webservice, suppose
> 
> >> you have two Java methods with the following
> signatures:
> 
> >> > public Integer a(String, Integer)
> 
> >> > public String b(Integer, String)
> 
> >> > Java2WSDL adds the minOccurs="0"
> for each element of
> 
> >> each complex type, both for the input parameters
> and for the
> 
> >> output parameters.
> 
> >> > When generating clients using .NET WebService
> Studio
> 
> >> 2.0, the result is the following:
> 
> >> > - all the generated C# methods input
> parameters are
> 
> >> doubled, except for the string ones: the doubled
> parameters
> 
> >> are booleans whose meaning is: "is the
> previous parameter
> 
> >> specified or not?"
> 
> >> > - all the generated C# methods return
> parameters are
> 
> >> void, except for the string ones
> 
> >> > The actual result are clients with methods
> like
> 
> >> these:
> 
> >> > public void a(string, int, bool);
> 
> >> > public string b(int, bool, string);
> 
> >> > This is obviously a problem, particularly for
> the
> 
> >> "void" return type.
> 
> >> > If I remove minOccurs="0", clients
> are generated
> 
> >> correctly by .NET WebService Studio 2.0.
> 
> >> > The issue is this: why does Java2WSDL always
> adds
> 
> >> minOccurs="0"? If its meaning were
> "it can be null", I think
> 
> >> nillable="true" attribute should be more
> appropriate...
> 
> >> Moreover, if I substitute Integer with int in the
> original
> 
> >> Java class methods, minOccurs="0" is
> still added by
> 
> >> Java2WSDL, even if an int cannot be null.
> 
> >>
> 
> >> --
> 
> >> This message is automatically generated by JIRA.
> 
> >> -
> 
> >> You can reply to this email to add a comment to
> the issue
> 
> >> online.
> 
> >>
> 
> >>
> 
> >
> 
> >
> 
> >
> 
> >
> 
> 
> 
> 
> -- 
> Ajith Ranabahu
> 
> Reading, after a certain age, diverts the mind too much
> from its creative pursuits. Any man who reads too much and
> uses his own brain too little falls into lazy habits of
> thinking - Albert Einstein
> 
> 
> 
> 


      

Re: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by Ajith Ranabahu <aj...@gmail.com>.
Well said Andreas :)

On Thu, Jul 30, 2009 at 11:00 AM, Andreas Veithen <andreas.veithen@gmail.com
> wrote:

> What this example really shows is that to achieve interoperability and
> to make everybody's life easier (in an environment where different
> platforms are used), you should not use a code first approach, but a
> contract first.
>
> Andreas
>
> On Thu, Jul 30, 2009 at 11:26, WJ Krpelan<kr...@yahoo.com> wrote:
> >
> > Hi Matthias,
> > in my personal view you are asking to much.
> > to achieve interoperability, its not unusual that one has to adjust
> automatically generated wsdls/schemes manually.
> > if you try to do webservices fully dynamically you'd better make sure the
> same webservice-engine is present on both sides
> >
> > Seen from the java side, how could the generator tell from the code
> whether a variable is meant to be optional or obligatory or even nullable?
> > Usually it can't so it generates the most general approach, which is
> optional and nullable obviously.
> >
> > Cheers,
> > Wolfgang
> >
> >
> > --- On Wed, 7/29/09, Matthias.Gaiser@t-systems.com <
> Matthias.Gaiser@t-systems.com> wrote:
> >
> >> From: Matthias.Gaiser@t-systems.com <Ma...@t-systems.com>
> >> Subject: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always
> generated by Java2WSDL - problems with .NET client generation
> >> To: axis-dev@ws.apache.org
> >> Date: Wednesday, July 29, 2009, 2:10 PM
> >> Hi Chris (or someone else),
> >>
> >> maybe it is just a misunderstanding on my side.
> >>
> >> I am generating a wsdl from a java class via java2wsdl. I
> >> am using a simple method like
> >> public String login(String user, String password);
> >>
> >> java2wsdl now generates a wsdl where the parameters are
> >> marked with minOccurs="0", which should not be the case for
> >> my webservice. Is there a possibility to set the standard
> >> behavior to minOccurs="1"? As far as I have seen in the
> >> DefaultSchemaGenerator the minOccurs="0" is hardcoded.
> >> Generated wsdl fragment:
> >> <xs:element name="login">
> >>     <xs:complexType>
> >>         <xs:sequence>
> >>
> >> <xs:element minOccurs="0" name="user" nillable="true"
> >> type="xs:string"/>
> >>
> >> <xs:element minOccurs="0" name="password" nillable="true"
> >> type="xs:string"/>
> >>         </xs:sequence>
> >>     </xs:complexType>
> >> </xs:element>
> >>
> >>
> >> Please help me in clarfying this issue.
> >>
> >> Thank you,
> >> Matthias.
> >>
> >> -----Ursprüngliche Nachricht-----
> >> Von: Chris van Es (JIRA) [mailto:jira@apache.org]
> >> Gesendet: Dienstag, 28. Juli 2009 14:49
> >> An: axis-dev@ws.apache.org
> >> Betreff: [jira] Commented: (AXIS2-3300) minOccurs="0"
> >> always generated by Java2WSDL - problems with .NET client
> >> generation
> >>
> >>
> >>     [
> https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736053#action_12736053
> >> ]
> >>
> >> Chris van Es commented on AXIS2-3300:
> >> -------------------------------------
> >>
> >> I patched the DefaultSchemaGenerator in that fashion and we
> >> haven't had any problems to date.
> >>
> >> Chris.
> >>
> >> > minOccurs="0" always generated by Java2WSDL - problems
> >> with .NET client generation
> >> >
> >>
> ----------------------------------------------------------------------------------
> >> >
> >> >
> >>    Key: AXIS2-3300
> >> >
> >>    URL: https://issues.apache.org/jira/browse/AXIS2-3300
> >
> >> >
> >>    Project: Axis 2.0 (Axis2)
> >> >          Issue Type: Bug
> >> >          Components: Tools
> >> >    Affects Versions: 1.3
> >> >            Reporter:
> >> Mauro Molinari
> >> >            Assignee:
> >> Deepal Jayasinghe
> >> >         Attachments:
> >> axis2-1.4.1.diff
> >> >
> >> >
> >> > When you try to expose a POJO as a webservice, suppose
> >> you have two Java methods with the following signatures:
> >> > public Integer a(String, Integer)
> >> > public String b(Integer, String)
> >> > Java2WSDL adds the minOccurs="0" for each element of
> >> each complex type, both for the input parameters and for the
> >> output parameters.
> >> > When generating clients using .NET WebService Studio
> >> 2.0, the result is the following:
> >> > - all the generated C# methods input parameters are
> >> doubled, except for the string ones: the doubled parameters
> >> are booleans whose meaning is: "is the previous parameter
> >> specified or not?"
> >> > - all the generated C# methods return parameters are
> >> void, except for the string ones
> >> > The actual result are clients with methods like
> >> these:
> >> > public void a(string, int, bool);
> >> > public string b(int, bool, string);
> >> > This is obviously a problem, particularly for the
> >> "void" return type.
> >> > If I remove minOccurs="0", clients are generated
> >> correctly by .NET WebService Studio 2.0.
> >> > The issue is this: why does Java2WSDL always adds
> >> minOccurs="0"? If its meaning were "it can be null", I think
> >> nillable="true" attribute should be more appropriate...
> >> Moreover, if I substitute Integer with int in the original
> >> Java class methods, minOccurs="0" is still added by
> >> Java2WSDL, even if an int cannot be null.
> >>
> >> --
> >> This message is automatically generated by JIRA.
> >> -
> >> You can reply to this email to add a comment to the issue
> >> online.
> >>
> >>
> >
> >
> >
> >
>



-- 
Ajith Ranabahu

Reading, after a certain age, diverts the mind too much from its creative
pursuits. Any man who reads too much and uses his own brain too little falls
into lazy habits of thinking - Albert Einstein

Re: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by Andreas Veithen <an...@gmail.com>.
What this example really shows is that to achieve interoperability and
to make everybody's life easier (in an environment where different
platforms are used), you should not use a code first approach, but a
contract first.

Andreas

On Thu, Jul 30, 2009 at 11:26, WJ Krpelan<kr...@yahoo.com> wrote:
>
> Hi Matthias,
> in my personal view you are asking to much.
> to achieve interoperability, its not unusual that one has to adjust automatically generated wsdls/schemes manually.
> if you try to do webservices fully dynamically you'd better make sure the same webservice-engine is present on both sides
>
> Seen from the java side, how could the generator tell from the code whether a variable is meant to be optional or obligatory or even nullable?
> Usually it can't so it generates the most general approach, which is optional and nullable obviously.
>
> Cheers,
> Wolfgang
>
>
> --- On Wed, 7/29/09, Matthias.Gaiser@t-systems.com <Ma...@t-systems.com> wrote:
>
>> From: Matthias.Gaiser@t-systems.com <Ma...@t-systems.com>
>> Subject: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
>> To: axis-dev@ws.apache.org
>> Date: Wednesday, July 29, 2009, 2:10 PM
>> Hi Chris (or someone else),
>>
>> maybe it is just a misunderstanding on my side.
>>
>> I am generating a wsdl from a java class via java2wsdl. I
>> am using a simple method like
>> public String login(String user, String password);
>>
>> java2wsdl now generates a wsdl where the parameters are
>> marked with minOccurs="0", which should not be the case for
>> my webservice. Is there a possibility to set the standard
>> behavior to minOccurs="1"? As far as I have seen in the
>> DefaultSchemaGenerator the minOccurs="0" is hardcoded.
>> Generated wsdl fragment:
>> <xs:element name="login">
>>     <xs:complexType>
>>         <xs:sequence>
>>
>> <xs:element minOccurs="0" name="user" nillable="true"
>> type="xs:string"/>
>>
>> <xs:element minOccurs="0" name="password" nillable="true"
>> type="xs:string"/>
>>         </xs:sequence>
>>     </xs:complexType>
>> </xs:element>
>>
>>
>> Please help me in clarfying this issue.
>>
>> Thank you,
>> Matthias.
>>
>> -----Ursprüngliche Nachricht-----
>> Von: Chris van Es (JIRA) [mailto:jira@apache.org]
>> Gesendet: Dienstag, 28. Juli 2009 14:49
>> An: axis-dev@ws.apache.org
>> Betreff: [jira] Commented: (AXIS2-3300) minOccurs="0"
>> always generated by Java2WSDL - problems with .NET client
>> generation
>>
>>
>>     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736053#action_12736053
>> ]
>>
>> Chris van Es commented on AXIS2-3300:
>> -------------------------------------
>>
>> I patched the DefaultSchemaGenerator in that fashion and we
>> haven't had any problems to date.
>>
>> Chris.
>>
>> > minOccurs="0" always generated by Java2WSDL - problems
>> with .NET client generation
>> >
>> ----------------------------------------------------------------------------------
>> >
>> >
>>    Key: AXIS2-3300
>> >
>>    URL: https://issues.apache.org/jira/browse/AXIS2-3300
>
>> >
>>    Project: Axis 2.0 (Axis2)
>> >          Issue Type: Bug
>> >          Components: Tools
>> >    Affects Versions: 1.3
>> >            Reporter:
>> Mauro Molinari
>> >            Assignee:
>> Deepal Jayasinghe
>> >         Attachments:
>> axis2-1.4.1.diff
>> >
>> >
>> > When you try to expose a POJO as a webservice, suppose
>> you have two Java methods with the following signatures:
>> > public Integer a(String, Integer)
>> > public String b(Integer, String)
>> > Java2WSDL adds the minOccurs="0" for each element of
>> each complex type, both for the input parameters and for the
>> output parameters.
>> > When generating clients using .NET WebService Studio
>> 2.0, the result is the following:
>> > - all the generated C# methods input parameters are
>> doubled, except for the string ones: the doubled parameters
>> are booleans whose meaning is: "is the previous parameter
>> specified or not?"
>> > - all the generated C# methods return parameters are
>> void, except for the string ones
>> > The actual result are clients with methods like
>> these:
>> > public void a(string, int, bool);
>> > public string b(int, bool, string);
>> > This is obviously a problem, particularly for the
>> "void" return type.
>> > If I remove minOccurs="0", clients are generated
>> correctly by .NET WebService Studio 2.0.
>> > The issue is this: why does Java2WSDL always adds
>> minOccurs="0"? If its meaning were "it can be null", I think
>> nillable="true" attribute should be more appropriate...
>> Moreover, if I substitute Integer with int in the original
>> Java class methods, minOccurs="0" is still added by
>> Java2WSDL, even if an int cannot be null.
>>
>> --
>> This message is automatically generated by JIRA.
>> -
>> You can reply to this email to add a comment to the issue
>> online.
>>
>>
>
>
>
>

Re: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by WJ Krpelan <kr...@yahoo.com>.
Hi Matthias,
in my personal view you are asking to much.
to achieve interoperability, its not unusual that one has to adjust automatically generated wsdls/schemes manually.
if you try to do webservices fully dynamically you'd better make sure the same webservice-engine is present on both sides

Seen from the java side, how could the generator tell from the code whether a variable is meant to be optional or obligatory or even nullable?
Usually it can't so it generates the most general approach, which is optional and nullable obviously. 

Cheers,
Wolfgang


--- On Wed, 7/29/09, Matthias.Gaiser@t-systems.com <Ma...@t-systems.com> wrote:

> From: Matthias.Gaiser@t-systems.com <Ma...@t-systems.com>
> Subject: AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> To: axis-dev@ws.apache.org
> Date: Wednesday, July 29, 2009, 2:10 PM
> Hi Chris (or someone else),
> 
> maybe it is just a misunderstanding on my side.
> 
> I am generating a wsdl from a java class via java2wsdl. I
> am using a simple method like
> public String login(String user, String password);
> 
> java2wsdl now generates a wsdl where the parameters are
> marked with minOccurs="0", which should not be the case for
> my webservice. Is there a possibility to set the standard
> behavior to minOccurs="1"? As far as I have seen in the
> DefaultSchemaGenerator the minOccurs="0" is hardcoded.
> Generated wsdl fragment:
> <xs:element name="login">
>     <xs:complexType>
>         <xs:sequence>
>            
> <xs:element minOccurs="0" name="user" nillable="true"
> type="xs:string"/>
>            
> <xs:element minOccurs="0" name="password" nillable="true"
> type="xs:string"/>
>         </xs:sequence>
>     </xs:complexType>
> </xs:element>
> 
> 
> Please help me in clarfying this issue.
> 
> Thank you,
> Matthias. 
>  
> -----Ursprüngliche Nachricht-----
> Von: Chris van Es (JIRA) [mailto:jira@apache.org] 
> Gesendet: Dienstag, 28. Juli 2009 14:49
> An: axis-dev@ws.apache.org
> Betreff: [jira] Commented: (AXIS2-3300) minOccurs="0"
> always generated by Java2WSDL - problems with .NET client
> generation
> 
> 
>     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736053#action_12736053
> ] 
> 
> Chris van Es commented on AXIS2-3300:
> -------------------------------------
> 
> I patched the DefaultSchemaGenerator in that fashion and we
> haven't had any problems to date.
> 
> Chris.
> 
> > minOccurs="0" always generated by Java2WSDL - problems
> with .NET client generation
> >
> ----------------------------------------------------------------------------------
> >
> >             
>    Key: AXIS2-3300
> >             
>    URL: https://issues.apache.org/jira/browse/AXIS2-3300

> >         
>    Project: Axis 2.0 (Axis2)
> >          Issue Type: Bug
> >          Components: Tools
> >    Affects Versions: 1.3
> >            Reporter:
> Mauro Molinari
> >            Assignee:
> Deepal Jayasinghe
> >         Attachments:
> axis2-1.4.1.diff
> >
> >
> > When you try to expose a POJO as a webservice, suppose
> you have two Java methods with the following signatures:
> > public Integer a(String, Integer)
> > public String b(Integer, String) 
> > Java2WSDL adds the minOccurs="0" for each element of
> each complex type, both for the input parameters and for the
> output parameters. 
> > When generating clients using .NET WebService Studio
> 2.0, the result is the following:
> > - all the generated C# methods input parameters are
> doubled, except for the string ones: the doubled parameters
> are booleans whose meaning is: "is the previous parameter
> specified or not?"
> > - all the generated C# methods return parameters are
> void, except for the string ones
> > The actual result are clients with methods like
> these:
> > public void a(string, int, bool);
> > public string b(int, bool, string);
> > This is obviously a problem, particularly for the
> "void" return type.
> > If I remove minOccurs="0", clients are generated
> correctly by .NET WebService Studio 2.0.
> > The issue is this: why does Java2WSDL always adds
> minOccurs="0"? If its meaning were "it can be null", I think
> nillable="true" attribute should be more appropriate...
> Moreover, if I substitute Integer with int in the original
> Java class methods, minOccurs="0" is still added by
> Java2WSDL, even if an int cannot be null.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue
> online.
> 
> 


      

AW: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by Ma...@t-systems.com.
Hi Chris (or someone else),

maybe it is just a misunderstanding on my side.

I am generating a wsdl from a java class via java2wsdl. I am using a simple method like
public String login(String user, String password);

java2wsdl now generates a wsdl where the parameters are marked with minOccurs="0", which should not be the case for my webservice. Is there a possibility to set the standard behavior to minOccurs="1"? As far as I have seen in the DefaultSchemaGenerator the minOccurs="0" is hardcoded.
Generated wsdl fragment:
<xs:element name="login">
	<xs:complexType>
		<xs:sequence>
			<xs:element minOccurs="0" name="user" nillable="true" type="xs:string"/>
			<xs:element minOccurs="0" name="password" nillable="true" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>
</xs:element>


Please help me in clarfying this issue.

Thank you,
Matthias. 
 
-----Ursprüngliche Nachricht-----
Von: Chris van Es (JIRA) [mailto:jira@apache.org] 
Gesendet: Dienstag, 28. Juli 2009 14:49
An: axis-dev@ws.apache.org
Betreff: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation


    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736053#action_12736053 ] 

Chris van Es commented on AXIS2-3300:
-------------------------------------

I patched the DefaultSchemaGenerator in that fashion and we haven't had any problems to date.

Chris.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796536#action_12796536 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3300:
-----------------------------------------------------

I think we can not use any variables like dotNet1CompatibilityMode  in Axis2.

However it make sense to make minOccurs=1 considering your initial two points.

1. if the type is a primitive type then anyway it get assigned a value and hence nillable=true and minOccurs=0 can not be supported.
2. if not primitive always minOccurs=0 and nillable=true maps to null value. hence nillable=true is enough.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Resolved: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Amila Chinthaka Suriarachchi resolved AXIS2-3300.
-------------------------------------------------

    Resolution: Fixed

remove the minOccurs=0 i.e. it gets the default value for minOccurs.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


Re: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by WJ Krpelan <kr...@yahoo.com>.
Hi
its no bug, at most its a missing (interoperability-) feature -
cause if you adapt java2wsdl to some specific microsoft behaviour it gets incompatible with other platforms which makes no sense
you could make a interoperability feature request - either here or with mircosoft :)
anyway "wsdl first" is the correct interop approach. 
consider it.
Cheers, Wolfgang

--- On Tue, 12/22/09, Gilly Morg (JIRA) <ji...@apache.org> wrote:

> From: Gilly Morg (JIRA) <ji...@apache.org>
> Subject: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> To: axis-dev@ws.apache.org
> Date: Tuesday, December 22, 2009, 1:24 PM
> 
>     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793598#action_12793598
> ] 
> 
> Gilly Morg commented on AXIS2-3300:
> -----------------------------------
> 
> Can anyone tell me the status of this bug?... any solution
> for this?:S
> 
> THKS
> gilly
> 
> > minOccurs="0" always generated by Java2WSDL - problems
> with .NET client generation
> >
> ----------------------------------------------------------------------------------
> >
> >             
>    Key: AXIS2-3300
> >             
>    URL: https://issues.apache.org/jira/browse/AXIS2-3300
> >         
>    Project: Axis2
> >          Issue Type: Bug
> >          Components: Tools
> >    Affects Versions: 1.3
> >            Reporter:
> Mauro Molinari
> >            Assignee:
> Deepal Jayasinghe
> >         Attachments:
> axis2-1.4.1.diff
> >
> >
> > When you try to expose a POJO as a webservice, suppose
> you have two Java methods with the following signatures:
> > public Integer a(String, Integer)
> > public String b(Integer, String) 
> > Java2WSDL adds the minOccurs="0" for each element of
> each complex type, both for the input parameters and for the
> output parameters. 
> > When generating clients using .NET WebService Studio
> 2.0, the result is the following:
> > - all the generated C# methods input parameters are
> doubled, except for the string ones: the doubled parameters
> are booleans whose meaning is: "is the previous parameter
> specified or not?"
> > - all the generated C# methods return parameters are
> void, except for the string ones
> > The actual result are clients with methods like
> these:
> > public void a(string, int, bool);
> > public string b(int, bool, string);
> > This is obviously a problem, particularly for the
> "void" return type.
> > If I remove minOccurs="0", clients are generated
> correctly by .NET WebService Studio 2.0.
> > The issue is this: why does Java2WSDL always adds
> minOccurs="0"? If its meaning were "it can be null", I think
> nillable="true" attribute should be more appropriate...
> Moreover, if I substitute Integer with int in the original
> Java class methods, minOccurs="0" is still added by
> Java2WSDL, even if an int cannot be null.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue
> online.
> 
> 


      

[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Gilly Morg (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793598#action_12793598 ] 

Gilly Morg commented on AXIS2-3300:
-----------------------------------

Can anyone tell me the status of this bug?... any solution for this?:S

THKS
gilly

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Charles Galpin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763750#action_12763750 ] 

Charles Galpin commented on AXIS2-3300:
---------------------------------------

Any word on this patch getting accepted? I ran into this problem with axis2-1.5 as well.

thanks,
charles

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Ling Yu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12564948#action_12564948 ] 

Ling Yu commented on AXIS2-3300:
--------------------------------

I encountered the same problem when axis2 auto generates WSDLs for my web services classes. 

By looking into the DefaultSchemaGenerator.java in kernel module, both methods: generateSchemaforFieldsandProperties() and addContentToMethodSchemaType() seems to always set the minOccurs to 0 when the schema type is primitive.



> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796616#action_12796616 ] 

Mauro Molinari commented on AXIS2-3300:
---------------------------------------

This is acceptable and is ok for .NET >=2.0 compatibility, however consider that in this case the generated WSDL may not be usable to create suitable clients by .NET 1.x users. This should be documented in some way, so that if a Java developer using Axis2 must write web services that have to be invoked even by .NET 1.x clients, he will then be forced to opt for a contract-first approach. Actually, this is also the case right now, so the new behaviour wouldn't be worse than the current one in any case ;-)

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Charles Galpin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763990#action_12763990 ] 

Charles Galpin commented on AXIS2-3300:
---------------------------------------

Thanks Matthias. In my case I'm letting axis generate the WSDL dynamically from my POJO class and would like to keep it that way for ease of maintenance. But worst case I can generate and serve the static (edited) copy.

But it would be nice to see this fixed since a patch has been submitted a few months ago.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Chris van Es (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670354#action_12670354 ] 

Chris van Es commented on AXIS2-3300:
-------------------------------------

Hi, I'm currently in the process of testing changing minOccurs to 1 for primitive schema types in axis2 1.4.1, what's the process for submitting a patch for this issue?

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Nandana Mihindukulasooriya (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12670359#action_12670359 ] 

Nandana Mihindukulasooriya commented on AXIS2-3300:
---------------------------------------------------

Hi Chris,
          Create a diff of your changes against the current trunk and attach the patch here. When attaching please grant license to ASF for inclusion. Then a committer  will review it and apply it to the trunk. 

thanks,
nandana

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796085#action_12796085 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3300:
-----------------------------------------------------

I think we can not set the minOccurs=1 directly since it make that element mandatory.

The solution is to use an option (eg. setMinOccursAsOne) at the services.xml file.

is this fix your issue?

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


Re: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by Mauro Molinari <ma...@cardinis.com>.
WJ Krpelan ha scritto:
> Of course I understand your practical point exactly
> and I would very much appreciate easier DOTNET-compatibility too- however:
> 
> interoperability can realistically only be achieved in areas where standards have been established already (in our real world)
> For better or worse, there are no official WS-standards for expressing Null-Values of programming languages, DB-Nulls, and much more. (Nor will the two of us be able to establish it now, let alone enforce it - so again: outside of standards its up to the programmer methinks)
> 
> The central piece of a Web Service is, conceptually, a WSDL-definition (description of interface/contract)
> 
> I am sure a Web Service based on a WS-I conforming WSDL-definition can be called by DOTNET-Clients with no problem, same as by all other WS-I-conforming Clients. 
> (Otherwise twould be a Microsoft-bug)
> Ask Microsoft about it.
> WS-I was after all co-founded by Microsoft.
> 
> So pls demonstrate where exactly an AXIS-generated WSDL is not conforming to these standards. This really would be an AXIS-bug to attend to then.
> 
> Some new pseudostandard JAVA2DOTNET (which versions of each anyway, what about future developments?) is looking like a dead horse to me.
> Many of the webservices out there, and in fact, all public ones, have to be reachable by non DOTNET-clients. Maybe even yours - someday!

Hi Wolfgang,
personally I'm speaking after researching a lot about the whole WSDL 
1.1/XML Schema 1.0/SOAP 1.1 and WS-I Basic Profile 1.1 and implementing 
some webservices in Java to be called from both Java and .NET 1.1 and 
.NET 2.0 clients. What I'm writing here and in that bug report are the 
results of my trials, errors and solutions.

The point is: there are two valid conventions that can be used in XML 
Schema to represent an optional operation parameter in a WSDL 1.1 
service description. The first is by using minOccurs=0, the second is by 
using nillable=true. You may say neither of them are a perfect solution 
for expressing null-values of programming languages, however I don't see 
any particular reason for them not to be enough suited for most of the 
uses of "null". Given this, both of them are acceptable for the 
standards: what we are discussing here is when to use the former and 
when the latter to improve interoperability with .NET. I don't find any 
harm on this.

I know we're talking about .NET bugs, but .NET 1.1 and 2.0 are real 
world scenarios and they are used a lot: what should I reply to my 
customers when they ask me to give my WSDLs (generated from a Java 
application) and they can't generate their clients? "Upgrade your .NET 
version" (hoping it's fixed)? It would be great if this were so easy...

So, why can't Axis2 do it the smart way?

-- 
Mauro Molinari
Software Designer & Developer
E-mail: mauro.molinari@cardinis.com

Re: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by WJ Krpelan <kr...@yahoo.com>.
Mauro,

Of course I understand your practical point exactly
and I would very much appreciate easier DOTNET-compatibility too- however:

interoperability can realistically only be achieved in areas where standards have been established already (in our real world)
For better or worse, there are no official WS-standards for expressing Null-Values of programming languages, DB-Nulls, and much more. (Nor will the two of us be able to establish it now, let alone enforce it - so again: outside of standards its up to the programmer methinks)

The central piece of a Web Service is, conceptually, a WSDL-definition (description of interface/contract)

I am sure a Web Service based on a WS-I conforming WSDL-definition can be called by DOTNET-Clients with no problem, same as by all other WS-I-conforming Clients. 
(Otherwise twould be a Microsoft-bug)
Ask Microsoft about it.
WS-I was after all co-founded by Microsoft.

So pls demonstrate where exactly an AXIS-generated WSDL is not conforming to these standards. This really would be an AXIS-bug to attend to then.

Some new pseudostandard JAVA2DOTNET (which versions of each anyway, what about future developments?) is looking like a dead horse to me.
Many of the webservices out there, and in fact, all public ones, have to be reachable by non DOTNET-clients. Maybe even yours - someday!

Cheers Wolfgang

--- On Thu, 1/7/10, Mauro Molinari <ma...@cardinis.com> wrote:

> From: Mauro Molinari <ma...@cardinis.com>
> Subject: Re: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> To: axis-dev@ws.apache.org
> Date: Thursday, January 7, 2010, 12:16 PM
> WJ Krpelan ha scritto:
> > Dear ppl, I think this leads us nowhere. Webservices
> is neither JAVA
> > nor DOTNET nor PHP nor PERL-specific nor should
> it  be. Webservices
> > is expected to interoperate with all of them. How is
> this to be
> > accomplished? By adhering to the standards laid down
> for WSDL. So
> > PLEASE restrain yourself to using language constructs
> which can be
> > clearly defined within the reach of WSDL/XML-Schema,
> and keep it
> > simple on top of that. It is the JAVA-Programmers or
> > DOTNET-Programmers duty to guarantee that unproper
> values are not put
> > into WS-clients or WS-Server-stubs!! Cheers, Wolfgang
> 
> In an ideal world, I would perfectly agree with you.
> 
> In a real world, given the importance and market share of
> .NET, if tools provided by Axis2 don't let me write web
> services that are correctly callable by .NET clients, I
> would consider them to be completely useless.
> 
> Moreover, please notice that the discussion is all about
> adhering to the standards, but in the way that grants
> interoperation the most in real-world common scenarios.
> 
> -- Mauro Molinari
> Software Designer & Developer
> E-mail: mauro.molinari@cardinis.com
> 


      

Re: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by Mauro Molinari <ma...@cardinis.com>.
WJ Krpelan ha scritto:
> Dear ppl, I think this leads us nowhere. Webservices is neither JAVA
> nor DOTNET nor PHP nor PERL-specific nor should it  be. Webservices
> is expected to interoperate with all of them. How is this to be
> accomplished? By adhering to the standards laid down for WSDL. So
> PLEASE restrain yourself to using language constructs which can be
> clearly defined within the reach of WSDL/XML-Schema, and keep it
> simple on top of that. It is the JAVA-Programmers or
> DOTNET-Programmers duty to guarantee that unproper values are not put
> into WS-clients or WS-Server-stubs!! Cheers, Wolfgang

In an ideal world, I would perfectly agree with you.

In a real world, given the importance and market share of .NET, if tools 
provided by Axis2 don't let me write web services that are correctly 
callable by .NET clients, I would consider them to be completely useless.

Moreover, please notice that the discussion is all about adhering to the 
standards, but in the way that grants interoperation the most in 
real-world common scenarios.

-- 
Mauro Molinari
Software Designer & Developer
E-mail: mauro.molinari@cardinis.com

Re: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by WJ Krpelan <kr...@yahoo.com>.
Dear ppl,
I think this leads us nowhere.
Webservices is neither JAVA nor DOTNET nor PHP nor PERL-specific nor should it  be. Webservices is expected to interoperate with all of them. How is this to be accomplished?
By adhering to the standards laid down for WSDL.
So PLEASE restrain yourself to using language constructs which can be clearly defined within the reach of WSDL/XML-Schema, and keep it simple on top of that.
It is the JAVA-Programmers or DOTNET-Programmers duty to guarantee that unproper values are not put into WS-clients or WS-Server-stubs!!
Cheers, Wolfgang


--- On Thu, 1/7/10, Mauro Molinari (JIRA) <ji...@apache.org> wrote:

> From: Mauro Molinari (JIRA) <ji...@apache.org>
> Subject: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> To: axis-dev@ws.apache.org
> Date: Thursday, January 7, 2010, 11:24 AM
> 
>     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797580#action_12797580
> ] 
> 
> Mauro Molinari commented on AXIS2-3300:
> ---------------------------------------
> 
> I fear I am not really understanding your last
> intervention. Looking at the source code of
> org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator
> and your last patch quickly, it seems that nillable=true is
> actually specified whenever a type is not a primitive one.
> So this would actually mean that, after your patch, the
> behaviour would be the one you mentioned in your comment of
> 05/Jan/10 05:46 AM. 
> 
> If this is so, feel free to solve again this bug and sorry.
> I just understood that you opted for removing minOccurs=0
> without adding nillable=true for object type parameters.
> This is ok for me, however keep in mind that .NET 1.1
> compatibility will stay compromised.
> 
> > minOccurs="0" always generated by Java2WSDL - problems
> with .NET client generation
> >
> ----------------------------------------------------------------------------------
> >
> >             
>    Key: AXIS2-3300
> >             
>    URL: https://issues.apache.org/jira/browse/AXIS2-3300
> >         
>    Project: Axis2
> >          Issue Type: Bug
> >          Components: Tools
> >    Affects Versions: 1.3
> >            Reporter:
> Mauro Molinari
> >            Assignee:
> Deepal Jayasinghe
> >         Attachments:
> axis2-1.4.1.diff
> >
> >
> > When you try to expose a POJO as a webservice, suppose
> you have two Java methods with the following signatures:
> > public Integer a(String, Integer)
> > public String b(Integer, String) 
> > Java2WSDL adds the minOccurs="0" for each element of
> each complex type, both for the input parameters and for the
> output parameters. 
> > When generating clients using .NET WebService Studio
> 2.0, the result is the following:
> > - all the generated C# methods input parameters are
> doubled, except for the string ones: the doubled parameters
> are booleans whose meaning is: "is the previous parameter
> specified or not?"
> > - all the generated C# methods return parameters are
> void, except for the string ones
> > The actual result are clients with methods like
> these:
> > public void a(string, int, bool);
> > public string b(int, bool, string);
> > This is obviously a problem, particularly for the
> "void" return type.
> > If I remove minOccurs="0", clients are generated
> correctly by .NET WebService Studio 2.0.
> > The issue is this: why does Java2WSDL always adds
> minOccurs="0"? If its meaning were "it can be null", I think
> nillable="true" attribute should be more appropriate...
> Moreover, if I substitute Integer with int in the original
> Java class methods, minOccurs="0" is still added by
> Java2WSDL, even if an int cannot be null.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue
> online.
> 
> 


      

Re: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by WJ Krpelan <kr...@yahoo.com>.
Dear ppl,
I think this leads us nowhere.
Webservices is neither JAVA nor DOTNET nor PHP nor PERL-specific nor should it  be. Webservices is expected to interoperate with all of them. How is this to be accomplished?
By adhering to the standards laid down for WSDL.
So PLEASE restrain yourself to using language constructs which can be clearly defined within the reach of WSDL/XML-Schema, and keep it simple on top of that.
It is the JAVA-Programmers or DOTNET-Programmers duty to guarantee that unproper values are not put into WS-clients or WS-Server-stubs!!
Cheers, Wolfgang


--- On Thu, 1/7/10, Mauro Molinari (JIRA) <ji...@apache.org> wrote:

> From: Mauro Molinari (JIRA) <ji...@apache.org>
> Subject: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> To: axis-dev@ws.apache.org
> Date: Thursday, January 7, 2010, 11:24 AM
> 
>     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797580#action_12797580
> ] 
> 
> Mauro Molinari commented on AXIS2-3300:
> ---------------------------------------
> 
> I fear I am not really understanding your last
> intervention. Looking at the source code of
> org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator
> and your last patch quickly, it seems that nillable=true is
> actually specified whenever a type is not a primitive one.
> So this would actually mean that, after your patch, the
> behaviour would be the one you mentioned in your comment of
> 05/Jan/10 05:46 AM. 
> 
> If this is so, feel free to solve again this bug and sorry.
> I just understood that you opted for removing minOccurs=0
> without adding nillable=true for object type parameters.
> This is ok for me, however keep in mind that .NET 1.1
> compatibility will stay compromised.
> 
> > minOccurs="0" always generated by Java2WSDL - problems
> with .NET client generation
> >
> ----------------------------------------------------------------------------------
> >
> >             
>    Key: AXIS2-3300
> >             
>    URL: https://issues.apache.org/jira/browse/AXIS2-3300
> >         
>    Project: Axis2
> >          Issue Type: Bug
> >          Components: Tools
> >    Affects Versions: 1.3
> >            Reporter:
> Mauro Molinari
> >            Assignee:
> Deepal Jayasinghe
> >         Attachments:
> axis2-1.4.1.diff
> >
> >
> > When you try to expose a POJO as a webservice, suppose
> you have two Java methods with the following signatures:
> > public Integer a(String, Integer)
> > public String b(Integer, String) 
> > Java2WSDL adds the minOccurs="0" for each element of
> each complex type, both for the input parameters and for the
> output parameters. 
> > When generating clients using .NET WebService Studio
> 2.0, the result is the following:
> > - all the generated C# methods input parameters are
> doubled, except for the string ones: the doubled parameters
> are booleans whose meaning is: "is the previous parameter
> specified or not?"
> > - all the generated C# methods return parameters are
> void, except for the string ones
> > The actual result are clients with methods like
> these:
> > public void a(string, int, bool);
> > public string b(int, bool, string);
> > This is obviously a problem, particularly for the
> "void" return type.
> > If I remove minOccurs="0", clients are generated
> correctly by .NET WebService Studio 2.0.
> > The issue is this: why does Java2WSDL always adds
> minOccurs="0"? If its meaning were "it can be null", I think
> nillable="true" attribute should be more appropriate...
> Moreover, if I substitute Integer with int in the original
> Java class methods, minOccurs="0" is still added by
> Java2WSDL, even if an int cannot be null.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue
> online.
> 
> 


      

[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12797580#action_12797580 ] 

Mauro Molinari commented on AXIS2-3300:
---------------------------------------

I fear I am not really understanding your last intervention. Looking at the source code of org.apache.axis2.description.java2wsdl.DefaultSchemaGenerator and your last patch quickly, it seems that nillable=true is actually specified whenever a type is not a primitive one. So this would actually mean that, after your patch, the behaviour would be the one you mentioned in your comment of 05/Jan/10 05:46 AM. 

If this is so, feel free to solve again this bug and sorry. I just understood that you opted for removing minOccurs=0 without adding nillable=true for object type parameters. This is ok for me, however keep in mind that .NET 1.1 compatibility will stay compromised.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Amila Chinthaka Suriarachchi (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796621#action_12796621 ] 

Amila Chinthaka Suriarachchi commented on AXIS2-3300:
-----------------------------------------------------

I have started a new discussion regarding this on the dev list. please comment on it.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796149#action_12796149 ] 

Mauro Molinari commented on AXIS2-3300:
---------------------------------------

It sounds like a dirty workaround rather than a real solution.

First of all: a String parameter for instance (see my table (*) below) can be marked as nillable=true (rather than minOccurs=0) because it is handled correctly even by any .NET client generator.

Second: Java primitive types (ex.: int) could be translated into minOccurs=1 because they cannot be null, so they must be mandatory. This can fix the problem with a POJO method that returns an int, for example.

The actual problem is with types like Integer or Date/Calendar, for which .NET 1.x clients can have issues if they are generated from a WSDL that specifies nillable=true rather than minOccurs=0. Actually, if we talk about method input parameters, it is safe to use minOccurs=0, but this then leads to the unconfortable double-parameter pattern generated by the .NET WSDL to code translator. However, if we talk about the method return parameters, minOccurs=0 still leads to the void return parameter type problem.

With .NET 2.0 on, there is no problem to use nillable=true for any kind of parameter (even Integer, Date/Calendar, etc.).

So, I think the best way to solve this issue is to do the following:
1) for Java primitive types, always use minOccurs=1
2) otherwise, use nillable=true for parameters of  type other than Byte/Integer/Double/Date/Calendar/Boolean/BigDecimal/Float/Long/Short/org.apache.axis2.databinding.types.Time(*)
3) for parameters of type Byte/Integer/Double/Date/Calendar/Boolean/BigDecimal/Float/Long/Short/org.apache.axis2.databinding.types.Time(*), provide an option in services.xml (or by using an annotation directly in the Java source code?) like the following:

dotNet1CompatibilityMode

Then apply the following:
- if dotNet1CompatibilityMode=false, then always use nillable=true
- if dotNet1CompatibilityMode=true, then use minOccurs=0 for method input parameters, but use minOccurs=1 for method return types; I know the latter case does not perfectly match the meaning of the Java code, but this to avoid the .NET code generation problem. Of course this has to be well documented and the Java developer must keep it in mind when he codes the actual service implementation; a null return value might then be translated by the Axis2 stack to a fault during runtime.

(*) This is the actual translation table of the simple types:

XML Schema | Java | C#
xsd:boolean | boolean - java.lang.Boolean | bool
xsd:byte | byte - java.lang.Byte | sbyte
xsd:date | java.util.Date | System.DateTime
xsd:dateTime | java.util.Calendar | System.DateTime
xsd:decimal | java.math.BigDecimal | decimal
xsd:double | double - java.lang.Double | System.Double (.NET 1.1) - double (.NET 2.0)
xsd:float | float - java.lang.Float | float
xsd:int | int/java.lang.Integer | int
xsd:long | long - java.lang.Long | long
xsd:QName | javax.xml.namespace.QName | System.Xml.XmlQualifiedName
xsd:short | short - java.lang.Short | short
xsd:string | java.lang.String | string
xsd:time | org.apache.axis2.databinding.types.Time | System.DateTime

The problem with C# types bool, sbyte, System.DateTime, decimal, System.Double, float, long and short (but not string!) is that these are something like "primitive types" that cannot be null in .NET 1.x. This is why a WSDL that specifies nillable=true for parameters of the corresponding XML Schema Types are not correctly translated by .NET 1.x client generators and minOccurs=0 must be used instead in order to make them correctly handled. The trick they use to specify if an optional (minOccurs=0) parameter of one of these types has actually been specified or not, is to use the "double-parameter" pattern mentioned in my bug report.

I hope this is of help.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Reopened: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mauro Molinari reopened AXIS2-3300:
-----------------------------------


If I understand it right, you chose to use minOccurs=1 (which is the default if no minOccurs is specified) in ANY case.

This is not good.

As I wrote in the dev list, in this way if you start from a Java code like this:

public Integer methodA(Integer a);

which supports a null input parameter and can return a null output value, Java2WSDL will then create a WSDL with both input and output parameters without any minOccurs attribute (=> minOccurs=1).

Then, if you try to generate an Axis2 client from that WSDL using WSDL2Java, you'll then end up with a Java method like this:

public int methodA(int a);

This because both the input and output parameters are declared as mandatory.

In this case the Axis2 client wouldn't be able to specify "null" as input parameter and won't be able to handle null as an output parameter! And please, don't say that the developer can use the ugly Axis2 convention that Integer.MIN_VALUE is considered to be null!!!

Actually, thinking a little deeper on this, I think that an error would be generated even sooner if the service implementation of methodA returns null, because the Axis2 stack would have to transmit a "null" as the operation return value, but that operation was declared as mandatory in the WSDL...

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Girish Khemani (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12645175#action_12645175 ] 

Girish Khemani commented on AXIS2-3300:
---------------------------------------

Please can you let me know the status of this.

Is this getting fixed.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org


[jira] Updated: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Chris van Es (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chris van Es updated AXIS2-3300:
--------------------------------

    Attachment: axis2-1.4.1.diff

This has been built successfully, running all tests, against the 1.4 branch and I've verified that minOccurs="0" is now no longer the default for primitive schema types in auto-generated wsdl. I haven't been able to verify that this is an issue in the trunk as there appears to be some substantial changes in DefaultSchemaGenerator.java.

Chris.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Matthias Gaiser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763877#action_12763877 ] 

Matthias Gaiser commented on AXIS2-3300:
----------------------------------------

As far as I've seen it in the current axis-2.1.5 release and the current sources there is still setMinOccurs(0) in it (unless I am missing something here). I am generating the wsdl with java2wsdl and perform an xsl transformation on it to remove all minOccurs="0".

Maybe that's a possible solution for you as well, Charles.

Matthias.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Chris van Es (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736053#action_12736053 ] 

Chris van Es commented on AXIS2-3300:
-------------------------------------

I patched the DefaultSchemaGenerator in that fashion and we haven't had any problems to date.

Chris.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Matthias Gaiser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12763991#action_12763991 ] 

Matthias Gaiser commented on AXIS2-3300:
----------------------------------------

I totally agree to you, Charles.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Mauro Molinari (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12796150#action_12796150 ] 

Mauro Molinari commented on AXIS2-3300:
---------------------------------------

Just a little addition: I think the default value for dotNet1CompatibilityMode (if not specified) should be false, because it is meant to handle a very specific case (that is: support .NET 1.x clients).

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis2
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Matthias Gaiser (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12736041#action_12736041 ] 

Matthias Gaiser commented on AXIS2-3300:
----------------------------------------

Are there any changes in this subject? I still see minOccurs="0" getting generated for Axis2.1.5. The diff suggested to replace setMinOccurs(0) with setMinOccurs(1) in the DefaultSchemaGenerator. Is there anything that is against it?

Hoping for a soon solution!

Matthias.

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


Re: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by WJ Krpelan <kr...@yahoo.com>.
Hi,
well, dont expect anything but "WSDL-first" to work reliably in interoperability scenarious - ever!
i dont think adopting java2wsdl to some micro* style would be a good idea,  because it would break interoperability elsewhere!
Cheers, Wolfgang

--- On Mon, 11/2/09, Charles Galpin (JIRA) <ji...@apache.org> wrote:

> From: Charles Galpin (JIRA) <ji...@apache.org>
> Subject: [jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> To: axis-dev@ws.apache.org
> Date: Monday, November 2, 2009, 9:12 PM
> 
>     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772637#action_12772637
> ] 
> 
> Charles Galpin commented on AXIS2-3300:
> ---------------------------------------
> 
> Well it turns out there is a bug when serving the static
> copy of my WSDL so I have no work around for this bug. 
> 
> Can you give us an idea of when this might be included
> Deepal?
> 
> thanks,
> charles
> 
> > minOccurs="0" always generated by Java2WSDL - problems
> with .NET client generation
> >
> ----------------------------------------------------------------------------------
> >
> >             
>    Key: AXIS2-3300
> >             
>    URL: https://issues.apache.org/jira/browse/AXIS2-3300
> >         
>    Project: Axis 2.0 (Axis2)
> >          Issue Type: Bug
> >          Components: Tools
> >    Affects Versions: 1.3
> >            Reporter:
> Mauro Molinari
> >            Assignee:
> Deepal Jayasinghe
> >         Attachments:
> axis2-1.4.1.diff
> >
> >
> > When you try to expose a POJO as a webservice, suppose
> you have two Java methods with the following signatures:
> > public Integer a(String, Integer)
> > public String b(Integer, String) 
> > Java2WSDL adds the minOccurs="0" for each element of
> each complex type, both for the input parameters and for the
> output parameters. 
> > When generating clients using .NET WebService Studio
> 2.0, the result is the following:
> > - all the generated C# methods input parameters are
> doubled, except for the string ones: the doubled parameters
> are booleans whose meaning is: "is the previous parameter
> specified or not?"
> > - all the generated C# methods return parameters are
> void, except for the string ones
> > The actual result are clients with methods like
> these:
> > public void a(string, int, bool);
> > public string b(int, bool, string);
> > This is obviously a problem, particularly for the
> "void" return type.
> > If I remove minOccurs="0", clients are generated
> correctly by .NET WebService Studio 2.0.
> > The issue is this: why does Java2WSDL always adds
> minOccurs="0"? If its meaning were "it can be null", I think
> nillable="true" attribute should be more appropriate...
> Moreover, if I substitute Integer with int in the original
> Java class methods, minOccurs="0" is still added by
> Java2WSDL, even if an int cannot be null.
> 
> -- 
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue
> online.
> 
> 


      

[jira] Commented: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Charles Galpin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12772637#action_12772637 ] 

Charles Galpin commented on AXIS2-3300:
---------------------------------------

Well it turns out there is a bug when serving the static copy of my WSDL so I have no work around for this bug. 

Can you give us an idea of when this might be included Deepal?

thanks,
charles

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>         Attachments: axis2-1.4.1.diff
>
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

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


[jira] Assigned: (AXIS2-3300) minOccurs="0" always generated by Java2WSDL - problems with .NET client generation

Posted by "Deepal Jayasinghe (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/AXIS2-3300?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Deepal Jayasinghe reassigned AXIS2-3300:
----------------------------------------

    Assignee: Deepal Jayasinghe

> minOccurs="0" always generated by Java2WSDL - problems with .NET client generation
> ----------------------------------------------------------------------------------
>
>                 Key: AXIS2-3300
>                 URL: https://issues.apache.org/jira/browse/AXIS2-3300
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: Tools
>    Affects Versions: 1.3
>            Reporter: Mauro Molinari
>            Assignee: Deepal Jayasinghe
>
> When you try to expose a POJO as a webservice, suppose you have two Java methods with the following signatures:
> public Integer a(String, Integer)
> public String b(Integer, String) 
> Java2WSDL adds the minOccurs="0" for each element of each complex type, both for the input parameters and for the output parameters. 
> When generating clients using .NET WebService Studio 2.0, the result is the following:
> - all the generated C# methods input parameters are doubled, except for the string ones: the doubled parameters are booleans whose meaning is: "is the previous parameter specified or not?"
> - all the generated C# methods return parameters are void, except for the string ones
> The actual result are clients with methods like these:
> public void a(string, int, bool);
> public string b(int, bool, string);
> This is obviously a problem, particularly for the "void" return type.
> If I remove minOccurs="0", clients are generated correctly by .NET WebService Studio 2.0.
> The issue is this: why does Java2WSDL always adds minOccurs="0"? If its meaning were "it can be null", I think nillable="true" attribute should be more appropriate... Moreover, if I substitute Integer with int in the original Java class methods, minOccurs="0" is still added by Java2WSDL, even if an int cannot be null.

-- 
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: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org