I have a Web Service which has one WebMethod with nullable parameters:
[WebMethod]
public void SaveValue(double? Real, double? Meta){
//Do the magic...
}
In my Excel I'm calling the WebMethod as below:
Dim WebSvc As MSSOAPLib.SoapClient
Set WebSvc = New SoapClient
Call WebSvc.mssoapinit("http://localhost:10618/WebService.asmx?wsdl")
Call WebSvc.SaveValue(10, 20)
The problem is, I want to pass null values for one or both parameters, but, when I call the WebMethod passing nil
, vbNull
, NaN
, Nothing
or Missing
in the VBA, the WebService doesn't recognize the "null" parameter, it always put "0" in the value. When I do that way the Real.HasValue
always return true
.
I've checked WSDL for the WebMethod and the parameter is described as below:
<s:element minOccurs="1" maxOccurs="1" name="Real" nillable="true" type="s:double" />
Any ideas?