Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Names instead of numbers as indexes of arrays
Message
De
02/03/2009 12:07:49
 
 
À
02/03/2009 07:37:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Web Services
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows XP
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01383776
Message ID:
01385015
Vues:
44
In a situation like this, I would fire up VS.Net and let it create the Class from the wizard. Then you can see what would be expected from a .Net situation, and make the translation to VFP. Or, as I said in the other post on this, run the .Net class using the CLRExtender or some other method, from within VFP.

Hank

>>It depends on what you are using to interface with the Web Service and more importantly what the server expects.
>>
>>As you know VFP arrays don't support named indexers, so if you end up passing an array that won't work. You can use collections, but VFP collections are not likely to be a workable parameter input to a Web Service call.
>>
>>In general too, Web Services don't support named indexer's either. Web Services tend to serialize data into simple arrays. For example, if you have a .NET Web Service and you publish a collection or a dictionary into the WSDL it'll end up as an array.
>>
>>Why do you need this functionality and why should it matter how you get the data into it? If this is necessary in your code why not create a collection internally and then turn the collection back into an array or something along those lines.
>
>In this case... unfortunately... it ask only for index name... something near to (translated for VFP)
>
>
dimension aCategories[2]
>aCategories[1]=1
>aCategories[2]=2
>dimension aDatainput[4]
>aDatainput["product_id"]="0001"
>aDatainput["description"]="product description"
>aDatainput["price"]=10.22
>aDatainput["categories"]=aCategories
>
>loWSHandler = Newobject("WSHandler",Iif(Version(2)=0,"",Home()+"FFC\")+"_ws3client.vcx")
>loWS = loWSHandler.SetupClient("http://www.domain.com/store/index.php/api/soap/index/wsdl/1")
>lsessionId = loWS.login('adminremote', 'password')
>axpto = loWS.Call(lsessionId, [product.currentStore], [default])
>lcprod = loWS.call(lsessionId, 'product.create', @aDatainput);
>
>
>If I try to use collections instead array aDatainput.. It will not be interpreted wrongly? I mean, input object not array?
>
>Maybe, by years working with VFP.. This is the first time that I face limitations here!
>
>tks
>>
>>+++ Rick ---
>>
>>>To consuming a Web Services, By parameter, I need to set as array's index a name instead of number, as described following:
>>>
>>>
>>>array('name'=>'new name of product'),
>>>
>>>In VFP, is that possibility, I mean... The possibility to contour this difference.. giving something to this web service that can be interpreted on its needs?
>>>
>>>Any help will be full appreciated..
>>>
>>>
>>>Claudio
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform