Author Posts

September 4, 2013 at 9:26 am

Hello all,

I'm trying to work with a vendor-supplied web service. I'm able to consume it easily enough from C#, but I'm struggling from powershell.

I'm by no means an expert with web services or the XML that defines them.

Anyway,

I can connect easily enough:

$docman = New-WebServiceProxy -Uri "http://server/webservices/DocumentManagement.svc?wsdl" -namespace "Core.service.livelink.opentext.com"
$auth = New-WebServiceProxy -Uri "http://server/webservices/Authentication.svc?wsdl" -namespace "api.ecm.opentext.com";

and use some methods:

$token = $auth.AuthenticateUser("username", "password");

But when I'm trying to run an actual useful function as described:

$method = $docman | Get-Member -Name "AddVersion";
$method.Definition:
namespace AddVersion(int ID, namespace.Metadata metadata, namespace.Attachm
ent attach)

By calling something like:

$docman.AddVersion(69988, $metadata, $newattach);

I get:

Exception calling "AddVersion" with "3" argument(s): ""
At C:\Users\username\Documents\code\sqlpowershell.ps1:46 char:19
+ $docman.AddVersion < <<< (69988, $metadata, $newattach);
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

And here is the XML operation as defined:

- 
   
   
  

Any suggestions, or more information needed? Thank you.

September 4, 2013 at 10:14 am

My first question would have to be have you got the type correct for the parameters you are passing in?

Do you have a call that works in C# that doesn't in PowerShell?