469,568 Members | 1,445 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

Calling a web service with nillable Value Types

Hi!

I'm calling a web service using C# and a wrapper class generated by
wsdl tool. The web service specification contains some nillable
parameters which types are Value Types in .NET (long, int, Decimal,
....) and I must to send them as null, and not their default value. It
is possible? Is there any trick to succeed it?

Thanks in advance,

Marc.
Nov 21 '05 #1
8 6919
check this out for a possible answer

http://www.mcse.ms/message908331.html
Nov 21 '05 #3
Thanks a lot for your response, I've tried to put the new parameter
(xxxSpecified) in the class and the solutions builds correctly. But
when I try to execute, at the moment I create the class which inherits
from System.Web.Services.Protocols.SoapHttpClientProtoc ol, .NET
debugger throws me the following exception:

"Excepción no controlada del tipo 'System.IO.FileNotFoundException' en
mscorlib.dll

Información adicional: File or assembly name a4fnoqyx.dll, or one of
its dependencies, was not found."

The name of DLL is always different.

I think that I can't modify the wrapper class generated by WSDL, but
then how can I send null Value Types to the web service?

Thanks again for our attention,

Marc.

di****@online.microsoft.com (dino chiesa) wrote in message news:<vb**************@cpmsftngxa10.phx.gbl>...
check this out for a possible answer

http://www.mcse.ms/message908331.html
--

Nov 21 '05 #4
Doc,

do me a favor.
Examine the Schema that is enclosed at the bottom of this message, you will
see that the data elements are attributed with:
minOccurs="0" nillable="true"

When these data elements are "nil", the XML is not passed at all.
Run that schema through the schema tool (xsd.exe) with the /c switch, and
look at what you get. The programming model is then :

if (o.IDSpecified) {
// ID was specified
}
else {
// ID was null (the element was not specified at all)
}

--
Now, if an element in your schema includes minOccurs="1" nillable="true",
then you have a trickier situation. In this case valid XML may be
something like:
<DataElement xsi:nil="true" />

That is, the DataElement is specified, but no value for it is passed. In
this case the default behavior of the XML serializer in .NET is to choke.
The classes you generate (either through xsd.exe, wsdl.exe, or Add Web Ref
in Visual Studio) will not properly handle these cases. To deal with this,
You need to do some special handling in the class.

For this I direct you to an example that illustrates the workaround.
http://www.winisp.net/cheeso/srcview...n&file=XsiNilD
ate.cs

---

The FileNotFound problem seems like it is a different issue. It can occur
for a number of reasons.
Can we see the WSDL you are using?

-Dino
--------schema starts here -------
<schema
elementFormDefault="qualified"
targetNamespace="urn:The-Schema-target-namespace"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/2001/XMLSchema"


<element name="Type1">
<complexType>
<sequence>
<element minOccurs="0" maxOccurs="1" name="ID" nillable="true"
type="xsd:int" />
<element minOccurs="0" maxOccurs="1" name="Stamp" nillable="true"
type="xsd:dateTime" />
<element minOccurs="0" maxOccurs="1" name="Amount" nillable="true"
type="xsd:decimal" />
</sequence>
</complexType>
</element>

</schema>

-------- schema ends here ---------------------
Nov 21 '05 #5
Hi Dino,

I've send (by email) the wsdl url and the class generated by wsdl tool
in my computer. You will see that WSDL haven't generated the
xxxSpecified attribute for every nillable attribute. So, I can send
null values for the attributes like long, int, ... When I try to write
manually the attributes (xxxSpecified), then the execution throws me
an error (which is mentioned in a previous message,
FileNotFoundException).

So, my question is, how can I modify manually the class generated by
wsdl in order to serialize null Value Types needed for the web
service?

Thanks again,

Marc.
Nov 21 '05 #6
Hi again dino,

I've tried to send you a message with the wsdl url and other info, but
I suppose your email address isn't reachable. Well I'll post it in
this newsgroup:

