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 "Samuel (JIRA)" <ji...@apache.org> on 2008/10/29 18:42:44 UTC

[jira] Created: (AXIS2-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

WSDL2Java: minOccurs="0" on primitive types doesn't work properly
-----------------------------------------------------------------

                 Key: AXIS2-4108
                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
             Project: Axis 2.0 (Axis2)
          Issue Type: Bug
          Components: adb
    Affects Versions: 1.4.1
         Environment: Windows XP
Eclipse Version: 3.3.2 Build id: M20080221-1800
Apache Axis2 1.4.1 build  (13-08-2008)
            Reporter: Samuel
            Priority: Critical


When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :

	<xsd:complexType name="Frids_GetFundInType">
		<xsd:sequence>
			<xsd:element maxOccurs="1" minOccurs="0"
				name="fund_id"
				type="xsd:int">
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>

I'm getting an int variable that can not be set to null.
In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :


	/**
	 * Auto generated getter method
	 * 
	 * @return int
	 */
	public int getId() {
		return localId;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            Id
	 */
	public void setId(int param) {

		// setting primitive attribute tracker to true

		if (param == java.lang.Integer.MIN_VALUE) {
			localIdTracker = false;

		} else {
			localIdTracker = true;
		}

		this.localId = param;

	}


So, if I correctly understand, if a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
Furthermore, in my server code, how can I check if this field is null or not ? I can not write if myVariable.fund_id == null (an int can not be null) and the xxxTracker variable is protected...

I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...

If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)

Thanks

-- 
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-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

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

please use -uwc option. this would generate the Integer instead of int.

> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

Samuel updated AXIS2-4108:
--------------------------

    Description: 
When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
-----------------------------------------------------------------------------
	<xsd:complexType name="Frids_GetFundInType">
		<xsd:sequence>
			<xsd:element maxOccurs="1" minOccurs="0"
				name="fund_id"
				type="xsd:int">
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>
-----------------------------------------------------------------------------
I'm getting an int variable that can not be set to null.
In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :


-----------------------------------------------------------------------------
	/**
	 * Auto generated getter method
	 * 
	 * @return int
	 */
	public int getId() {
		return localId;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            Id
	 */
	public void setId(int param) {

		// setting primitive attribute tracker to true

		if (param == java.lang.Integer.MIN_VALUE) {
			localIdTracker = false;

		} else {
			localIdTracker = true;
		}

		this.localId = param;

	}

-----------------------------------------------------------------------------

So, if I correctly understand the code :
- If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
- I can not check if this field is null or not : 
-----------------------------------------------------------------------------
I can not write if (myVariable.fund_id == null){
 then...
}
-----------------------------------------------------------------------------
as an int can not be null, and the xxxTracker variable is protected...

I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...

If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)

Thanks

  was:
When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :

	<xsd:complexType name="Frids_GetFundInType">
		<xsd:sequence>
			<xsd:element maxOccurs="1" minOccurs="0"
				name="fund_id"
				type="xsd:int">
			</xsd:element>
		</xsd:sequence>
	</xsd:complexType>

I'm getting an int variable that can not be set to null.
In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :


	/**
	 * Auto generated getter method
	 * 
	 * @return int
	 */
	public int getId() {
		return localId;
	}

	/**
	 * Auto generated setter method
	 * 
	 * @param param
	 *            Id
	 */
	public void setId(int param) {

		// setting primitive attribute tracker to true

		if (param == java.lang.Integer.MIN_VALUE) {
			localIdTracker = false;

		} else {
			localIdTracker = true;
		}

		this.localId = param;

	}


So, if I correctly understand, if a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
Furthermore, in my server code, how can I check if this field is null or not ? I can not write if myVariable.fund_id == null (an int can not be null) and the xxxTracker variable is protected...

I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...

If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)

Thanks


> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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] Issue Comment Edited: (AXIS2-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

samlemarnais edited comment on AXIS2-4108 at 11/12/08 1:35 AM:
---------------------------------------------------------

Hi, 
When using the "uwc" ADB parameter (-Euwc wsdl2java parameter), the generated source code loose its Java1.4 compatibility !!!
The reason is that the SAOP decoder is a "fake" ;)
It convert the String to an int and then "automatically" cast it to an Integer (Java5 new functionnality)...
Moreover, what if the String is null or empty (nillable element) ?

