I used the PowerShell New-WebServiceProxy commandlet to get a connection with a WebService(WCF/SOAP). It´s possible to connect to the WebService but when I want to execute a methode I´m getting a access denied. The access denied is because the WebService needs a custom message header. But this is not possible with New-WebServiceProxy.
Question: What is the easiest way to connect/use the WebService and add the message header? Is there a PowerShell example script?
(My prefered language is PowerShell in that case)
BTW: Yes I know that there is a Question very similar to my: Add custom SOAP header in PowerShell using New-WebServiceProxy
Thank you in advance!
This is more of a workaround, but maybe it works for you. Instead of using the cmdlet, create a C# oder VB.NET Project, add the WCF service reference as it is intended to be used. Then create a class that has a method for every service method you want to call and exposes the arguments you need to use in PowerShell.
Compile it and use the assembly and class in your PowerShell script.