You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Moss, Andy" <am...@Informatica.com> on 2006/07/12 13:32:51 UTC

.NET 2 System.Nullable always returns null

We are using Axis 1.1 with a C# .NET 2 client. A snippet of the WSDL and
a snippet of the generated C# proxy class is given at the end of this
mail.

In the WSDL the element 'type' is declared as nillable="true", which in
the C# proxy class is translated to the following:

[System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
public System.Nullable<IASReportType> type {
       get {
      	return this.typeField;
       }
      set {
      	this.typeField = value;
       }
}

When we call our C# .NET 2 client, we expect the value 'ON_DEMAND' to be
returned for the typeField but null is returned.

Removing the System.Nullable syntax so that the method signature reads
public IASReportType type solves the problem i.e. 'ON_DEMAND' is
returned as the value

Does anyone have any explanation and/or a solution for this problem? 

Thank you.

WSDL
====

<complexType name="IASReportDefinition">
	<complexContent>
		<extension base="tns15:IASBusinessObject">
			<sequence>
				<element name="type" nillable="true"
type="tns6:IASReportType"/>
			</sequence>
		</extension>
	</complexContent>
</complexType>



C# Proxy class 
==============

    [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl",
"2.0.50727.42")]
    [System.SerializableAttribute()]
    [System.Diagnostics.DebuggerStepThroughAttribute()]
    [System.ComponentModel.DesignerCategoryAttribute("code")]
 
[System.Xml.Serialization.SoapTypeAttribute(Namespace="http://report.ser
vices.api4.ias.informatica.com")]
    public partial class IASReportDefinition : IASBusinessObject {

        private System.Nullable<IASReportType> typeField;

        /// <remarks/>
        [System.Xml.Serialization.SoapElementAttribute(IsNullable=true)]
        public System.Nullable<IASReportType> type {
            get {
                return this.typeField;
            }
            set {
                this.typeField = value;
            }
        }
    }


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org