This is the ****************** JAVA 1.4 NON COMPATIBLE ********************** generated code is here (implicit cast from int to Integer) :

--------------------------------------------------------------------------
				if (reader.isStartElement() && new javax.xml.namespace.QName("", "fundId").equals(reader.getName()))
				{
					
					java.lang.String content = reader.getElementText();
					
					object.setFundId(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content));     <------- implicit conversion. Function signature : public void setFundId(java.lang.Integer param)
					
					reader.next();
					
				} // End of if for expected property start element
--------------------------------------------------------------------------

Work Arround :
I think that the method "org.apache.axis2.databinding.utils.ConverterUtil.convertToInt" should be replaced by "org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger".

I didn't try other simple types (boolean, etc.) I think the same problem occurs...

      was (Author: samlemarnais):
    Hi, 
When using the "uwc" ADB parameter (-Euwc wsdl2java parameter), the generated source code loose its Java1.4 compatibility !!!
The reason is that the SAOP decoder is a "fake" ;)
It convert the String to an int and then "automatically" cast it to an Integer (Java5 new functionnality)...
Moreover, what if the String is null or empty (nillable element) ?

This is the ****************** JAVA 1.4 NON COMPATIBLE ********************** generated code is here (implicit cast from int to Integer) :

--------------------------------------------------------------------------
				if (reader.isStartElement() && new javax.xml.namespace.QName("", "fundId").equals(reader.getName()))
				{
					
					java.lang.String content = reader.getElementText();
					
					object.setFundId(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content));     <------- implicit conversion. Function signature : public void setFundId(java.lang.Integer param)
					
					reader.next();
					
				} // End of if for expected property start element
--------------------------------------------------------------------------

Axis2 is officially known to be java1.4 compatible isn't it ?
  
> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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] Issue Comment Edited: (AXIS2-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

samlemarnais edited comment on AXIS2-4108 at 10/31/08 3:14 AM:
---------------------------------------------------------

With this AXIS2 Standard Binary Distribution version (the last one exposed by the web site) :
Apache Axis2 1.4.1 build (13-08-2008) 

Downloaded here :
http://ws.apache.org/axis2/download/1_4_1/download.cgi

The wsdl2java's argument "-uwc" is not recognized...

To be sure, I have downloaded this source version of AXIS2 (the last one exposed by the web site) :
Apache Axis2 1.4.1 build (21-08-2008)

By looking into the source code, I found the class (org.apache.axis2.util.CommandLineOptionConstants) where available options are declared and I didn't found "uwc".

What can I do ?
I'm sorry, but my project is going to be in late so I need a your help as quickly as possible :(

Thanks

      was (Author: samlemarnais):
    With this AXIS2 Standard Binary Distribution version (the last one exposed by the web site) :
Apache Axis2 1.4.1 build (13-08-2008) 

Downloaded here :
http://ws.apache.org/axis2/download/1_4_1/download.cgi

The wsdl2java's argument "-uwc" is not recognized...

To be sure, I have downloaded this source version of AXIS2 (the last one exposed by the web site) :
Apache Axis2 1.4.1 build (21-08-2008)

By looking into the source code, I found the class where options are declared and I didn't found "uwc".

What can I do ?
I'm sorry, but my project is going to be in late so I need a your help as quickly as possible :(

Thanks
  
> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

Samuel commented on AXIS2-4108:
-------------------------------

I'm sorry to bother you, but I'm in late for my project. Do I have to write a new Issue to have a response to my last question ?
I think that existing issues are not watched. (comparing the first response I first had with the "no response" I have now).
I don't want to spam the tracker, but if only the new Issues are watched, I think it's the only way I have to get an answer... 

Am I right ?

> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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] Issue Comment Edited: (AXIS2-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

samlemarnais edited comment on AXIS2-4108 at 10/31/08 2:50 AM:
---------------------------------------------------------

With this AXIS2 Standard Binary Distribution version :
Apache Axis2 1.4.1 build (13-08-2008) 

Downloaded here :
http://ws.apache.org/axis2/download/1_4_1/download.cgi

The wsdl2java's argument "-uwc" is not recognized...

      was (Author: samlemarnais):
    With this AXIS2 version (found in "README.txt" and "release-notes.html") :
Apache Axis2 1.4.1 build (13-08-2008) 

Downloaded here :
http://ws.apache.org/axis2/download/1_4_1/download.cgi

The wsdl2java's argument "-uwc" is not recognied...
  
> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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] Issue Comment Edited: (AXIS2-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

samlemarnais edited comment on AXIS2-4108 at 10/31/08 3:13 AM:
---------------------------------------------------------

With this AXIS2 Standard Binary Distribution version (the last one exposed by the web site) :
Apache Axis2 1.4.1 build (13-08-2008) 

Downloaded here :
http://ws.apache.org/axis2/download/1_4_1/download.cgi

The wsdl2java's argument "-uwc" is not recognized...

To be sure, I have downloaded this source version of AXIS2 (the last one exposed by the web site) :
Apache Axis2 1.4.1 build (21-08-2008)

By looking into the source code, I found the class where options are declared and I didn't found "uwc".

What can I do ?
I'm sorry, but my project is going to be in late so I need a your help as quickly as possible :(

Thanks

      was (Author: samlemarnais):
    With this AXIS2 Standard Binary Distribution version :
Apache Axis2 1.4.1 build (13-08-2008) 

Downloaded here :
http://ws.apache.org/axis2/download/1_4_1/download.cgi

The wsdl2java's argument "-uwc" is not recognized...
  
> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

Samuel commented on AXIS2-4108:
-------------------------------

Thank you very much Amila. It works !

I still don't understand why this option is not set by default. 
The current default behavior is a bug in my mind : set "Integer.MINVALUE" to mark it as "null", it is not serious !
In addition, it makes every generators wizard (WTP, Axis2Generator, etc.) badly working...

Despite this, I thank you one more time for your pretty quick answer.

Sam

> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

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

sorry you need to use it as -Euwc

when you pass data binding framework specific parameters you need to use -E.


> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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] Resolved: (AXIS2-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

Amila Chinthaka Suriarachchi resolved AXIS2-4108.
-------------------------------------------------

    Resolution: Fixed

since Axis2 1.5 is going to base on java 1.5 or higher this issue is no longer valid.

> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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] Assigned: (AXIS2-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

Deepal Jayasinghe reassigned AXIS2-4108:
----------------------------------------

    Assignee: Amila Chinthaka Suriarachchi

> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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] Issue Comment Edited: (AXIS2-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

samlemarnais edited comment on AXIS2-4108 at 11/12/08 1:37 AM:
---------------------------------------------------------

Hi, 
When using the "uwc" ADB parameter (-Euwc wsdl2java parameter), the generated source code loose its Java1.4 compatibility !!!
The reason is that the SAOP does not differenciate int and Integer. 
It convert the String to an int and then "automatically" cast it to an Integer (Java5 new functionnality)...
Moreover, what if the String is null or empty (nillable element) ?

This is the ****************** JAVA 1.4 NON COMPATIBLE ********************** generated code is here (implicit cast from int to Integer) :

--------------------------------------------------------------------------
				if (reader.isStartElement() && new javax.xml.namespace.QName("", "fundId").equals(reader.getName()))
				{
					
					java.lang.String content = reader.getElementText();
					
					object.setFundId(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content));     <------- implicit conversion. Function signature : public void setFundId(java.lang.Integer param)
					
					reader.next();
					
				} // End of if for expected property start element
--------------------------------------------------------------------------

Work Arround :
I think that the method "org.apache.axis2.databinding.utils.ConverterUtil.convertToInt" should be replaced by "org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger".

I didn't try other simple types (boolean, etc.) I think the same problem occurs...

      was (Author: samlemarnais):
    Hi, 
When using the "uwc" ADB parameter (-Euwc wsdl2java parameter), the generated source code loose its Java1.4 compatibility !!!
The reason is that the SAOP decoder is a "fake" ;)
It convert the String to an int and then "automatically" cast it to an Integer (Java5 new functionnality)...
Moreover, what if the String is null or empty (nillable element) ?

This is the ****************** JAVA 1.4 NON COMPATIBLE ********************** generated code is here (implicit cast from int to Integer) :

--------------------------------------------------------------------------
				if (reader.isStartElement() && new javax.xml.namespace.QName("", "fundId").equals(reader.getName()))
				{
					
					java.lang.String content = reader.getElementText();
					
					object.setFundId(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content));     <------- implicit conversion. Function signature : public void setFundId(java.lang.Integer param)
					
					reader.next();
					
				} // End of if for expected property start element
--------------------------------------------------------------------------

