Mx:request in HTTPService subclass
I have an HTTPService subclass, I would like to use the
<mx:request> special tag with it, is this possible?
"revmischa" <[email protected]> wrote in
message
news:gf2gl3$miu$[email protected]..
>I have an HTTPService subclass, I would like to use the
<mx:request>
>special tag with it, is this possible?
Use
<yourNS:request>
HTH;
Amy
Similar Messages
-
Hwo to use "request" of HTTPServices in action script
hello
i have to use this code in action script
i am facing problem in "request"Check the fault your request is generating. See the fault
string you must be getting back, look into it and get the error
number from there. Search for that error number in flex, it will
make your search more sensible and specific. -
Httpservice.send() resulting in two http requests
hi,
I am using HTTPService() to send some xml data inside an HTTP
POST request. But very often, i do
see this resulting in two local ports being opened and the
http request being sent out twice, once from each port.
is this possible in some race condition?
thanks,
Sunilsome snippets of my code:
//build the http request
var request:HTTPService = new HTTPService();
request.method = "post";
request.headers = headers[request.method];
request.url = httpServer;
request.resultFormat = HTTPService.RESULT_FORMAT_TEXT;
request.contentType = "text/xml";
request.addEventListener(InvokeEvent.INVOKE , httpInvoke,
false);
i do see the invoke callback only being called once. That
makes me guess that from the application code, httpservice.send()
is called only once.
any help will be great. -
Dynamic HTTPService request AS3
I'm doing a mashup in Flex right now using Yahoo Maps. One of
the functions allows users to create their own routes.
Here's the problem. I need a dynamic httpService request
because I never know beforehand how many markers a route holds.
Here's my code:
[Bindable]
private var rssFeed:String;
private function opslaanRoute(event:Event):void
if(this.tekstInputVenster.text!="")
if(markerLijst.length>0)
rssFeed = "<route>";
rssFeed +=
"<routebeschrijving>"+this.tekstInputVenster.text+"</routebeschrijving>";
var lengte:Number = markerLijst.length;
for(var d:Number=0;d<lengte;d++)
rssFeed +="<marker>";
rssFeed +=
"<latlon"+d+">"+markerLijst[d][0]+"</latlon"+d+">";
rssFeed +=
"<indexMarker"+d+">"+markerLijst[d][1]+"</indexMarker"+d+">";
rssFeed +=
"<titel"+d+">"+markerLijst[d][2]+"</titel"+d+">";
rssFeed +=
"<beschrijving"+d+">"+markerLijst[d][3]+"</beschrijving"+d+">";
rssFeed +="</marker>";
rssFeed += "<aantal>"+indexMarkers+"</aantal>";
rssFeed += "<userid>"+_loginid+"</userid>";
rssFeed += "</route>";
opslaanR.send();
else
Alert.show("U moet markers toevoegen om op te slaan!");
else
Alert.show("U moet een routebeschrijving toevoegen om op te
slaan!");
The httpservice looks like this:
<mx:HTTPService
id="opslaanR"
url="url"
useProxy="false"
method="POST"
resultFormat="e4x"
result="opslaanSucces(event)"
showBusyCursor="true"
>
<mx:request>
{rssFeed}
</mx:request>
</mx:HTTPService>
The "aantal" tag is the number of markers a route holds.
Basically I want to loop the $_POST variables in php using "aantal"
so I can add them to my database. The PHP works flawlessly but it
never gets the httpservice values.
Please help.well you understood me, I want an alternative to the script what I put in AS2,
but I think. of the script as you sent me centenary assume that I have in the library button menu0 menu1 .....
But I have only one menu button.
because I tried it and it did not work.
var ClassRef: Class = Class (getDefinitionByName ("menu" + i));
I will be happy if later you look again -
Help: Sending HTTPService request using POST to a php script
Hello all,
I need help in learning the proper method of communicating to php scripts from flex 3. I am very new to flex 3, php and web development. Thanks!
What I am trying to do is as follows:
1. User drags and drops a few items in a list control
2. user clicks a button to send these keywords to server php script
3. server will form a query based on the words sent and retrieve records and send them back
Here is what I have done so far:
1. When I send a request to server without any parameters, I amable to receive the request and query the database and send results in xml format
current issues I am facing:
1. I am gathering the list of entries in list control as follows:
<*** this function is callled when user decides to send request to server ***>private function startsearch():void {
var i:int;
var myAC:ArrayCollection = ArrayCollection(SelCtypes_id.dataProvider);
var nct:XML = new XML("<contenttypes></contenttypes>");
// add contenttype child now
for (i = 0; i<myAC.length; i++) {
nct.appendChild(XML(<contenttype>{myAC[i].toString()}</contenttype>));
var params:Object = new Object();
params.contenttypes = nct.toXMLString();
getsearchresults.send(params);
<*** my http service entry****>
<mx:HTTPService id="getsearchresults"
method="post"
url="http://localhost/search_xml.php"
result="handlesearchresultsXml(event)"
contentType="application/xml" />
This is what I see in flex debugger just when the request is sent out:
-> just before gersearchresults.send(params) call:
params.contenttypes = "<contenttypes>
<contenttype>AVI</contenttype>
<contenttype>SWF</contenttype>
</contenttypes>"
<*** within the HTTPrequest send function, I see th following in debugger ***>
message.contentType="application/xml"
message.body = paramsToSend shows "<contenttypes><contenttypes>
<contenttype>AVI</contenttype>
<contenttype>SWF</contenttype>
</contenttypes></contenttypes>"
This looks like my XML object is again formatted by an out <contenttypes> tag and the string is converted to be HTML safe (i.e. <, > notation).
It looks like I am not doing something right with my params formation to XML and HTTPservice is reformatting it to be some form of XML (I do not know XML well either :-)
My questions:
1. What am I doing wrong?
2. If there is a good example where I can send multiple parameters from flex client to php server and get data back where the request parameters will beof the form...
<query>
<type1>
<type1val>value1</type1val>
<type1val>value2</type1val>
</type1>
<type2>
<type2val>value3</type2val>
<type2val>value4</type2val>
</type2>
</query>
Thanks for your help!Hi, I'm having a problem with a similiar issue :/
I'm getting the error #1010 (A term is undefined and has no properties):
at flexGraph/httpResultHandlerUserInfo()
at flexGraph/__userInfoXML_result()
etc.
I removed some parts of the code so it's easier to read, if you can help me. I'm trying to populate a datagrid with info from a database, according to the alias I choose in the ComboBox. I get the error when I pick an alias from the ComboBox.
<mx:Script>
<![CDATA[
import mx.collections.ArrayCollection;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.events.DropdownEvent;
[Bindable] private var usersInfo:ArrayCollection;
private function httpResultHandlerUserInfo(event:ResultEvent):void{
usersInfo = event.result.users.user;
private function chooseUserCB(event:DropdownEvent):void{
userInfoXML.send();
]]>
<mx:HTTPService id="userInfoXML" url="http://www.mysecondplace.org/flex/userInfo.php"
result="httpResultHandlerUserInfo(event)"
useProxy="false" method="POST">
<mx:request xmlns=""><alias>{usersAliasCB.selectedItem.alias}</alias></mx:request>
</mx:HTTPService>
<mx:ComboBox id="usersAliasCB"
x="10" y="10"
labelField="alias"
close="chooseUserCB(event)"/>
<mx:DataGrid id="testing"
x="10" y="100"
dataProvider="{usersInfo}"/>
Here's an example from the PHP file:
$query_user = "SELECT * FROM users WHERE alias='.$_POST["alias"].'";
Help me please -
I am getting insanely frustrated over this.
I keep getting an error from the server saying wrong_node,
and I noticed after sniffing the HTTP post the xml is out of order
then what I have written here:
quote:
<mx:HTTPService id="shareRequest" resultFormat="e4x" url="
http://box.net/api/1.0/xml"
useProxy="false" method="POST" contentType="application/xml">
<mx:request xmlns="">
<request>
<action>public_share</action>
<api_key>v6gf5ghjppgc24n6gr</api_key>
<auth_token>ghhgn556df4s</auth_token>
<target>file</target>
<target_id>{idtxt.text}</target_id>
<password>{passwordtxt.text}</password>
<message></message><emails></emails>
</request>
</mx:request>
</mx:HTTPService>
And heres what it sends:
quote:
<request><action>public_share</action><api_key>v6mx99comslgqjth5ujb1jppgc24n6gr</api_key> <auth_token>e0903lezcyy4xetzl0772ose0drl2afs</auth_token><emails
/><message
/><password>fgg</password><target>file</target><target_id>71407783</target_id></request>
Its posting in alphabetical order and this looks like its
unacceptable to the server. Is there any way I can get around this
and get it to post in the order I want? Id really appriciate any
help.Are you sure it is the order that the server is having
difficulty with? I would not expect that, and have not seen it with
any web server platforums I have worked with. The name=value pair
structure should make this moot. Oh, wait, i see you have changed
the contentType. I know some folks have had trouble with that. I
send my xml as strings in a normal name=value parameter.
Tracy -
Hi,
I've faced a problem with HTTPService. I want to send a
parameter with a <request> markup to the jsp page and get
data based on this parameter. The service populate an
ArrayCollection.
I've used a button to execute the httpserv.send() method but
it doesn't work as I want it to.
The problem is, proper data appears after the second click on
the button. After the first click, ArrayCollection doesn't
populate, after second it populates right. The same thing happens
with changing parameter - after change and click, array is still
populated with the data representing previous prameter. After
second click, everything show as it should. Another parameter
change works the same.
Any ideas how to get data AFTER sending request? HttpService
code below.
Thanks in advance.
Best regards,
Wojtek
<mx:HTTPService
id="getPermissions"
url="
http://.../getPermissions.jsp"
method="POST"
useProxy="false"
result="permissionsArray=ArrayCollection(getPermissions.lastResult.permissions.permission );"
fault="handleFault(event)"
>
<mx:request xmlns="">
<contr_nr>{dataGrid1.selectedItem.contr_nr}</contr_nr>
</mx:request>
</mx:HTTPService>The problem has been solved. I figured out that it had
nothing to do with HTTPService, the service was ok (as it looks :).
The problem was with data binding. Thanks anyway. -
HTTPService or mx:RichTextEditor isn't working well - htmlText
Hello
I'm working with the component <mx:RichTextEditor/>
I have a big problem after the HTTPService send the code and stores it in database.
Every time I catch the htmlText from RichTextEditor, he is putting a strange tag. I need to clean these tags.
I send this HTML code (htmlText from RichTextEditor) and store in the database.
In another moment I want to retrieve this code and throw in a TextArea.- this is the objetives, but I had a problem with this.
Look my code:
<mx:RichTextEditor id="ds_noticia" title="Descrição da notícia"
width="80%" htmlText="{dgNotRequest.selectedItem.dsNews}" />
<mx:Button id="submit" label="{'ADD'}" click="finish()" />
//Script:
private function concluir():void{
newsService.send();
<mx:HTTPService id=" newsService " url=" class/class_news.php"
resultFormat="object" result="newsHandler(event)" fault="faultHandler(event)" method="POST" >
<mx:request xmlns="">
<ds_noticia><![CDATA[{ds_noticia.htmlText}]]></ds_noticia>
</mx:request>
</mx:HTTPService>
Whit firebug I can see the post:
ds_noticia<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B>Introdução as tecnicas inter latifundiarias</B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Aplicabilidade e manutenbilidade da gestão de requisito de isotopo por molécula astridente:<B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B>Números</B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">A tecnologia foi adotada pela Cast há mais de dois anos e chegou a ter mais de 200 servidores virtuais. </FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">O projeto de virtualização demorou seis meses para ficar pronto e foram gastos quase R$ 600.000,00 na compra de equipamentos, software, instalação e treinamento.</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Sem a virtualização, a Cast gastaria com renovações e novas aquisições, isso sem considerar o aluguel de espaço físico e custos com energia.</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B>Resultados</B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Desde a implementação da virtualização foi possível reduzir o tempo de atendimento de serviços de dias para horas.</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Essas ações são importantes para a empresa, a sociedade e, principalmente, para o planeta. </FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0"><B>Fonte: </B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Gilson Fabio Robles Bernichi - Administrador de Banco Dados</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">James Lima da Silva - Coordenador de Suporte ao Desenvolvimento</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING="2"><LI><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Leonardo Amorim de Araujo – Coordenador de Infraestrutura e Segurança</FONT></LI></TEXTFORMAT>
If I could save this code, it would be perfect!
BUT the answer, after HTTPService send the content and it is saved into database
now the HTTPService show other code, this is not the same first code sanded!
ds_news = '<TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"><B>Introdução as tecnicas inter latifundiarias</B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">Aplicabilidade e manutenbilidade da gestão de requisito de isotopo por molécula astridente:<B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"><B></B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"><B>Números</B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">A tecnologia foi adotada pela Cast há mais de dois anos e chegou a ter mais de 200 servidores virtuais. </FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">O projeto de virtualização demorou seis meses para ficar pronto e foram gastos quase R$ 600.000,00 na compra de equipamentos, software, instalação e treinamento.</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">Sem a virtualização, a Cast gastaria com renovações e novas aquisições, isso sem considerar o aluguel de espaço físico e custos com energia.</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"><B>Resultados</B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">Desde a implementação da virtualização foi possível reduzir o tempo de atendimento de serviços de dias para horas.</FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">Essas ações são importantes para a empresa, a sociedade e, principalmente, para o planeta. </FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><P ALIGN=\"LEFT\"><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\"><B>Fonte: </B></FONT></P></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><LI><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">Gilson Fabio Robles Bernichi - Administrador de Banco Dados</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><LI><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">James Lima da Silva - Coordenador de Suporte ao Desenvolvimento</FONT></LI></TEXTFORMAT><TEXTFORMAT LEADING=\"2\"><LI><FONT FACE=\"Verdana\" SIZE=\"10\" COLOR=\"#0B333C\" LETTERSPACING=\"0\" KERNING=\"0\">Leonardo Amorim de Araujo ? Coordenador de Infraestrutura e Segurança</FONT></LI></TEXTFORMAT>'
who can help me ?
Who can imagine what is happened?
Who can understand why the flex put a tag (/) always before the sing (“)?
Thank you for help meThanks!!!!
This problem isn't with Adobe Flex. This problema is because PHP configuration at PHP.ini
When on, all ' (single-quote), " (double quote), \ (backslash) and NULL characters are escaped with a backslash automatically.
"Quando ligada, qualquer ' (aspas simples), " (aspas duplas), \ (barra invertida) e NULL será colocado uma barra-invertida antes (' vira \') automaticamente".
Is a tecnique of incripiting by PHP but this feature has been DEPRECATED as of PHP 5.3.0. As my Case.
LOOK the steps
1. Check php.ini into server:
a. Acess: /etc/php5/apache2/php.ini (In my case, i'm working with Linux-Umbuntu)
2. Verify the part that mentioned about eMagic quotes. It need be stay like fallow example:
; Magic quotes
; Magic quotes for incoming GET/POST/Cookie data.
magic_quotes_gpc = Off
; Magic quotes for runtime-generated data, e.g. data from SQL, from exec(), etc.
magic_quotes_runtime = Off
; Use Sybase-style magic quotes (escape ' with '' instead of \').
magic_quotes_sybase = Off
; Automatically add files before or after any PHP document.
auto_prepend_file =
auto_append_file =
; As of 4.0b4, PHP always outputs a character encoding by default in
; the Content-type: header. To disable sending of the charset, simply
; set it to be empty.
; PHP's built-in default is text/html
default_mimetype = "text/html"
default_charset = "utf-8"
; Always populate the $HTTP_RAW_POST_DATA variable.
;always_populate_raw_post_data = On
3. If necessary and diferent, disable the magic Quotes in php.ini: Put (OFF) in the place where is (ON)
We need change this because:
Inconvenience, if the property is on, it will put in a strange caracter (\) before ("). It is bat when you need to save html code to keep the format of the text.
it change important datas into database
This feature has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
The magic_quotes_gpc directive may only be disabled at the system level, and not at runtime. In otherwords, use of ini_set() is not an option.
FONTE: http://www.php.net/manual/en/security.magicquotes.php
thanks again. good luck -
HTTPService: How can I send a variable or call a function in it?
Ok i have the following HTTPService request:
<mx:HTTPService id="userRequest" url="
http://mywebsite/get_data.php"
useProxy="false" method="POST">
<mx:request xmlns="">
<user1>{username.text}</user1>
</mx:request>
</mx:HTTPService>
Pretty straight forward stuff there. EXCEPT... i want to use
a variable instead of 'username.text...
<user1>{UserNameList[0]}</user1>
OR i want to be able to call a function that will return the
results such as:
<user2>{ UserFunction() }</user2>
Of course, neither of these work and this makes me sad :(
Anyone have any ideas? Much appreciated~!on that i can't help
i'm a .net programmer an i use a lot httpservices but mostly
i use webservices to get my data.
But i can give my way of working. When you send your data
from flex you are sending a virtual xml file thru http, then in
.net using it xml class i read this stream of xml coming from flex,
go to my database, get the result , wrapped it in xml and send thru
stream again, so that flex understands the answer. When it gets to
flex i just use e4x to read my data.
There are tons of tutorials on the net for PHP, i wish i had
half for .Net :D -
HTTPService is not working.
I have an application in which I send an HTTP request using HttpService.send.
It works fine when I run it using FlexBuilder but when I simply open the main.html file in web browser(directly) it stops working.
In this case no Http Request is sent and the application is of no use.
Can anyone tell me the reason. I tried searching but didn't get anything relevant.Use the below methods in mxml to get the url details dynamically.
* Returns the current url that the swf player lives in
public static function getUrl():String
return ExternalInterface.call("window.location.href.toString");
* Returns the current host name.
* example: http://www.flexpasta.com/?x=1&y=2 would return www.flexpasta.com
public static function getHostName():String
return ExternalInterface.call("window.location.hostname.toString");
* Returns the current protocol, such as http:, https:, etc
public static function getProtocol():String
return ExternalInterface.call("window.location.protocol.toString");
* Gets the current port for the url
public static function getPort():String
return ExternalInterface.call("window.location.port.toString");
* Gets the context following the base of the url
* Example http://www.flexpasta.com/test?x=1&y=2 would return /test
public static function getContext():String
return ExternalInterface.call("window.location.pathname.toString"); -
Hi,
Posting in the 'General' forums as well. Did not yet get any response for the topic posted in the 'Configuration and Getting Started Discussion' forum.
I am having nightmares to call the POST method of a REST service thru Flex. Initially tried with the HTTPService without any proxy server. Wasn't able to call POST, though the GET method was successfully called. Please see the post here (http://www.flexdeveloper.eu/forums/actionscript-3-0/how-to-acces-post-method-of-rest-web -service-thru-flex/)
b THEN I tried with BlazeDS
, but with the same results!
I have set up BlazeDS with the integrated Tomcat option. I have also set up the Flex project as mentioned in the instructions. It is working fine when I run the sample projects.
But the problem is that
i when I try to access a
b POST for a REST service,
i I get the "HTTP/1.1 415 Unsupported Media Type" fault.
b The complete fault I'm getting is: [RPC Fault faultString="HTTP/1.1 415 Unsupported Media Type" faultCode="Server.Proxy.Request.Failed" faultDetail="HTTP/1.1 415 Unsupported Media Type"]
at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()[E:\dev \3.1.0\frameworks\projects\rpc\src\mx\rpc\AbstractInvoker.as:218]
at mx.rpc::Responder/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\Responder.as:53 ]
at mx.rpc::AsyncRequest/fault()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\rpc\AsyncRequest .as:103]
at HTTPMessageResponder/resultHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messagin g\channels\HTTPChannel.as:871]
at HTTPMessageResponder/completeHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messag ing\channels\HTTPChannel.as:940]
at ChannelRequestLoader/callEventCallback()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\mess aging\channels\HTTPChannel.as:1155]
at ChannelRequestLoader/completeHandler()[E:\dev\3.1.0\frameworks\projects\rpc\src\mx\messag ing\channels\HTTPChannel.as:1191]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
I have added correct entry to the policy-config.xml (I know this because the GET for the same REST service is working).
b Only the POST thing is giving me the fault!
Appreciate any inputs. (am in need of 'em badly)
thanks
BJGMy guess is that the Server/Rest service doesn't like the content type of the request. HTTPService uses a content type of application/x-www-form-urlencoded by default. Maybe the Rest service is expecting the request to be XML? If that's the case, you need to set the contentType property of the HTTPService to application/xml.
Sometimes an HTTP sniffer/proxy such as Charles can be useful for debugging these kinds of issues. If my suggestion doesn't help, capture the HTTP request and response using a HTTP sniffer like Charles and post back to this thread with it and someone will take a look at it for you. Thanks.
-Alex -
I am not able to call the url for some reason. When i click on submit it says in the browser status bar 'Waiting for localhost...'. The swf file is located at
'http://localhost:8080/web/main.swf' so its on the same domain. Heres the code.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Panel x="121" y="87" width="422" height="234" layout="absolute">
<mx:Label text="User Name:"/>
<mx:TextInput id="username"/>
<mx:Label text="Password:"/>
<mx:TextInput id="password"/>
<mx:Button label="Submit" click="userRequest.send()"/>
</mx:Panel>
<mx:HTTPService id="userRequest" url="http://localhost:8080/app/login.do" useProxy="false" method="POST">
<mx:request xmlns="">
<username>{username.text}</username>
<password>{password.text}</password>
</mx:request>
</mx:HTTPService>
</mx:Application>
When i hit the url (http://localhost:8080/app/login.do) directly it works. But not via swf file. Any suggestions would be helpful. Thanks.You might also want to consider using something like Charles Proxy to see what is being transmitted and received. Another thing to consider is if you need a crossdomain.xml file in the locaiton of the service. (likely you do).
If you are using Flash Builder 4 Beta you can also use the Network Monitor which might give some insight.
-Joe -
HTTPService.send() only works the first time
I have the follow HTTPService defintion in my mxml page:
<mx:HTTPService
id="updateRequest"
url="{accessURL}"
useProxy="false" result="onSuccessEvent(event)"
fault="onFailEvent(event)">
<mx:request>
<username>{userName}</username>
<password>{password}</password>
<id></id>
<sname></sname>
<value></value>
<randomNum>0</randomNum>
</mx:request>
</mx:HTTPService>
Here is my call:
updateRequest.request.id= myid;
updateRequest.request.sname= myname;
updateRequest.request.value = myvalue;
updateRequest.request.randomNum = Math.random();
updateRequest.send();
The first time call is successful, but second time(after 30
seconds), after send() function call, I didn't even received
HTTPService call from server side. Is this somehow cached or I need
to reinitial it? This looks strange.I am having the same issue but have already been using the
post method. When I click my refresh button or if the timer I have
set up resets I see no request made to the server.
private function onResult(Event:ResultEvent):void {
var myNum:int = Math.round(Math.random() * 2);
var xmlResult:XML = XML(Event.result);
_xlcMyListData = new XMLListCollection(xmlResult..asset);
<mx:HTTPService id="tempXML" resultFormat="e4x"
result="onResult(event)" method="POST" url="
http://mysite.net/info_wrapper.php?customer={customer.text}&username={username.text}&a mp;password={password.text}"
useProxy="false"/>
<mx:TileList dataProvider="{_xlcMyListData}"
labelField="fleet" left="35" right="15"
width="350" backgroundColor="#000000" color="#ff0000"
fontSize="27" borderColor="#000000" columnWidth="315"
rowHeight="50" themeColor="#808080" fontWeight="bold"
allowMultipleSelection="true" id="TileList1" height="0" y="202"
x="178"/>
<mx:Button label="Refresh Page Now" height="27"
fillAlphas="[1.0, 1.0]" fillColors="[#030000, #030000, #474545,
#474545]" borderColor="#DCDEDF" click="tempXML.send();"/> -
HTTPService POST with XML does not declare charset encoding
Hi all.
I'm trying to do a HTTP POST of some XML using HTTPService
and I've got it working apart form the fact that the HTTP message
sent does no declare what charcater set it is using for encoding.
As a test I send a 'ñ' character and it seems from the
resultant bytes that the charset being used is UTF-8.
My ActionScript is...
var xml:XML=new XML(<root/>);
xml.@testCharacter="ñ";
xml.appendChild(<login/>);
xml.login.@username="bob";
xml.login.@password="secret";
var httpService:HTTPService=new HTTPService();
httpService.url='
http://app.localhost/null';
httpService.method="POST";
httpService.contentType=HTTPService.CONTENT_TYPE_XML;
httpService.request=xml;
httpService.send();
And what seems to get sent over the wire is (shown in
8bit-ASCII)...
POST /null HTTP/1.1
Host: app.localhost
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7
Accept:
text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png ,*/*;q=0.5
Accept-Language: en,en-us;q=0.7,en-gb;q=0.3
Accept-Encoding: gzip,deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive: 300
Connection: keep-alive
Content-type: application/xml
Content-length: 77
<root testCharacter="A±">
<login username="bob" password="secret"/>
</root>
Anyone know (1) how I can control what character set gets
used for encoding and (2) how I can get either XML or HTTPService
to declare what the encoding is?
Thanks in advance, Neil.Jarod,
XML parser product managers who might be able to help you on a parser-specific issue like this "hang out" here on OTN in the XML forum. Have you tried posting there to catch their attention? Thanks. -
Can i have tow HttpService in the same application???
I try to use tow HttpService (one for delete row in a table
and the other for read the table):
<mx:HTTPService id="listcls" url="
http://127.0.0.1:32000/affcls.php"
useProxy="false" method="POST">
<mx:request xmlns="">
<clsci>{clsci.text}</clsci><clsint>{clsint.text}</clsint><prfci>{lstprfci.text}</prfci>
</mx:request>
</mx:HTTPService>
<mx:HTTPService id="supcls" url="
http://127.0.0.1:32000/suprcls.php"
useProxy="false" method="POST" >
<mx:request xmlns="">
<clsci>{toto.text}</clsci>
</mx:request>
</mx:HTTPService>
PHP files work correcly! But i must kill my application and
restart it to see the change!!!! Why?
Please help me!!!Hey MattAka,
If I understood correctly, you want to send DELETE, get
result, then fire off READ, then get result? You can definitely use
two HttpServices in your app. Make two result handlers, first call
DELETE, then on result why not call both the DELETE result handler
and READ send and wait for that result?
<mx:HTTPService id="supcls" url="
http://127.0.0.1:32000/suprcls.php"
useProxy="false" method="POST" result="
handleDeleteResult();listcls.send()">
Or, handle the result of DELETE and in that function, call
the READ.send(). I think that's the same thing Jeffrey was aiming
at.
Maybe you are looking for
-
Soft images in Bridge/ PS CS4
Hi, I'm wondering if anyone here who uses PS CS4 & Bridge can help me with an issue that has been bugging me for a while. I am at the point where I am considering selling my gear and reinvesting in something else, both in terms of software and hardwa
-
I cannot log into iCloud using my Apple username and password. I keep getting an error message that states "CANNOT SIGN UP - The Apple ID is valid but is not an iCloud account." How do I fix this?
-
FAST ACCESS FACIAL RECOGNITION WON'T WORK ON DELL STUDIO 1555 SINCE MOZILLA UPDATE
When Firefox updated my Facial Recognition Fast Access on Dell Studio 1555 no longer works. The box shows up but not green line around it
-
SQL*Plus Worksheet formating
I have Oracle Client 8.1.7 installed in my computer, and I can't seem to have the desired output format with the SQL*Plus worksheet. I have a database where the tables have several column, and most of these columns are text with 1024 characters lengt
-
Does OC4J support RMI/IIOP connections ?
Hi, I have only one question : Does OC4J support IIOP connections ? I'd like to connect as EJB client to OLAPService on Oracle9i server (CORBA object), but I can't. Thanks in advance