Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: create array of items to pass as a parameter

$
0
0
Re: create array of items to pass as a parameter
Web Service Proxy Generator
Re: create array of items to pass as a parameter
Jan. 6, 2013
11:28 pm
3OP1EBLKWShow this entire thread in new window
Gratar Image based on email address
From:Brian Abbott
To:Rick Strahl
Hi Rick

Still not getting anywhere with this.

Do you have time to spare to take a look at it on a chargeable basis? I'm sure you'd be able to sort it out a lot lot quicker than me :-)

Brian


Brian,

In order to pass a ComArray instance you have to use the latter syntax. The former will definitely not work because the .NET target method knows nothing about the ComArray object. InvokeMethod() fixes up the method call and passes the raw Array to .NET. So definitely use that.

My guess is the problem is the @oBody parameter you're passing. What is that parameter expecting? If that item you're passing is an object don't pass it with @ since it's already an object. In general it's pretty rare that a service will return a ref out parameter.

+++ Rick ---


Hi

I'm trying to create an array of objects to pass as a parameter to a web service. The code I have is like this:

oTask = oProxy.oBridge.CreateInstance("Service.COINSInterfaceFMTask") oTask.Company = 'Company' oTask.Contract = 'Contract' oTask.JobNumber = 'job number' oTaskArray = oProxy.oBridge.CreateArray("Service.COINSInterfaceFMTask") lOK = oTaskArray.AddItem(oTask) && lOK returns .T.

Even though lOK returns .T. on the above line, in the debugger whilst oTaskArray shows as an object, I can't drill down into it and I suspect this is where it's going wrong.

Then both of these calls below fail with 'The parameter is incorrect.' :

oResult = oProxy.doAction(oHeader, oTaskArray, @oBody1) OR oResult = oProxy.oBridge.InvokeMethod(oProxy, 'doAction', oHeader, oTaskArray, @oBody1)

I must have the syntax wrong somewhere, but can't see where ...



Viewing all articles
Browse latest Browse all 10393

Trending Articles