The New-WebServiceProxy command is used to connect a Web Services Description Language (WSDL) document. The document is written in XML and can be viewed in a browser.
The command accesses a service anonymously by default. If the current user should be passed on, the UseDefaultCredential parameter should be used. If explicit credentials are required, the Credential parameter can be used.
The following example creates a proxy, which is used to access a web service that exposes information about Mendeleev's periodic table of the elements:
$periodicTable= New-WebServiceProxy http://www.webservicex.net/periodictable.asmx?WSDL -Namespace Mendeleev
The object returned by the command holds information about the connection:
PS>$periodicTable SoapVersion : Default AllowAutoRedirect : False CookieContainer : ClientCertificates : {} EnableDecompression : False UserAgent : Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.42000) Proxy : UnsafeAuthenticatedConnectionSharing : False Credentials : UseDefaultCredentials : False ConnectionGroupName : PreAuthenticate : False Url : http://www.webservicex.net/periodictable.asmx RequestEncoding : Timeout : 100000 Site : Container :