I am trying to utilize a SOAP service using New-WebServiceProxy but somehow I have a strange behavior that Powershell is adding elements that are part of the output message to the input message arguments.
The code I am executing is:
$uri = 'http://domain.com/WS.xml' $proxy = New-WebServiceProxy -Uri $uri
In the XML a GetList operation is defined with following values
As you can see it take 3 parameters and if I call it from other tools (SOAPUI or Wizdler) it is properly working. However if look at the $proxy.getlist value it shows me following:
string GetList(string Qualification, string startRecord, string maxLimit, [ref] string Submitter__c, [ref] datetime Create_Date__c, [ref] bool Create_Date__cSpecified, [ref] string
Assigned_To__c, [ref] string Last_Modified_By__c, [ref] datetime Modified_Date__c, [ref] bool Modified_Date__cSpecified, [ref] …
(continuing list of 50+ parameters)
The [ref] arguments are actually elements defined in the response message:
If I try to call the operation with only 3 arguments I receive an error:
Cannot find an overload for “GetList” and the argument count: “3”.
I have tested it with Powershell 5.1 and 4.0, same behavior.
Can anyone tell me why Powershell adds these [ref] arguments? It clearly is working with other tools so the XML itself seems to be fine.