Missing XML node in SOAP request to Webservice
Hi There
I've created a new WebClient using Studio Addon-s Soap Wizard.
I've tried to send a soap request using InvokeMethod.
However the Body comes empty <soapenv:Body></soapenv:Body>
I needed it to be
<soapenv:Body>
<ns:Ping/>
</soapenv:Body>
Comments
Check XML projection of Property Ping
especially handling of null strings controlled by XMLNIL & XMLIGNORENULL parameter.
see Handling Empty Strings and Null Values
Thank you Robert.
I've tried that before and it didn't work though.
This is what I've tried:
with Property parameters As Conexes.tns.Ping;
----------------------------------
Conexes.tns.Ping :
Parameter NAMESPACE = "mynamespace";
Parameter XMLNAME = "Ping";
Parameter XMLSEQUENCE = 1;
Parameter XMLPREFIX = "ns";
Parameter XMLIGNORENULL = 0;
Parameter XMLNIL = 1;
-----
Set tSC = ..Adapter.InvokeMethod("Ping",.pOutput, pRequest.parameters)
OK.
It took some investigations to understand what's going on.
the is a Class
it switches between <Ping></Ping> and <Ping />
BUT: if ALL Properties of your reply are empty then you just get
an empty body <soapenv:Body></soapenv:Body>
as soon as you set some dummy value into Property Ping you get <Ping> </Ping>
or you add a dummy property.
Digging into %SOAP.... message classes shows, that the generated messages don't use
Thank you Robert.
Ended up adding a dummy property to Ping with a default value and XMLPROJECTION = "Attribute" as "None" would error.