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

Re: Passing arrays

$
0
0
Re: Passing arrays
Web Service Proxy Generator
Re: Passing arrays
04/02/2012
07:46:47 AM
3GX0GOEVJ Show this entire thread in new window
Gratar Image based on email address
From:
To:
Attachments:
None
The .NET method was just copied from the Web Service documentation and it show's 6..., but both Reflector and the Proxy show's 8, so
I believe 8 must be correct.

Tried InvokeMethod - it gave me the same result.

I'm not surprised over your comment, so far it has not been a walk in the park trying to understand their documentation... I'll make contact
with them and check out, if they have supplied me with their latest documentation.

/Pål

There must be multiple overloads of the method you're trying to call because the method generated has 8 parameters while the .NET method you show has only 6. Check in Reflector to make sure you got the right signature - my guess is the one with 8 parameters has something different.

Part of the problem is that these parameters are reference parameters - I suspect that might cause problems when using InvokeMethod_ParameterArray because it won't know how to set the values back. I would try using InvokeMethod instead and passing the parameters in by refence.

FWIW, I can't help but marvel at the design of this service :-) Why would anybody create a service that has a bunch of out parameters when they could just return an object? Out parameters on a service are just never a good idea.

+++ Rick ---


I have downloaded the shareware version of the Proxy generator and I'm at the moment trying it out. It works like a charm
for other Web Service methods, that don't expect a string array passed in.

Have tried to read the documentation thoroughly, so I hope I haven't missed something obvious...
I receive a Type mismatch error back from the 'GetListSite2' method.

/Pål

The method 'GetListSite2' I'm talking to expect this:

int GetListSite2(string User, string Pwd, ref string IdTypeCA, ref string DefaultIdSite, ref string[] ListIdSite, ref string[] informationSite)

The proxy generated code:

FUNCTION GetListSite2(User as String,Pwd as String,IdTypeCA as String,DefaultIdSite as String,ListIdSite as StringArray,informationSite as StringArray,GetListSite2Result as Int32,GetListSite2ResultSpecified as Boolean) as Void LOCAL loException as Exception, lvResult as Void THIS.lError = .F. this.cErrorMsg = "" lvResult = .F. TRY lvResult = this.oService.GetListSite2(User,Pwd,@IdTypeCA,@DefaultIdSite,@ListIdSite,@informationSite,@GetListSite2Result,@GetListSite2ResultSpecified) CATCH to loException THIS.GetErrorDetail(loException) ENDTRY RETURN lvResult ENDFUNC

The test code from VFP:

LOCAL loArr as Westwind.WebConnection.ComArray loArr = loProxy.oBridge.CreateInstance("Westwind.WebConnection.ComArray") *-- Create the array instance with type loArr.Create("System.Object") loArr1 = loProxy.oBridge.CreateArray("System.String") loArr2 = loProxy.oBridge.CreateArray("System.String") *-- Add Items ? loArr1.AddItem('') ? loArr2.AddItem('') loArr.AddItem(' ') loArr.AddItem(' ') loArr.AddItem(m.IdTypeCA) loArr.AddItem(m.DefaultIdSite) loArr.AddItem(loArr1) loArr.AddItem(loArr2) loArr.AddItem(m.GetListSite2Result) loArr.AddItem(m.GetListSite2ResultSpecified) lcResult = loProxy.oBridge.InvokeMethod_ParameterArray(loProxy, "GetListSite2",loArr)




Viewing all articles
Browse latest Browse all 10393

Trending Articles