Diese Seite mit anderen teilen ...

Informationen zum Thema:
Forum:
WinDev Forum
Beiträge im Thema:
8
Erster Beitrag:
vor 4 Jahren, 11 Monaten
Letzter Beitrag:
vor 4 Jahren, 11 Monaten
Beteiligte Autoren:
Christo, Arie, Michael Drechsel

WD17: Web Service sending Null Value

Startbeitrag von Christo am 21.05.2013 16:46

Hi All,

I am attempting to send a null value to a imported web service.

My understanding is that the soap string for correct null handling should be ,
I use the SOAPAddAttribute(ns1:OrderStatus , "xsi:nil", "true" ) , but then the field is missing from the soap string.

if I set the field to 0 then it appears but contains the 0 , so not null 0

it looks like windev does not include the field unless you set to a value. I have tried using the ..null = true but this is not allowed

does anybody know how to successfulle handle sending null values to a web service ?

any assistence or pointers would be greatly apreciated

Regards
Christo

Antworten:

Hi Christo,

I use an extra variable like

Price is numeric=20
Price_is_NULL is boolean=False

and make at the server / client site:

If Price_is_NULL=true then
Price=NULL
end

... or something else ...

von Michael Drechsel - am 21.05.2013 17:52
Hi Michael,

Thank you for your thoughts.

unfortunately it is external web service that I am sending data to, which I did not code. But they insist that they need a Null if there is no value available.

Regards
Christo

von Christo - am 21.05.2013 18:38
Christo,
maybe you can use SoapPrepare to get the entire soap message (as a string/buffer), tweak it a bit and finally send it using SoapRunXML()

von Arie - am 21.05.2013 19:27
Thanks Arie,

I was hoping to do it 10 time faster :)

I will give your suggestion a go.

Regards
Christo

von Christo - am 21.05.2013 21:06
Hi Arie,

SoapPrepare and SoapRunXML does work on my Windows PC as a test environment. These SOAP function are however not available for Linux as a native executable or under Java.

Any other ideas?

Regards
Christo

von Christo - am 22.05.2013 13:33
I'm afraid I don't do Linux.
Do you really need it as a Linux application?

von Arie - am 22.05.2013 13:56
Hi,

At the moment yes, But let me see , maybe we can put a small Windows computer in the mix, lots of old Windows XP machines standing around here.

Regards
Christo

von Christo - am 22.05.2013 14:32
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.