I need to call a webservice from a DLL ( powershell PSCmdlet ) but when testing it I keept getting below error
PS C:\Users\administrator.INT> Get-CustomerServiceObject -CustomerServiceID 1880
Get-CustomerServiceObject : Could not find default endpoint element that references contract 'webserviceCustomerService
s.CustomerServices' in the ServiceModel client configuration section. This might be because no configuration file was f
ound for your application, or because no endpoint element matching this contract could be found in the client element.
At line:1 char:26
+ Get-CustomerServiceObject <<<< -CustomerServiceID 1880
+ CategoryInfo : NotSpecified: (:) [Get-CustomerServiceObject], InvalidOperationException
+ FullyQualifiedErrorId : System.InvalidOperationException,Cloud.Provisioning.CloudSnapin.Cloud.Provisioning.GetCu
One way to fix this would be to add the system.serviceModel from app.config to powershell’s .config file,but that just sound wrong in my ears. Google !
So found this post and re-wrote it to my own VB.NET version