Work Arround :
I think that the method "org.apache.axis2.databinding.utils.ConverterUtil.convertToInt" should be replaced by "org.apache.axis2.databinding.utils.ConverterUtil.convertToInteger".

I didn't try other simple types (boolean, etc.) I think the same problem occurs...
  
> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

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

yes this feature only available with java 1.5. 
you may change the source code if you need to compatible it with java 1.4 as you have mentioned.

> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

Samuel commented on AXIS2-4108:
-------------------------------

With this AXIS2 version (found in "README.txt" and "release-notes.html") :
Apache Axis2 1.4.1 build (13-08-2008) 

Downloaded here :
http://ws.apache.org/axis2/download/1_4_1/download.cgi

The wsdl2java's argument "-uwc" is not recognied...

> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

-- 
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-4108) WSDL2Java: minOccurs="0" on primitive types doesn't work properly

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

Samuel commented on AXIS2-4108:
-------------------------------

Hi, 
When using the "uwc" ADB parameter (-Euwc wsdl2java parameter), the generated source code loose its Java1.4 compatibility !!!
The reason is that the SAOP decoder is a "fake" ;)
It convert the String to an int and then "automatically" cast it to an Integer (Java5 new functionnality)...
Moreover, what if the String is null or empty (nillable element) ?

This is the ****************** JAVA 1.4 NON COMPATIBLE ********************** generated code is here (implicit cast from int to Integer) :

--------------------------------------------------------------------------
				if (reader.isStartElement() && new javax.xml.namespace.QName("", "fundId").equals(reader.getName()))
				{
					
					java.lang.String content = reader.getElementText();
					
					object.setFundId(org.apache.axis2.databinding.utils.ConverterUtil.convertToInt(content));     <------- implicit conversion. Function signature : public void setFundId(java.lang.Integer param)
					
					reader.next();
					
				} // End of if for expected property start element
--------------------------------------------------------------------------

Axis2 is officially known to be java1.4 compatible isn't it ?

> WSDL2Java: minOccurs="0" on primitive types doesn't work properly
> -----------------------------------------------------------------
>
>                 Key: AXIS2-4108
>                 URL: https://issues.apache.org/jira/browse/AXIS2-4108
>             Project: Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: adb
>    Affects Versions: 1.4.1
>         Environment: Windows XP
> Eclipse Version: 3.3.2 Build id: M20080221-1800
> Apache Axis2 1.4.1 build  (13-08-2008)
>            Reporter: Samuel
>            Assignee: Amila Chinthaka Suriarachchi
>            Priority: Critical
>
> When I'm generating Java classes with wsdl2java (using eclipse WTP plugin) from this part of xsd :
> -----------------------------------------------------------------------------
> 	<xsd:complexType name="Frids_GetFundInType">
> 		<xsd:sequence>
> 			<xsd:element maxOccurs="1" minOccurs="0"
> 				name="fund_id"
> 				type="xsd:int">
> 			</xsd:element>
> 		</xsd:sequence>
> 	</xsd:complexType>
> -----------------------------------------------------------------------------
> I'm getting an int variable that can not be set to null.
> In the class "Frids_GetFundInType" (generated by wsdl2java), I see this :
> -----------------------------------------------------------------------------
> 	/**
> 	 * Auto generated getter method
> 	 * 
> 	 * @return int
> 	 */
> 	public int getId() {
> 		return localId;
> 	}
> 	/**
> 	 * Auto generated setter method
> 	 * 
> 	 * @param param
> 	 *            Id
> 	 */
> 	public void setId(int param) {
> 		// setting primitive attribute tracker to true
> 		if (param == java.lang.Integer.MIN_VALUE) {
> 			localIdTracker = false;
> 		} else {
> 			localIdTracker = true;
> 		}
> 		this.localId = param;
> 	}
> -----------------------------------------------------------------------------
> So, if I correctly understand the code :
> - If a client set a value equal to "Integer.MIN_VALUE", my server will think that he didn't set this field.
> - I can not check if this field is null or not : 
> -----------------------------------------------------------------------------
> I can not write if (myVariable.fund_id == null){
>  then...
> }
> -----------------------------------------------------------------------------
> as an int can not be null, and the xxxTracker variable is protected...
> I seen a similar bug marked as fixed but I've download the last release 2 days ago and this samples are from this version...
> If it's really fixed, can you tell me how can I have the good version (and its number) and what do I have to do (is it automatically corrected ?)
> Thanks

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