"...This does not
necessarily perform any kind of validation..."

CFMX doesn't perform any validation on webservice request format! That's half the 
point of the WSDL file! The WSDL IS the XML schema for the web service, both response 
AND request, validation against this schema upon receipt of a SOAP request is a 
fundamental part of the responsibilities of a web service server.

"...unless you need to explicitly publish
the complete data structure requirements via SOAP..."

I need precicly this.

I have been in contact with Macromedia, and apparently it is not possible to obtain

"...that type of granularity [of argument definitions] with this release of CFMX."

But even so, not validating the request against the WSDL seems a little flaky?

Simon.

-----Original Message-----
From: Spike [mailto:[EMAIL PROTECTED]] 
Sent: 18 September 2002 16:00
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] cfcomponent taking arrays of complex types

The document you refer to is mainly targeted at the publishing of
webservices so that clients can read and understand the type of data
that they are supposed to send to the webservice. This does not
necessarily perform any kind of validation that the data which has been
passed to it is useable by the component.

The validation of the data itself would have to be done, possible using
a utility validate() function, in the component code. You would have to
create this utility function yourself, but if you wanted to have any
sort of control over data integrity, you would be doing that anyhow.

Also, are you assuming that you must send data to a coldFusion component
through the webservices interface, or is that also a requirement of the
application?

If it is not a requirement, you can think of the validation of the data
for the component in the same way as you might have validated the input
to a custom tag in previous versions of ColdFusion.

For example, you might well have had the following code at the top of a
custom tag:

<cfparam name="attributes.aFoo" required="yes" type="array">

<cfloop from="1" to="#arrayLen(attributes.aFoo)#" index="i">
<cfif not isStruct(attributes.aFoo[i])>
<cfabort showerror="Element #i# of attribute 'aFoo' passed to custom tag
#getCurrentTemplatePath()# is not a structure">
</cfif>
</cfloop>

etc...


In cfmx this would be replaced with the following code:

<cffunction name="blah" access="remote" hint="This function does some
funky stuff with arrays of structures">

<cfargument name="attributes.aFoo" required="yes" type="array">

<cfloop from="1" to="#arrayLen(attributes.aFoo)#" index="i">
<cfif not isStruct(attributes.aFoo[i])>
<cfabort showerror="Element #i# of attribute 'aFoo' passed to custom tag
#getCurrentTemplatePath()# is not a structure">
</cfif>
</cfloop>

etc...


So, in answer to your question, unless you need to explicitly publish
the complete data structure requirements via SOAP, you can pretty safely
assume that things work the same as they did in previous versions of CF.

Spike


> -----Original Message-----
> From: Simon Hartley [mailto:[EMAIL PROTECTED]] 
> Sent: 18 September 2002 16:43
> To: [EMAIL PROTECTED]
> Subject: [ cf-dev ] cfcomponent taking arrays of complex types
> 
> 
> Hiya all
> 
> Can anyone help.
> 
> We are considering using MX as part of a project I am 
> working, and I am carrying an investigation as to whether it 
> meets our requirements.
> 
> Part of those requirements is that one of our <cfcomponents> 
> must take an argument of an array of structs of a particular 
> format as one of its arguments
> 
> Now, I know MX can verify that a SOAP request has the correct 
> number of arguments, and that each of these arguments is of 
> the correct type. Furthermore MX has a number of built-in 
> types that it can recognise 'out-of-the-box'. These being;
> 
> numeric
> boolean
> array
> binary
> date
> void
> struct
> 
> And MX goes even further, in that you can define your own 
> complex types, see;
> 
> /cfdocs/Developing_ColdFusion_MX_Applications_with_CFML/webser
> vices5.html#1203363
> 
> Now, the service we wish to build will take a number of 
> primative types, forname, surname, age etc and an array. This 
> array is to contain service_applications items. A 
> service_application itself consists of a number primitive 
> arguments, serviceID, serviceStartDte etc.
> 
> It makes sense to represent a service_application item as a 
> complex type, defined using the process given in the cfdoc 
> referenced above.
> 
> However, how is it that I can tell the cfcomponent to expect 
> not simply an array, but an array of service_application 
> items? If CFMX cannot do this, then surely CFMX has not 
> exposed the full expresibility of the underlying SOAP layer?
> 
> It is simple to manually construct a SOAP request which 
> specifies an argument as an array of a specific type by 
> deriving the argument type from SOAP-ENC:Array, and 
> specifiying the contained type using SOAP-ENC:arrayType attribute.
> 
> How is this done in CFMX?
> 
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED] For human help, e-mail: 
> [EMAIL PROTECTED]
> 
> 



-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to