Quantcast
Channel: Windows PowerShell forum
Viewing all articles
Browse latest Browse all 21975

declare webservice variable types

$
0
0

Hi,

How can I load the object types from a web service in Powershell?

$url = http://wserver/v1.asmx?WSDL

$ws = New-WebServiceProxy -uri $url -Namespace myWS

$wsObj = New-Object -TypeName "myWS.AddObjectData"

When I now do a $wsObj.GetType() the BaseType is "System.Object" and not "AddObjectData".

Trying to declare a variable like [myWS.StringVal]$Test ("StringVal" is valid and found in the WSDL), I get an error that the assembly is not loaded.

How can I load this into PowerShell?

Note: This works fine in C#.

Thanks


Viewing all articles
Browse latest Browse all 21975

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>