You cannot use PowerScript exception objects to catch errors from a WCF service call. You must catch any exceptions using the .NET System.Exception class, as in this example, or by using a class that inherits from System.Exception:
ns_test_wsdwSoapClient svc
svc = create ns_test_wsdwSoapClient
try
svc.wcfConnectionObject.ClientCredential.UserName.UserName=“xx”
svc.wcfConnectionObject.ClientCredential.UserName.Password=“xxx”
string ret
ret = svc.getProverb()
messagebox("ok", ret)
catch (System.Exception ee)
// Error handling
End try
Note: If your development computer is behind a proxy server, and you do not want the WCF client to use the default proxy server settings from Internet Explorer, you can change the settings with code like this:
svc.wcfConnectionObject.ProxyServer.UseDefaultWebProxy = false
svc.wcfConnectionObject.ProxyServer.ProxyAddress =
"http://hostname:9090"
Otherwise, you can change the proxy server settings at runtime through an instance of the WCFProxyServer class that you assign to the WCFConnection object instance.