Is there a list of possible faultCode values for Flex's Fault object (mx.rpc.Fault; Flex SDK: 3.4)?
At least faultCodes for faults generated on the client side?
I'm thinking of something like the list of possible runtime errors, found at Adobe's RTE List, but for faultCodes (such as Client.Error.MessageSend, Server.Processing, etc).
Could very well be that I just don't understand my problem well enough to do a decent search, but I've come up with nothing all day. It may also be that there is only one or two client-side faultCode values. Seems like it would make sense that there wouldn't be a comprehensive list of server-side faultCode values, but maybe there's a list of BlazeDS/LiveCycle faultCodes?
Any help much appreciated.
So, it looks like the answer is pretty much "No". I guess this makes sense, I guess, since most server-side faults would come from the server. I figured there would be a list of standard fault types, at least, as part of BlazeDS and/or LCDS.
Here's a pretty good post about setting up exception handling in BlazeDS. Does a good job of explaining why the answer to this question is No, as well as providing a good way of handling exceptions in BlazeDS, which would give you a custom list of fault codes.
http://www.flexpasta.com/index.php/2008/05/16/exception-handling-with-blazeds-and-flex/
Maybe this may help:
There is what they called Fault Event(mx.rpc.events.FaultEvent)
its properties has:
var event:FaultEvent = new FaultEvent();
trace (event.message);
Try adding this in an array so that you could have ur list.
Hope it helps
Related
I have been trying to find a way to connect Flex to sharepoint in an elegant way that allows me to update lists, build charts, and create widgets with FLEX on the client-side. I have researched this extensively but I am running into circles.
I understand the basics of Flex data connection/webservices/etc... , I just can't seem to get my head around how to use the sharepoint list services.
Does anybody out there have a nice detailed example of what I'm trying to achieve? Simple examples work too! :)
Thanks so much Everyone!
-E.
Look at the "SOAP query example" or the WSDL from the SharePoint web-service (e.g. .../_vti_bin/lists.asmx?op=GetListItems or ../_vti_bin/lists.asmx?op=GetListItems&WSDL) and then look at the corresponding MSDN documentation (such as GetListItems) on how to "use" the web-service.
It takes a little bit of familiarity to "know" to map viewFields with <viewFields>...</viewFields> (most work like this), but... the MSDN documentation (if prodded carefully) says "what" to put in the XML where the WSDL just gives the near-useless outline. There are a number of examples in the tubes (and related SO questions) of hand-rolled SOAP access for SP for various tasks.
Microsoft also has some Open Specifications -- the link is always hard for me to find. Lots of stuff under the SharePoint branch. YMMV and it's mostly white-paper, but a good resource.
Not sure what tools Flex has but because of the limited WSDL support, most of the mapping has to be hand-coded or come from a better definition source -- hopefully "an existing library" which can be used directly or modified-to-suit.
I would highly recommend using a tool for testing the service access -- e.g. soapUI, which actually has a horrid UI -- because even the littlest error will come back with a cryptic error messages. Also, make sure to use SOAP 1.2.
Happy (less than maximal pain) coding.
P.S. A more specific question about a specific web-service would likely yield better responses.
Over the past three weeks, I have lost at least 120 man hours because of some lesser known functionality in ActionScript 3. One of the problems was that, with Internet Explorer, if there are too many messages sent through LocalConnections, it will slow the messages sent through, but in the standalone player and in Firefox, this threshold is significantly higher. Another was that the static values of a class are instantiated even if the member itself is not being used:
import path.to.FooClass;
private function thisIsNeverCalledButItEnsuresThatFooClassIsImported():void
{
var f:FooClass = new FooClass();
}
Since FooClass had a static reference to a Singleton, that Singleton was instantiated so when I loaded a Module which used that Singleton, it would bind to values in an unpredictable way.
Additional cases where things behave in an unexpected way:
MovieClip.addFrameScript
flash.trace.Trace as a class
int is a faster incrementer class, Number is faster for mathematics, and uint is incredibly slow.
PrintDataGrid, if it has only one page, needs to have an empty value appended to the end of its dataProvider
If you use try...catch around two LocalConnections and connect them to the same channel, you will force garbage collection without needing System.gc
So here's the question (and I'm sorry for omitting this in the original post), is there any consolidated documentation for this type of behavior anywhere? Is there any (even non-Adobe) documentation on these issues (websites, forums, books, ANYTHING)? I know that these things are definitely easy enough TO document, but has anyone done so?
If not, am I missing anything? Are there other issues which I should know about?
This kind of useful information is very often not "centralized". Moreover, what you are looking for is something related to the experience of the programmer (more than to official docs).
FYI, there are two other methods for ensuring a class is included.
#1 - This syntax is actually used in the Flex source code:
import path.to.FooClass; FooClass; // note double reference
public class References
{
// No references needed in this class
}
#2 - Use the includes command line argument
-includes path.to.FooClass
You can always submit your experience using the "feedback" section in the help. Unfortunately, this is less obvious than the link that used to be at the bottom of each page in the older help files (which also served the useful function of opening a browser window with the web version of that help page).
Adobe says that it incorporates the comments from previous versions of the help into new versions, but my own observation suggests that there are instances where it does not happen. However, that and the appropriate cookbook are still the best avenue for those who believe that this kind of information should be centralized.
Note that the whole purpose behind modules is to avoid compiling code multiple times, so importing FooClass kind of defeated the purpose. The problems you had in this instance are just one of the many that happen if you use Singletons, and it's unfortunate that the first official Framework, Cairngorm, encouraged their widespread use. Check out http://misko.hevery.com/2008/08/17/singletons-are-pathological-liars/ .
We got a long-running website where XSS lurks. The problem comes from that some developers directly - without using HtmlEncode/Decode() - retrieve Request["sth"] to do the process, putting on the web.
I wonder if there is any mechanism like HTTPModule to help us HtmlEncode() all the items in a Http request to avoid XSS to some extent.
Appreciate for any suggestion.
Rgds,
Ricky
The problem is not retrieving Request data without HTML-encoding. In fact that's perfectly correct. You should not encode any text until the final output stage when you spit it into an HTML page.
Trying to blanket-encode incoming parameters, whether that's HTML-encoding or SQL-encoding, is totally the wrong thing. It may hide XSS holes in your app but it does not fix them. You will still have a hole if you output content that hasn't come from parameters, or has been processed since then. Meanwhile the automatic encoding will fill your database with multiply-escaped &amp;amp;amp;amp;amp; crud.
You need to fix the output stage, that's where the problem lies.
Like bobince said, this is an output problem, not an input problem. If you can isolate where this data is being output on the page, you could create a Filter and add it to the Response object. This filter would isolate the areas that are common output and then HtmlEncode them.
It seems like a fairly large hassle to set up a proper debug environment in ASP.NET and I'm just wondering if using Asserts are the way to go or not. I've read a bit and saw that you need to modify your web.config to properly use Asserts. Is this usually the best way to go or are there other methods of debugging that might be easier to use?
We don't use a unit testing framework so that isn't really relevant to the question.
How do you know the difference between them working properly or not working at all? Currently I can put in asserts in my code and it will do absolutely nothing because they are not configured in the web.config. This seems dangerous to me.
I would direct you here: When should I use Debug.Assert()?. There are several good answers that can tell you when it's good to use them, and you can figure out from there if it's worth it in your app.
Having Debug Asserts will ensure your code is correct. With the right combination of test cases will definitely help you.
Several Unit test frameworks come with handlers that can log messages and throw exceptions on asserts. Choosing one of these framework or writing your own handler is something that you may have to think about. But once the Unit test code catches these exceptions, they should be logged and marked as failed.
I have seen several projects that use the Trace functionality to capture events and stream them out to a log file. I have been unsuccessful in finding a simple to follow guide that will show me how to configure Trace to capture and write said logfile. Does anyone have a link recommendations, or provide some simple steps to follow?
The Trace object writes the statements to any attached TraceListeners. You can build your own, but there are a number already defined in the System.Diagnostics namespace, including:
ConsoleTraceListener (Console)
DefaultTraceListener (Visual Studio / Debugger)
DelimitedListTraceListener (TextWriter, special formatting)
EventLogTraceListener (EventLog - anything that inherits from System.Diagnostics.EventLog)
TextWriterTraceListener (TextWriter - think file)
You can, of course, inherit your own from the TraceListener class that writes to where ever you want. For example, you could log to a database, have it send e-mails or pages in certain situations, or write the statements back to a logging platform like log4net.
The big thing is that you need to create an instance of whatever listeners you want and then add them to the Trace' class Listeners collection. You can add as many as you need and Trace will write to all of them. This way, you can write your logging code once using a well-supported and understood object that's part of the framework, and you can attach anything you need to it.
I stumbled into a MSDN article that really helps. Sorry I didn't find it before posting the question but perhaps others may have the same question and haven't found this link.
Take a look at logging frameworks. We rolled out own, but are now migrating over to log4net available free at http://logging.apache.org/log4net/
Im looking for a way to set the Category of the EventLog, the FormattedEventLogTraceListener writes into (not the category of the message).
But I can't find an appropriate property of this class.
Is it possible to set this?