So I ran into this exact problem: http://www.vistax64.com/powershell/273120-bug-when-using-namespace-parameter-new-webserviceproxy.html
The gist of the issue is that when using the New-WebServiceProxy cmdlet AND the -Namspace parameter then you can't execute a method on the proxy with an argument of an autogenerated type.
Something like this:
// In the service
public void DoSomething(DoSomethingRequest request) { ... }
$proxy = New-WebServiceProxy -Uri "http://something.com/MyService.svc"
-Namespace ns
$req = New-Object ns.DoSomethingRequest
$proxy.DoSomething($req)
This throws an exception along the lines of Cannot convert argument "0" of type "ns.DoSomething" to type "ns.DoSomething"
As is explained in the link, by removing the -Namespace parameter and utilizing the autogenerated namespace everything works fine. However, I'd really like to use the -Namespace....
I can't find anything related to a "fix" or the correct way to utilize the -Namespace in this scenario. Can anyone shed some light on this for me?