Create a WCF client by building a WCF Client Proxy project, which you can add to any WPF Window Application target.
For the service URL or file name, you can enter or choose files with the WSDL, ASMX, XML, or SVC extension.
If a service has endpoints with different bindings, PowerBuilder .NET generates one proxy NVO for each binding.
Each generated proxy has one public property, wcfConnectionObject, which is assigned to a default instance of WCFConnection.
ProxyNVO.wcfConnectionObject.EndpointAddress.URL="xxx" ProxyNVO.wcfConnectionObject.Timeout="00:05:00"
PBWCF.WCFConnection obj obj= create PBWCF.WCFConnection obj.EndpointAddress.URL="xxx" obj.Timeout="00:10:00" obj.BindingType=PBWCF.WCFBindingType.BasicHTTPBinding! obj.BasicHTTPBinding=create PBWCF.WCFBasicHTTPBinding obj.BasicHttpBinding.PBWCF.TransferMode.Streamed! ... ProxyNVO.wcfConnectionObject = obj
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
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.