473,396 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 7164
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type...
3
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb)....
7
by: Jorgen Haukland, Norway | last post by:
Hi, I have created a Java webservice which runs in IBM WebSphere appserver. I take the WSDL-file and create a VS.NET WinForm application and calls the service running on my PC and everything...
2
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects"...
4
by: leslie_tighe | last post by:
Hello, I have a webservice running on a J2EE server created with Axis 1.2.. I have a client that I am building in .net that needs to consume this webserivce and am having a bit of trouble. I have...
3
by: GT | last post by:
I have a .NET client that consumes an Axis web service. A change was made recently to the AXIS web service, and ever since then my .NET proxy class has been throwing an InvalidCastException. The...
8
by: Duffcase | last post by:
Hi. I'm having some problems consuming a webservice. The server keeps complaining about the wrong element beeing sent.. I have this method that takes two strings String_1 and String_2 The...
5
by: Daythryl | last post by:
I've got some VB code that's supposed to retrieve a Map from a Web Service written in Java, running under Tomcat via Axis-1.4. I'll list the WSDL, the response message and the source code below. ...
0
by: =?ISO-8859-1?Q?Jan_Thom=E4?= | last post by:
Hi, I've been trying like a madman to make my WSDL work with .net, but it seems I am out of luck. Whenever I add a service reference to Visual C#, the code gets generated fine, however all...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.