Diese Seite mit anderen teilen ...

Informationen zum Thema:
WinDev Forum
Beiträge im Thema:
Erster Beitrag:
vor 5 Jahren, 4 Monaten
Letzter Beitrag:
vor 5 Jahren, 4 Monaten
Beteiligte Autoren:
Michael Drechsel, Piet van Zanten, Pragma Tix, Geoff B

[WD17] Webservice and "NULL" value

Startbeitrag von Michael Drechsel am 28.03.2013 13:32


I am deep in programming a large webservice projekt. It works so far.
Now I need the possibility to distinguish between a "0" and a "NULL" value in a numeric field that comes from the database. Any ideas how to transmit a NULL value through a webservice ?

regards michael


Hi Michael,

Send numbers as strings so you can send Null as "Null".


von Piet van Zanten - am 28.03.2013 15:27
Hi Piet,

but then I loose the databinding of the editcontrol.

von Michael Drechsel - am 28.03.2013 16:34
Isn't all data from a webservice sent as string data?

If you control the webservice can you set null values to "NULL" and then do what you need to convert the data to a numeric variable when processing the service data?

Why do you need to data bind webservice data to an edit control?

von Geoff B - am 29.03.2013 01:57
Hi Geoff,

of course is it send as string data. But WD handle the value description (string, numeric, boolean) himself, so that the controls can bind with the correct data typ.

Data binding with webservices is an easy way to work in the same way like before, with a direct connection. You can use arrays of structures which is automatically generated from the analyses and an UML model.

von Michael Drechsel - am 29.03.2013 07:44
Hi Michael,

Can you define the data type in the structure as variant?


von Piet van Zanten - am 29.03.2013 11:19
Hi Piet,

the structure definition comes from the UML modell, and they from the analysis.
Of course I can overwrite this. But if I regenerete the UML modell WD overwrites everything with the analysis data types. So its not a solution.

von Michael Drechsel - am 29.03.2013 11:30
This is just an idea!
I think it should be possible to use SOAPAddAttribute()

Online help
Operating mode

When a Webservice is imported into a project, WinDev, WebDev and WinDev Mobile automatically generate the types of variables allowing you to handle the XML stream used by the protocol of the Webservice.

SOAPAddAttribute is used to add an attribute that would not be declared in the WSDL (and therefore not automatically generated) to a variable of one of the imported types.

That should be :

MyNumericValue is xsdNumericValue // See XSD
SOAPAddAttribute( MyNumericValue, "xsi:nil", "true" )



von Pragma Tix - am 29.03.2013 21:14
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.