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 WJ Krpelan <kr...@yahoo.com> on 2009/07/31 11:33:03 UTC

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


      

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