[flexcoders] Re: Write file to server
OK, I understand. Ultimately, the data in this file will be passed via a webservice to and from a weblogic server. While developing just the ointerface piece, I thought I might be able to work just locally by reading/writing the file out. Guess it works on the read but not on the write. Although, is there a way to write it on weblogic without a separate script to catch the request and write the data? Sounds like not. Thanks Mike --- In flexcoders@yahoogroups.com, valdhor valdhorli...@... wrote: Mike You need to send your data to some kind of server side code (Eg. PHP). From your code, you are sending data to a text file. A text file has no idea what to do with the data you are sending it (Actually, the text file doesn't even see the data - text files are very unintelligent as files go) so does nothing. Your code does exactly what you told it to. It made the request to load the file. Once the request is made the complete event fires and you get your message. What you need is some form of server to run code on. What server do you have? --- In flexcoders@yahoogroups.com, mccaffreymike mcc.mike@ wrote: Flex rookie here... Trying to read/change/write a text file on the server. Why doesn't this file save work? I'm able to use the URLRequest/URLLoader to read the file, but want to write changes back to the file. I get the File saved message but the file is not updated. Thanks //save the file request = new URLRequest(C:\\temp.txt); request.method = URLRequestMethod.POST; request.data = changedData; loader = new URLLoader(); loader.addEventListener(Event.COMPLETE, saveComplete); loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError); try { loader.load(request); } catch (e:Error){ Alert.show(Error in loader.load + e.message); } } private function saveComplete(event:Event):void { Alert.show(File saved); }
[flexcoders] Write file to server
Flex rookie here... Trying to read/change/write a text file on the server. Why doesn't this file save work? I'm able to use the URLRequest/URLLoader to read the file, but want to write changes back to the file. I get the File saved message but the file is not updated. Thanks //save the file request = new URLRequest(C:\\temp.txt); request.method = URLRequestMethod.POST; request.data = changedData; loader = new URLLoader(); loader.addEventListener(Event.COMPLETE, saveComplete); loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError); try { loader.load(request); } catch (e:Error){ Alert.show(Error in loader.load + e.message); } } private function saveComplete(event:Event):void { Alert.show(File saved); }
[flexcoders] Invalid Element returned for webservice complexType
Using Flex 3, I've imported a webservice. I can test this webservice via junit in Eclipse and it works. Fails when connecting in Flex. The input strcuture is loaded correctly. No matter how I change the structure it alwasy gets an invalid element. I even tried to make the structure so it only had one int element and it still gets the Invalid element erro. When I call the webservice I get a org.xml.sax.SAXException: Invalid element in...RequestType - StartTime/faultstring error for the first element in the complexType. xsd:element name=getSeriesData xsd:complexType xsd:sequence xsd:element name=inputParms type=pd:RequestType / /xsd:sequence /xsd:complexType xsd:complexType name=RequestType xsd:sequence xsd:element name=StartTime type=xsd:dateTime minOccurs=0 / xsd:element name=EndTime type=xsd:dateTime minOccurs=0 / xsd:element name=Interval type=xsd:int minOccurs=0 / ... /xsd:sequence /xsd:complexType Error Back: faultstringorg.xml.sax.SAXException: Invalid element in com.raytheon.gpsocx.service.enterprise.performancedataservice.v1.data. RequestType - StartTime/faultstring Any help out there? Thanks