The wsdl url is http://was.test.fiatc.es/autos/services/wsAutos?wsdl
and the class generated by wsdl tool (.NET Framework Version
1.1.4322.573) is at end of the message with the log generated.

--
Looking the class, for example the field polizaSubstituida, is
<element name="polizaSubstituida" nillable="true" type="xsd:long" />
the field generated is
public long polizaSubstituida;

when I add the following field in AutosServiceService.cs
[System.Xml.Serialization.XmlIgnoreAttribute()]
public bool polizaSubstituidaSpecified;

then when I try to create the class AutosServiceService
AutosServiceService ass = new AutosServiceService();

the application throws me the exception
Excepción no controlada del tipo 'System.IO.FileNotFoundException' en
mscorlib.dll

Información adicional: File or assembly name x9udkba3.dll, or one of
its dependencies, was not found.

but without the xxxSpecified field the application works fine (well it
can't send null values :-(). What can I do?

Thanks a lot,

Marc.

<---- WSDL output message starts here ---->
Microsoft (R) Web Services Description Language Utility
[Microsoft (R) .NET Framework, Version 1.1.4322.573]
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Schema validation warning: Namespace
'http://was.test.fiatc.es/autos/services/wsAutos' is not available to
be referenced in this schema.
Schema validation warning: Namespace
'http://was.test.fiatc.es/autos/services/wsAutos' is not available to
be referenced in this schema.
Schema validation warning: Namespace
'http://was.test.fiatc.es/autos/services/wsAutos' is not available to
be referenced in this schema.
Schema validation warning: Namespace
'http://was.test.fiatc.es/autos/services/wsAutos' is not available to
be referenced in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:contratar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Schema validation warning: Namespace
'urn:tarificar.beans.autos.fiatc.es' is not available to be referenced
in this schema.
Writing file 'D:\mtomas\projects\Tarificadors\test\AutosService Service.cs'.
<---- WSDL output message ends here ---->
<---- Generated class starts here ---->
//------------------------------------------------------------------------------
// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.573
//
// Changes to this file may cause incorrect behavior and will be
lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------------

//
// This source code was auto-generated by wsdl, Version=1.1.4322.573.
//
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;
/// <remarks/>
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("c ode")]
[System.Web.Services.WebServiceBindingAttribute(Nam e="wsAutosSoapBinding",
Namespace="http://was.test.fiatc.es/autos/services/wsAutos")]
[System.Xml.Serialization.SoapIncludeAttribute(type of(Garantia))]
[System.Xml.Serialization.SoapIncludeAttribute(type of(ErrorAutos))]
public class AutosServiceService :
System.Web.Services.Protocols.SoapHttpClientProtoc ol {

/// <remarks/>
public AutosServiceService() {
this.Url = "http://was.test.fiatc.es/autos/services/wsAutos";
}

/// <remarks/>
[System.Web.Services.Protocols.SoapRpcMethodAttribu te("",
RequestNamespace="http://autos.fiatc.es",
ResponseNamespace="http://was.test.fiatc.es/autos/services/wsAutos")]
[return: System.Xml.Serialization.SoapElementAttribute("tar ificaReturn")]
public RespuestaTarificacion tarifica(PeticionTarificacion
peticion) {
object[] results = this.Invoke("tarifica", new object[] {
peticion});
return ((RespuestaTarificacion)(results[0]));
}

/// <remarks/>
public System.IAsyncResult Begintarifica(PeticionTarificacion
peticion, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("tarifica", new object[] {
peticion}, callback, asyncState);
}

/// <remarks/>
public RespuestaTarificacion Endtarifica(System.IAsyncResult
asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((RespuestaTarificacion)(results[0]));
}

/// <remarks/>
[System.Web.Services.Protocols.SoapRpcMethodAttribu te("",
RequestNamespace="http://autos.fiatc.es",
ResponseNamespace="http://was.test.fiatc.es/autos/services/wsAutos")]
[return: System.Xml.Serialization.SoapElementAttribute("con trataReturn")]
public RespuestaContratacion contrata(PeticionContratacion
peticion) {
object[] results = this.Invoke("contrata", new object[] {
peticion});
return ((RespuestaContratacion)(results[0]));
}

/// <remarks/>
public System.IAsyncResult Begincontrata(PeticionContratacion
peticion, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("contrata", new object[] {
peticion}, callback, asyncState);
}

/// <remarks/>
public RespuestaContratacion Endcontrata(System.IAsyncResult
asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((RespuestaContratacion)(results[0]));
}
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Petici onTarificacion",
"urn:autos.fiatc.es")]
public class PeticionTarificacion {

/// <remarks/>
public BonusMalus bonusMalus;

/// <remarks/>
public Conductores conductores;

/// <remarks/>
public Control control;

/// <remarks/>
public DescuentosDirectos descuentosDirectos;

/// <remarks/>
public GarantiasOpcionales garantiasOpcionales;

/// <remarks/>
public General general;

/// <remarks/>
public Vehiculo vehiculo;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("BonusM alus",
"urn:tarificar.beans.autos.fiatc.es")]
public class BonusMalus {

/// <remarks/>
public string codigoDgsCia;

/// <remarks/>
public System.Decimal dtoDanos;

/// <remarks/>
public System.Decimal dtoRC;

/// <remarks/>
public string nivelDanos;

/// <remarks/>
public string nivelRC;

/// <remarks/>
public string sincoNIF;

/// <remarks/>
public string sincoPoliza;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Mensaj esContratacion",
"urn:contratar.beans.autos.fiatc.es")]
public class MensajesContratacion {

/// <remarks/>
public ErrorAutos[] errores;

/// <remarks/>
public string[] tareas;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("ErrorA utos",
"urn:beans.autos.fiatc.es")]
public class ErrorAutos {

/// <remarks/>
public string codError;

/// <remarks/>
public string textoError;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("DatosR ecibo",
"urn:contratar.beans.autos.fiatc.es")]
public class DatosRecibo {

/// <remarks/>
public System.Decimal consorcio;

/// <remarks/>
public System.DateTime fechaEfecto;

/// <remarks/>
public System.DateTime fechaVencimiento;

/// <remarks/>
public System.Decimal fondoMutual;

/// <remarks/>
public System.Decimal impuestos;

/// <remarks/>
public System.Decimal ips;

/// <remarks/>
public long numPoliza;

/// <remarks/>
public System.Decimal prima;

/// <remarks/>
public System.Decimal totalRecibo;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Garant ia",
"urn:contratar.beans.autos.fiatc.es")]
public class Garantia {

/// <remarks/>
public System.Decimal comisionCantidad;

/// <remarks/>
public System.Decimal comisionPorcentaje;

/// <remarks/>
public System.Decimal consorcio;

/// <remarks/>
public System.Decimal impuestos;

/// <remarks/>
public string nombre;

/// <remarks/>
public System.Decimal prima;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("DatosC omisiones",
"urn:contratar.beans.autos.fiatc.es")]
public class DatosComisiones {

/// <remarks/>
public Garantia[] garantias;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Respue staContratacion",
"urn:autos.fiatc.es")]
public class RespuestaContratacion {

/// <remarks/>
public DatosComisiones datosComisiones;

/// <remarks/>
public DatosRecibo datosRecibo;

/// <remarks/>
public MensajesContratacion mensajes;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Vehicu lo",
"urn:contratar.beans.autos.fiatc.es")]
public class Vehiculo1 {

/// <remarks/>
public string claseMatricula;

/// <remarks/>
public string desExtrasAudio;

/// <remarks/>
public string desExtrasNoAudio;

/// <remarks/>
public string matricula;

/// <remarks/>
public bool remolque;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Tomado r",
"urn:contratar.beans.autos.fiatc.es")]
public class Tomador {

/// <remarks/>
public string apellido1;

/// <remarks/>
public string apellido2;

/// <remarks/>
public string codPostal;

/// <remarks/>
public string domicilio;

/// <remarks/>
public string email;

/// <remarks/>
public string estadoCivil;

/// <remarks/>
public System.DateTime fechaNacimiento;

/// <remarks/>
public string idPoblacion;

/// <remarks/>
public string idioma;

/// <remarks/>
public string nifCif;

/// <remarks/>
public string nombre;

/// <remarks/>
public string numDomicilio;

/// <remarks/>
public int numHijos;

/// <remarks/>
public string piso;

/// <remarks/>
public string sexo;

/// <remarks/>
public string telefono;

/// <remarks/>
public string tipoVia;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Propie tario",
"urn:contratar.beans.autos.fiatc.es")]
public class Propietario {

/// <remarks/>
public string apellido1;

/// <remarks/>
public string apellido2;

/// <remarks/>
public System.DateTime fechaNacimiento;

/// <remarks/>
public System.DateTime fechaPermiso;

/// <remarks/>
public string nifCif;

/// <remarks/>
public string nombre;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Genera l",
"urn:contratar.beans.autos.fiatc.es")]
public class General1 {

/// <remarks/>
public System.DateTime fechaEfecto;

/// <remarks/>
public System.DateTime fechaVencimiento;

/// <remarks/>
public int modalidad;

/// <remarks/>
public string refPeticion;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("DatosB ancarios",
"urn:contratar.beans.autos.fiatc.es")]
public class DatosBancarios {

/// <remarks/>
public string control;

/// <remarks/>
public string cuenta;

/// <remarks/>
public string entidad;

/// <remarks/>
public string oficina;

/// <remarks/>
public string primerRecibo;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Contro l",
"urn:contratar.beans.autos.fiatc.es")]
public class Control1 {

/// <remarks/>
public string idiomaInterface;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Conduc tores",
"urn:contratar.beans.autos.fiatc.es")]
public class Conductores1 {

/// <remarks/>
public string habitualApellido1;

/// <remarks/>
public string habitualApellido2;

/// <remarks/>
public string habitualEstadoCivil;

/// <remarks/>
public string habitualNif;

/// <remarks/>
public string habitualNombre;

/// <remarks/>
public int habitualProfesion;

/// <remarks/>
public string habitualSexo;

/// <remarks/>
public string ocasionalApellido1;

/// <remarks/>
public string ocasionalApellido2;

/// <remarks/>
public string ocasionalEstadoCivil;

/// <remarks/>
public string ocasionalNif;

/// <remarks/>
public string ocasionalNombre;

/// <remarks/>
public int ocasionalProfesion;

/// <remarks/>
public string ocasionalSexo;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Benefi ciarios",
"urn:contratar.beans.autos.fiatc.es")]
public class Beneficiarios {

/// <remarks/>
public string danos;

/// <remarks/>
public string ocupantes;

/// <remarks/>
public string retiradaCarnet;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Petici onContratacion",
"urn:autos.fiatc.es")]
public class PeticionContratacion {

/// <remarks/>
public Beneficiarios beneficiarios;

/// <remarks/>
public Conductores1 conductores;

/// <remarks/>
public Control1 control;

/// <remarks/>
public DatosBancarios datosBancarios;

/// <remarks/>
public General1 general;

/// <remarks/>
public Propietario propietario;

/// <remarks/>
public Tomador tomador;

/// <remarks/>
public Vehiculo1 vehiculo;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Mensaj esTarificacion",
"urn:tarificar.beans.autos.fiatc.es")]
public class MensajesTarificacion {

/// <remarks/>
public ErrorAutos[] errores;

/// <remarks/>
public string refPeticion;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("DatosN umericos",
"urn:tarificar.beans.autos.fiatc.es")]
public class DatosNumericos {

/// <remarks/>
public System.Decimal terceros;

/// <remarks/>
public System.Decimal tercerosIncendio;

/// <remarks/>
public System.Decimal tercerosPerTotal;

/// <remarks/>
public System.Decimal tercerosRobo;

/// <remarks/>
public System.Decimal tercerosRoboInciendio;

/// <remarks/>
public System.Decimal tercerosRoboPerTotal;

/// <remarks/>
public System.Decimal todoRiesgo;

/// <remarks/>
public System.Decimal todoRiesgo1250;

/// <remarks/>
public System.Decimal todoRiesgo1800;

/// <remarks/>
public System.Decimal todoRiesgo200;

/// <remarks/>
public System.Decimal todoRiesgo2500;

/// <remarks/>
public System.Decimal todoRiesgo3050;

/// <remarks/>
public System.Decimal todoRiesgo400;

/// <remarks/>
public System.Decimal todoRiesgo450;

/// <remarks/>
public System.Decimal todoRiesgo54;

/// <remarks/>
public System.Decimal todoRiesgo6050;

/// <remarks/>
public System.Decimal todoRiesgo650;

/// <remarks/>
public System.Decimal todoRiesgo90;

/// <remarks/>
public System.Decimal todoRiesgo900;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Respue staTarificacion",
"urn:autos.fiatc.es")]
public class RespuestaTarificacion {

/// <remarks/>
public DatosNumericos datosNumericos;

/// <remarks/>
public MensajesTarificacion mensajes;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Vehicu lo",
"urn:tarificar.beans.autos.fiatc.es")]
public class Vehiculo {

/// <remarks/>
public string cpCirculacion;

/// <remarks/>
public System.Decimal extrasAudio;

/// <remarks/>
public System.Decimal extrasResto;

/// <remarks/>
public System.DateTime fechaMatricula;

/// <remarks/>
public long marcaB7;

/// <remarks/>
public long modeloB7;

/// <remarks/>
public System.Decimal toneladasPlazas;

/// <remarks/>
public long uso;

/// <remarks/>
public System.Decimal valor;

/// <remarks/>
public long versionB7;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Genera l",
"urn:tarificar.beans.autos.fiatc.es")]
public class General {

/// <remarks/>
public System.DateTime fechaCalculo;

/// <remarks/>
public string formaPago;

/// <remarks/>
public long polizaSubstituida;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Garant iasOpcionales",
"urn:tarificar.beans.autos.fiatc.es")]
public class GarantiasOpcionales {

/// <remarks/>
public bool asistenciaViaje;

/// <remarks/>
public bool defensaExcluida;

/// <remarks/>
public string lunas;

/// <remarks/>
public System.Decimal ocupCapitalInvalidez;

/// <remarks/>
public System.Decimal ocupCapitalMuerte;

/// <remarks/>
public int ocupNumero;

/// <remarks/>
public System.Decimal rcCargaCapital;

/// <remarks/>
public bool rcCargaMaquina;

/// <remarks/>
public System.Decimal retCarnetCapital;

/// <remarks/>
public int retCarnetDuracion;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Descue ntosDirectos",
"urn:tarificar.beans.autos.fiatc.es")]
public class DescuentosDirectos {

/// <remarks/>
public System.Decimal asistenciaViaje;

/// <remarks/>
public System.Decimal danosPropios;

/// <remarks/>
public System.Decimal defensaExtranjero;

/// <remarks/>
public System.Decimal defensaNacional;

/// <remarks/>
public System.Decimal lunas;

/// <remarks/>
public System.Decimal ocupantes;

/// <remarks/>
public System.Decimal rcCarga;

/// <remarks/>
public System.Decimal rco;

/// <remarks/>
public System.Decimal rcv;

/// <remarks/>
public System.Decimal reclamacion;

/// <remarks/>
public System.Decimal retiradaCarnet;

/// <remarks/>
public System.Decimal robo;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Contro l",
"urn:tarificar.beans.autos.fiatc.es")]
public class Control {

/// <remarks/>
public string codigoControl;

/// <remarks/>
public bool empleado;

/// <remarks/>
public string idiomaInterface;

/// <remarks/>
public string mediador;

/// <remarks/>
public string oficina;

/// <remarks/>
public string usuario;
}

