At 11:24 AM 11/13/2002 -0800, you wrote:

I debated on whether or not to adopt this methodology (structure-based 
return variables), but decided to go with the cftry/catch.

Might have to rethink this now. Thanks for the insight.






>On Wednesday, Nov 13, 2002, at 10:57 US/Pacific, Alexander Sherwood
>wrote:
> > When using CFTHROW with Web Services, is there a way to trim down the
> > error
> > message returned?
> >
> > When called as a component, the cfcatch.detail and cfcatch.message are
> > fine, but when called as a web service, they are loaded with AXIS fault
> > codes, etc.
> >
> > How has anyone else handled this?
>
>Ugly, isn't it? My team decided to not throw exceptions out of the Web
>Service and instead return a struct with the first element indicating
>success / failure and the second element being either the result (for
>success) or the CF exception details (for failure). That means that all
>our Web Service methods look like:
>
>         <cffunction name="foo" ...>
>                 ...args...
>                 <cfset returnValue = structNew()/>
>                 <cfset returnValue.success = true/>
>                 <cftry>
>                         ...
>                         do a bunch of stuff
>                         ...
>                         <cfset returnValue.result = whatever/>
>                 <cfcatch type="any">
>                         <cfset returnValue.success = false/>
>                         <cfset returnValue.result = structNew()/>
>                         <cfset returnValue.result.message = cfcatch.message/>
>                         <!--- etc --->
>                 </cfcatch>
>                 </cftry>
>                 <cfreturn returnValue/>
>         </cffunction>
>
>Sean A Corfield -- Director, Architecture
>Web Technology Group -- Macromedia, Inc.
>tel: (415) 252-2287 -- cell: (415) 717-8473
>aim: seancorfield -- http://www.macromedia.com
>An Architect's View -- http://www.corfield.org/blog/
>
>Introducing Macromedia Contribute. Web publishing for everyone.
>Learn more at http://www.macromedia.com/contribute
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm

Reply via email to