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.
$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:
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:
I have tested it with Powershell 5.1 and 4.0, same behavior.
You're going to need to use a Gist as indicated in the posting instructions. Raw XML can't render here.
Thank you. I noticed it too late and could not edit the post anymore because it was already pending for review.
In the XML a input message is defined as:
And the output message is defined as:
I would expect that I can invoke the GetList call with 3 parameters (Qualification, startRecord, maxLimit) but as mentioned in my initial post Powershell returns an error. It seems to expects also values for the [ref] arguments (Submitter__c, Create_Date__c, Assigned_To__c,..) that are actually defined in the response message.
Solved in the meantime. At the end it turned out to be caused by the SOAP XML created by the application. So if someone faces a similar issue, first thing check your XML. however, I still don't know what exactly caused the problem. I also had the XML checked by an online validation tool which showed me that the file was generally valid – so you can't rely on that.
But it is still wired that Powershell behaves in such unexpected way when other solutions like SOAPUI and Wizdler had no problem with it.
You must be logged in to reply to this topic.