Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Raaga #1
Complex DataTypes WebServices
Hi, I am having problem with the complex data types in webservices. I am
interested in r'ving 3 elements which are wsdl_key, partner_id and array of
FName Main CFComponent: Main.cfc <cfcomponent displayname='AffiliatesBatch'
hint='Batch API'> <cffunction access='remote' name='BatchReminders'
returntype='string'> <cfargument name='wsdl_key' required='true'
type='string'> <cfargument name='partner_id' required='true' type='numeric'>
<cfargument name='BatchArray' required='true' type='ThisBatch'> </cffuntion>
</cfcomponent> Sub CFComponent: ThisBatch.cfc <cfcomponent> <cfproperty
name='FName' type='string'> </cfcomponent> The above code is accepting only 1
FName, I am interested to send more number of Fname. Can you please suggest me
what changes I have to make for the above code to accept more Fname What is
the datatype of BatchArray: Is it of Array or structure type ( to extract the
data). Did't find any example for the array types. Looking for your help.
Thanks in advance -Raaga
Raaga Guest
-
Converting Datatypes
Hi, I need to change a varchar field in my DB to a small date/time field. The problem is I don't want to lose the data, as I have quite a lot of... -
Complex DataTypes
Ok, I created a Web Service using PHP5 SOAP extension. I created the WSDL and I can serve and consume that service in PHP. Now I am trying to... -
sql=access=datatypes?
What would be the corresponding data types for the following existing Access data types: Autonumber = (UniqueIdentifier?) Number =... -
complex datatypes and methods
Hi, I created a custom container class in order to return values from web method calls and this works fine, but my problem is that I added some... -
Datatypes in Informix
Hi, I am trying to obtain an extract of my Informix database into a formatted spreadsheet. The information of the fields in a table is... -
BSterner #2
Re: Complex DataTypes WebServices
If you need an array of 'FName''s, why not use an array of 'FNames'? Why are
you trying to store these in a CFC? Just store your names in an array,
serialize it using wddx and then deserialize it in the webservice.
<cfset aFNames = ArrayNew(1)>
<cfset aFNames[1] = "James">
<cfset aFNames[2] = "Alex">
<cfwddx input="#aFNames#" output="wFNames" action="cfml2wddx">
<cfinvoke webservice="Main" method="BatchReminders" returnvariable="rv">
<cfinvokeargument name="BatchArray" value="#wFNames#">
</cfinvoke>
Change the argument type for BatchArray to "string" and deserialize the array
in your web service function using...
<cfwddx input="#BatchArray#" output="aFNames" action="wddx2cfml">
You now have an array named "aFNames" you can do whatever you like with
BSterner Guest
-
Raaga #3
Re: Complex DataTypes WebServices
Hi, Thanks for the reply. I am creating a WSDL, so that is the reason i
stored this as CFC and offering as webservice. Other clients are going to
access this using [url]http://XXXXXXXXXXXXXXX/AffiliatesBatch.cfc?WSDL[/url] Thanks -Raaga
Raaga Guest
-
BSterner #4
Re: Complex DataTypes WebServices
Ok, but what do you need your clients to pass to the webservice? A list of
first names along with 'wsdl_key' and 'partner_id', correct? If all you need
is a list of names, then pass it as a string. Actually, now that I think about
it, you can just pass a comma delimited string of names. Then use the the List
Functions to extract the values or convert it to an array (Using ListToArray())
and loop the array. Forget about the the wddx stuff. Is there something
obvious I'm overlooking as to why you need the 'ThisBatch.cfc' component?
BSterner Guest
-
jonnycattt #5
Re: Complex DataTypes WebServices
Definitely. if others are going to be accessing your webservice, stick to stuff
that other languages can easily consume: strings and arrays. If I were writing
a client to this webservice in java, I'd now need to run wsdl2java, which would
create 5 or 6 separate classes/stubs, then i'd have to write a little more
code, all to pass you a list of filenames. all because you're accepting a
custom object instead of an array.
jonnycattt Guest
-
Raaga #6
Re: Complex DataTypes WebServices
Hi,
In future we are going to add some more items apart of from FName. eg. LName,addr1, addr2, city, state, zipcode, phno, email etc. That is the reason i used ThisBatch.cfc
Thanks
-Raaga
Raaga Guest
-
jonnycattt #7
Re: Complex DataTypes WebServices
in that case, consider using an array of structures.
jonnycattt Guest



Reply With Quote