/// <remarks/>
[System.Xml.Serialization.SoapTypeAttribute("Conduc tores",
"urn:tarificar.beans.autos.fiatc.es")]
public class Conductores {

/// <remarks/>
public System.DateTime habitualFechaNacimiento;

/// <remarks/>
public System.DateTime habitualFechaPermiso;

/// <remarks/>
public bool habitualPermisoCD;

/// <remarks/>
public System.DateTime ocasionalFechaNacimiento;

/// <remarks/>
public System.DateTime ocasionalFechaPermiso;

/// <remarks/>
public bool ocasionalPermisoCD;
}
<---- Generated class ends here ---->
Nov 21 '05 #7
Ya you modify the class to send nulls. I use attributes on the data
types to change how they are serialized. There is some decent
documentation which describes all the possible attributes you can use to
modify the serialized output.

scalars i use [System.ComponentModel.DefaultValueAttribute(0)]
datetime i use
[System.ComponentModel.DefaultValueAttribute(typeof (System.DateTime),"")]
for everything else i use
[System.Xml.Serialization.XmlElementAttribute(IsNul lable=true)]

seems to work pretty well hope this helps ya!

steve

Marc wrote:
Hi Dino,

I've send (by email) the wsdl url and the class generated by wsdl tool
in my computer. You will see that WSDL haven't generated the
xxxSpecified attribute for every nillable attribute. So, I can send
null values for the attributes like long, int, ... When I try to write
manually the attributes (xxxSpecified), then the execution throws me
an error (which is mentioned in a previous message,
FileNotFoundException).

