I'm attempting to port a working SOAP client (written in Perl) to PowerShell for a different client (who won't allow us to pollute their locked-down windows environment with Perl).
So I try and download the WSDL information to create a proxy, using examples I found on the Web. This is how the existing Perl Code works, so the approach is sound.
$soap = New-WebServiceProxy -Uri $url -UseDefaultCredential
New-WebServiceProxy : The HTML document does not contain Web service discovery information.
At line:1 char:9
+ $soap = New-WebServiceProxy -Uri $uri
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (http://localhos...sx:Uri) [New-WebServiceProxy], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.NewWebServiceProxy
But, as I said, this is based on working code, so it is unlikely anything is wrong at the server end. As a test, type
$WebResponse = Invoke-WebRequest -UseDefaultCredential $url
$WebResponse
And I get:
StatusCode : 200
StatusDescription : OK
Content : `<?xml version="1.0" encoding="UTF-8"?>
<!-- SOAP API definitions -->
<definitions name="SOAPAPI"
Which is what I would expect - it's start of the header of the WSDL.
I'm not seeing what's going wrong, does anyone have any suggestions?