I created a webservice on my local machine and connect to it with localhost. The webservice works great when I access it via IE and I am able to do all the functions created with no problem. When I create a script to access the webservice via powershell I get the following error. If I access an outside webservice like get teh weather powershell works just fine.
(b)My Script(/b)
$proxy2 = New-WebServiceProxy -Uri ‘http://localhost/API/webservice.asmx?WSDL’
[xml]$Response = $proxy2.GetStatus()
$Response.Status | Format-List
(b)Powershell’s Response(/b)
PS C:\Windows\system32> $proxy2 = New-WebServiceProxy -Uri ‘http://localhost/API/webservice.asmx?WSDL’
[xml]$Response = $proxy2.GetStatus()
$Response.Status | Format-List
Exception calling “GetStatus” with “0” argument(s): "The request failed with the error message:
Object moved
Object moved to here.
–."
At line:3 char:1
- [xml]$Response = $proxy2.GetStatus()
-
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : WebException
PS C:\Windows\system32>
I have done an extensive search to try to shed some light on what the issue is and have not come up with anything usable
Any help you can give is greatly appreciated.
thanks
rich