So, my question is, how can I modify manually the class generated by
wsdl in order to serialize null Value Types needed for the web
service?

Thanks again,

Marc.

Nov 21 '05 #8
Thanks for your response, but it doesn't solve my problem, for the
scalars I don't want to send 0, I want to send null, nothing, 0 is a
value and the web service process this value....

Moreover I can't modify the class, when I modify the class (generated
by wsdl), then it doesn't work anymore.

Thanks again,

Marc.

steve terapak <st*************@mitchell.com> wrote in message news:<OB**************@tk2msftngp13.phx.gbl>...
Ya you modify the class to send nulls. I use attributes on the data
types to change how they are serialized. There is some decent
documentation which describes all the possible attributes you can use to
modify the serialized output.

scalars i use [System.ComponentModel.DefaultValueAttribute(0)]
datetime i use
[System.ComponentModel.DefaultValueAttribute(typeof (System.DateTime),"")]
for everything else i use
[System.Xml.Serialization.XmlElementAttribute(IsNul lable=true)]

seems to work pretty well hope this helps ya!

steve

Marc wrote:
Hi Dino,

I've send (by email) the wsdl url and the class generated by wsdl tool
in my computer. You will see that WSDL haven't generated the
xxxSpecified attribute for every nillable attribute. So, I can send
null values for the attributes like long, int, ... When I try to write
manually the attributes (xxxSpecified), then the execution throws me
an error (which is mentioned in a previous message,
FileNotFoundException).

So, my question is, how can I modify manually the class generated by
wsdl in order to serialize null Value Types needed for the web
service?

Thanks again,

Marc.

Nov 21 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Christian Wilhelm | last post: by
3 posts views Thread by Jerome Cohen | last post: by
7 posts views Thread by Jorgen Haukland, Norway | last post: by
4 posts views Thread by leslie_tighe | last post: by
reply views Thread by =?ISO-8859-1?Q?Jan_Thom=E4?= | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.