HTTPService sending parameters
Hi,
I am looking for a way to send in a list of parameters to my
JSP. I already know how to use <mx:Request> tag, but it only
allows for a predefined number of parameters (at design time). What
i want to do is to send in an x number of parameters in, basically,
send in an XMLList contents as parameter list.
The documentation on HTTPService has a method xmlEncode() and
xmlDecode(). I could not get it to work and there aren't any
working examples out there. I guess i could serialize an XMLList
into a xml string myself and send it as one parameter field and
then parse it in jsp... or use JSON.
Is there a workable design pattern for sending complex
objects in?
If i was to use HTTPService in ActionScript, theoretically i
could dynamically add parameters to the Request object. I just
don't know how to create and use HTTPService fom AS... can someone
show me? is it hs:HTTPService = new HTTPService();
hs.request.add("key", "value"); ??
Thanks for any help.
I personaly don't agree what they do in that example you
showed (
http://www.adobe.com/devnet/flex/articles/complex_data_02.html),
that is way too much extra unnecessary fanciness that adds
additional layer of logic on both sides, flex and jsp,which does
not really give any justifiable FLEXIbility to developer
why would you want to generate xml then on server side parse
xml when you can just as easily build request parametes on flex
side iteratively and same thing on jsp (with existing servler/jsp
API ) Exaple : iterate through all or partial request parameters
with code something like this :
for (java.util.Enumeration e = request.getParameterNames();
e.hasMoreElements() ;) {
String name = (String) e.nextElement();
String value = request.getParameter(name);
Similar Messages
-
Sending parameters to reports by using Run_Report_Object
Hi All,
How do I send parameters to report while using Run_Report_Object built-in ?
Thanks in advance.
Regards,
Sanjay Kanakathhello,
there is a builtin for setting the parameters :
from the forms builder online help :
DECLARE
repid REPORT_OBJECT;
report_prop VARCHAR2(20);
BEGIN
repid := find_report_object('report4');
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_EXECUTION_MODE, BATCH);
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_COMM_MODE, SYNCHRONOUS);
SET_REPORT_OBJECT_PROPERTY(repid, REPORT_DESTYPE, FILE);
END;
you can use
SET_REPORT_OBJECT_PROPERTY(repid,
REPORT_OTHER,
'deptno=10');
to set the Other Parameters property of the report object.
regards,
philipp -
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. -
How to make a link in textflow that send parameters to a function?
How to make a link in textflow that send parameters to a function?
In the examples included with the weekly builds there is a CustomLinkEventHandler.as example. Passing parameters would be done in the CustomClickHandler function. You could attach the parameters to the LinkElement as user styles using the setStyle API.
Hope that helps,
Richard -
URLConnection problems(Sending parameters with URL)
Guys i have some problems with sending parameters through URL using URLConnection class.
That's my code:
URL url = new URL("http://kiosk.homebank.kz:9090/default.asp?action=SaveContact&src=C_HOMEBANK&ClientId="+request.getParameter("ClientId")+
"&IdService="+request.getParameter("IdService")+
"&Contact="+URLEncoder.encode(request.getParameter("Contact"),"utf-8")+
"&Number="+URLEncoder.encode(request.getParameter("Number"),"utf-8")+
"&Work="+URLEncoder.encode(request.getParameter("Work"),"utf-8")+
"&Mobile="+URLEncoder.encode(request.getParameter("Mobile"),"utf-8"));
URLConnection connection = url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(true);I want just send these parameters without going to this link. How can i do it using URLConnection class? Help please!Try using this set method in the URL class (query is the parameters):
protected void set(String protocol,
String host,
int port,
String authority,
String userInfo,
String path,
String query,
String ref) -
Hi, All.
I need transfer a big data module (aprox.10-20 MB) from
client to server. I'm using HTTPService.send(params) to send this.
But I get a problem on 600K and more volume. It take a long time
(40 sec. and more on 500-600K). Its inredable to transfer so little
data for big time!
And at another hand, I can read big data module by
HTTPService (12 MB and more) for 10-15 seconds!
Why it can be, and how to solute this?
Thanks... (sorry for bad english :) )Hi, All.
I need transfer a big data module (aprox.10-20 MB) from
client to server. I'm using HTTPService.send(params) to send this.
But I get a problem on 600K and more volume. It take a long time
(40 sec. and more on 500-600K). Its inredable to transfer so little
data for big time!
And at another hand, I can read big data module by
HTTPService (12 MB and more) for 10-15 seconds!
Why it can be, and how to solute this?
Thanks... (sorry for bad english :) ) -
HTTPService.send doesnt send anny data
Hi all,
I have a serious problem when my application is online, i cant send anny data with HTTPService.send command. but when locally it does.
When i click the button tho send the data it doesnt even try to connect here is my code and i cant find the problem. I hope some one can point me in the right direction
here's my code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
minWidth="700" minHeight="715" width="700" height="715"
xmlns:upload="services.upload.*"
creationComplete="initVars()"
>
protected function btn_publish_clickHandler(event:MouseEvent):void
var idioot:int = 1;
var text_veld:String = new String();
text_veld = tekst_stuk.text
obj.user = idioot;
obj.titel = titel.text;
obj.keywords = zoek_data.text;
obj.text = tekst_stuk.text;
if(voor_geld.text != null)
obj.price_off = voor_geld.text + "." + voor_geld_cent.text;
else if(korting_input.text != null)
obj.price_off = korting_input.text;
if(korting_radio.selected == true)
obj.price = geld.text + "." + geld_cent.text;
obj.price_type = "p";
else if(gratis_radio.selected == true)
obj.price = "0";
obj.price_type = "g";
else if(van_voor_radio.selected == true)
obj.price = geld.text + "." + geld_cent.text;
obj.price_type = "m";
obj.img_1 = img.source;
obj.img_2 = img_2.source;
obj.img_3 = img_3.source;
obj.img_4 = img_4.source;
private function send_data_event(e:Event):void
send_data.send(obj);
send_data.showBusyCursor;
<fx:Declarations>
<mx:HTTPService id="send_data" method="POST" url="http://someURL" resultFormat="text" useProxy="false"/>
</fx:Declarations>
<mx:Image x="525" y="559" source="buttonpubliceren.png" width="150" height="30" id="btn_publish" click="btn_publish_clickHandler(event);" />The function executes when hij press the Image button:
the new code:
<?xml version="1.0" encoding="utf-8"?>
<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo"
minWidth="700" minHeight="715" width="700" height="715"
xmlns:upload="services.upload.*"
creationComplete="initVars()"
>
protected function btn_publish_clickHandler(event:MouseEvent):void
var idioot:int = 1;
var text_veld:String = new String();
text_veld = tekst_stuk.text
obj.user = idioot;
obj.titel = titel.text;
obj.keywords = zoek_data.text;
obj.text = tekst_stuk.text;
if(voor_geld.text != null)
obj.price_off = voor_geld.text + "." + voor_geld_cent.text;
else if(korting_input.text != null)
obj.price_off = korting_input.text;
if(korting_radio.selected == true)
obj.price = geld.text + "." + geld_cent.text;
obj.price_type = "p";
else if(gratis_radio.selected == true)
obj.price = "0";
obj.price_type = "g";
else if(van_voor_radio.selected == true)
obj.price = geld.text + "." + geld_cent.text;
obj.price_type = "m";
obj.img_1 = img.source;
obj.img_2 = img_2.source;
obj.img_3 = img_3.source;
obj.img_4 = img_4.source;
send_data.send(obj);
send_data.showBusyCursor
<fx:Declarations>
<mx:HTTPService id="send_data" method="POST" url="http://someURL" resultFormat="text" useProxy="false"/>
</fx:Declarations>
<mx:Image x="525" y="559" source="buttonpubliceren.png" width="150" height="30" id="btn_publish" click="btn_publish_clickHandler(event);" /> -
Send parameters from java to SSRS 2008 R2
I have java code which has cascading parameters like State and County. If i select State respective county would be displayed in County dropdown. Both will have all option as well. Is there a way to handle it in java? Please let me know
If the report is published in report server then the easiest way is to use URL and display it in an IE browser. We can even send parameters to the URL. Refer
http://msdn.microsoft.com/en-us/library/ms152835.aspx
There is another method that we can access a published report, i.e using
SSRS Web Services.
Otherwise if you are trying to access SSRS report file then you may need to create object or report viewer control(.net framework).
Refer http://msdn.microsoft.com/en-us/library/aa337089.aspx
http://msdn.microsoft.com/en-us/library/ms251671.aspx
Regards, RSingh -
HT1277 somehow I lost all my mail box STMP send parameters and I can't change anything
somehow I lost all my mail box STMP send parameters and I can't change anything in the program to allow me to set my STMP
What happens when you try to change the settiings?
-
Send parameters to Allocation script
Hi experts, I have an "Allocation Script" working well, but now I want to send parameters to "Allocation Script", I looked in this forum and have not found information, I am sending the package setting and the "Allocation Script"
PACKAGE INFO
'DEBUG(ON)
PROMPT(SELECTINPUT,,,"Seleccionar Categoria ",%CATEGORY_DIM%)
TASK(Traslado,USER,%USER%)
TASK(Traslado,APPSET,%APPSET%)
TASK(Traslado,APP,%APP%)
TASK(Traslado,SELECTION,%SELECTIONFILE%)
TASK(Traslado,LOGICFILE,%APPPATH%\..\AdminApp\%APP%\TopDownPremisas.lgx)
TASK(Traslado,RUNMODE,1)
TASK(Traslado,LOGICMODE,1)
ALLOCATE
*RUNALLOCATION
*FACTOR=(1+USING)
*APP WHAT=GASTOSADM; WHERE=<<<; USING=<<<;
*DIM ACCOUNTGASTO WHAT=BAS(706); WHERE=<<<; USING=799Porcentaje
*DIM RPTCURRENCY WHAT=LC; WHERE=<<<; USING=<<<
*DIM DATASRC WHAT=INPUT; WHERE=<<<; USING=<<<
*DIM AGENCIA WHAT=BAS(999); WHERE=<<<; USING=9999
*DIM DEPENDENCIA WHAT=BAS(999); WHERE=<<<; USING=9999
*DIM PLAZA WHAT=9999; WHERE=<<<; USING=9999
*DIM CATEGORY WHAT=%CATEGORY_DIM%; WHERE=ESCENARIO8; USING=ACTUAL
*DIM ENTITY WHAT=BAS(999); WHERE=<<<; USING=1
*DIM TIME WHAT=BAS(2011.TOTAL); WHERE=<<<; USING=2011.JAN
*ENDALLOCATION
I want to is for the category you have choosen is the one that I want to use in the "Allocate Script" but not know how.I followed all the steps, but does not work, I dont know, what I'm doing wrong.
PACKAGE
DEBUG(ON)
PROMPT(TEXT,%CATEGORY_SOURCE%,"Enter SOURCE category",,"ACTUAL,ESCENARIO7")
PROMPT(TEXT,%CATEGORY_TARGET%,"Enter TARGET category",,"ACTUAL,ESCENARIO7")
PROMPT(SELECTINPUT,,,"Seleccionar Categoria",%TIME_DIM%)
TASK(Traslado,FORMULASCRIPT *FUNCTION CAT_SRC=%CATEGORY_SOURCE% *FUNCTION CAT_DESTN=%CATEGORY_TARGET%,)
TASK(Traslado,USER,%USER%)
TASK(Traslado,APPSET,%APPSET%)
TASK(Traslado,APP,%APP%)
TASK(Traslado,SELECTION,%SELECTIONFILE%)
TASK(Traslado,RUNTHELOGIC,FORMULASCRIPT)
TASK(Traslado,LOGICFILE,%APPPATH%\..\AdminApp\%APP%\TopDownPremisas.lgx)
TASK(Traslado,RUNMODE,1)
TASK(Traslado,LOGICMODE,1)
SCRIPTLOGIC
*IGNORE_SECURITY
*XDIM_MEMBERSET CATEGORY=CAT_SRC.INPUT
*XDIM_MEMBERSET CATEGORY=CAT_DESTN.INPUT
*RUNALLOCATION
*FACTOR=1
*APP WHAT=NOMINA; WHERE=<<<; USING=<<<
*DIM ACCOUNTNOM WHAT=[TOPDOWN]="S"; WHERE=<<<; USING=706102Porcentaje
*DIM RPTCURRENCY WHAT=LC; WHERE=<<<; USING=<<<
*DIM DATASRC WHAT=INPUT; WHERE=<<<; USING=<<<
*DIM AGENCIA WHAT=BAS(999); WHERE=<<<; USING=9999
*DIM DEPENDENCIA WHAT=BAS(999); WHERE=<<<; USING=9999
*DIM PLAZA WHAT=9999; WHERE=<<<; USING=9999
*DIM CATEGORY WHAT =CAT_SRC; WHERE =CAT_DESTN; USING = ACTUAL;
*DIM ENTITY WHAT=BAS(999); WHERE=<<<; USING=1
*DIM TIME WHAT=BAS(%TIME_SET%); WHERE=<<<; USING=2011.JAN
*ENDALLOCATION
Please help! -
Sending parameters to Flex executable
Hi,
Is it possible that we can send parameters to Flex executable(s)? By Flex executable I meant, the installed .EXE(for Windows) or .APP(for MacOS), after having them installed through an EXE or DMG created with command prompt.
Thanks.I've seen a discussion with running executable and passing parameters with Runtime.exec from Adobe : http://forums.oracle.com/forums/thread.jspa?threadID=1686479
But will it work for Flex compiled EXE or SWF also, and how can those parameters catch inside (?) -
Probelm in Sending Parameters/Attributes in JSP
I have the following two file and i want to send parameters for index.jsp to middle.jsp and print them. But when i run the files there print "null" value at <%= request.getAttribute("myparameter")%> in midle.jsp.
Index.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hi, I am Zaid from Karachi and My hobby is Cricket</h1>
<h1>Whats Your Name, Hobby and where you belong</h1>
<form method="GET" action="middle.jsp">
<input type="text" name="username" size="25">
<input type="text" name="hobby" size="25"><p></p>
<input type="text" name="city" size="25"><p></p>
<input type="submit" value="Submit">
<input type="reset" value="Reset">
</form>
<%
request.setAttribute("myparameter", "Passion");
%>
</body>
</html>
middle.jsp
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<h1>Hello World---!</h1>
<%= request.getAttribute("myparameter")%>
<%= request.getParameter("username")%>
</body>
</html>Consider the lifecycle.
You request page "index.jsp" It runs index.jsp and produces html. It sets the request attribute "myparameter"
You request page middle.jsp. It runs middle.jsp.
Note that this progression requires two seperate requests - one for "index.jsp" and then another for "middle.jsp", which sends the request parameters from the form from your browser to middle.jsp.
Request attributes only last the life of one request - so when you request "middle.jsp" the request attribute set when running "index.jsp" is not available.
cheers,
evnafets -
HTTPService fail to send parameters
Flash Builder 4.5
Flash Player 10.3
Windows 7 pro 64 bit
problem,
I'm sending an object as http parameters, but it never arrive to the web server.
help welcomed.
more info,
flash builder network monito shows that the http request include the parameters.
wireshark capture shows that there are no parameters in the http request.
source code
<fx:Script>
<![CDATA[
import com.adobe.serialization.json.JSON;
import com.adobe.serializers.json.JSONEncoder;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.HTTPService;
protected function button1_clickHandler(event:MouseEvent):void
var streamParams:Object = new Object;
streamParams.title = "demostration";
streamParams.quality = 1;
vidictionService.contentType="application/json";
vidictionService.send(streamParams);
protected function httpResultHandler(evt:ResultEvent):void
trace("InitView.httpResultHandler()" + evt.result.toString());
navigator.pushView(views.MobileLiveHomeView,{streamParams:evt.result});
protected function httpFaultHandler(evt:FaultEvent):void
trace("InitView.httpFaultHandler()" + evt.toString());
]]>
</fx:Script>
<fx:Declarations>
<s:HTTPService id="vidictionService"
url="http://192.168.2.104:9000/streams/save"
fault="httpFaultHandler(event)"
result="httpResultHandler(event)"
resultFormat="object"
showBusyCursor="true"/>
</fx:Declarations>
<s:Button bottom="10" label="Publish" click="button1_clickHandler(event)" horizontalCenter="0"/>found the solution:
vidictionService.method = "POST";
vidictionService.send(JSON.encode(streamParams)); -
ArrayCollection vs. Array in HTTPService sending
Hi,
I want to send the content of an ArrayCollection as one of the parameters in an HTTPService.
However, Flex concatenates the collection's values into one long string and sends it as the value of a single parameter.
Doing this with arrays work just fine, e.g. in AS3:
service.send( { name=["john", "lucy", "mark"] });
(also works in MXML using parameter binding)
So then I tried first converting the ArrayCollection using .toArray() - this is done in MXML, e.g.:
name="{controller.name.toArray()}"
But, then Flex thinks there is NO value - i.e. data binding to the result of .toArray() doesn't keep track of changes to the underlying ArrayCollection.
Is there any way to databind a single HTTPService parameter to an ArrayCollection like one can do against an Array?
JoubertIt will be easier to show you an example of the ArrayCollection. Run this example with a line break at the trace(); statement, and examine the resulting ArrayCollection's items. Once you see this, I think you'll understand why your code isn't working as you expect.
The ArrayCollection is not simply a way to store or make a single Array bindable. It is a collection of objects which you can bind to. Its methods allow you to add, delete and search for items within it. You can, in fact, store many arrays within it. And those arrays could be using Flex components as object keys. Even if you send this to a WebService, that service will likely not understand it.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="testIt()">
<mx:Script>
<![CDATA[
import mx.controls.ComboBox;
import mx.collections.ArrayCollection;
import flash.utils.Dictionary;
//Create different types of arrays:
public var indexedArray:Array = new Array("john", "lucy", "mark");
public var associativeArray:Array = new Array([
{label:"One", data:"7000"},
public var dictionaryArray:Dictionary = new Dictionary();
//Create objects for a dictionary array:
public var objectOne:Object = new Object();
public var objectTwo:Object = new Object();
public var sprite1:Sprite = new Sprite;
public var comboBox1:ComboBox = new ComboBox;
//Create an ArrayCollection:
private var myAC:ArrayCollection = new ArrayCollection;
//This function populates the ArrayCollection:
private function testIt():void{
//Add values to the objects:
objectOne = "This is a Sprite Object";
objectTwo = "This is a ComboBox Object";
//Add objects to the Dictionary:
dictionaryArray[sprite1] = objectOne;
dictionaryArray[comboBox1] = objectTwo;
//Add all the Arrays to the Collection:
myAC.addItem(indexedArray);
myAC.addItem(associativeArray);
myAC.addItem(dictionaryArray);
trace();
]]>
</mx:Script>
</mx:Application> -
I'm trying to submit some data over the HTTPService object to
a struts2 action class. The method I'm trying to use is as follows:
<mx:HTTPService id="myRequest" url="save.action">
<mx:request xmlns="">
<user.id>{userId.text}</user.id>
<user.username>{username.text}</user.username>
<user.password>{password.text}</user.password>
<user.email>{email.text}</user.email>
</mx:request>
</mx:HTTPService>
Of course it doesn't like the "user.username" convention
which struts2 uses to submit an object. I'm trying to built a
little test flex app as a proof of concept for our existing webapp.
The html for a given input box would look like this <input
type="text" name="user.username" />.
Is there anyway to do this other than changing the
myRequest.url by adding the parameters manually?quote:
Originally posted by:
michael_ramirez44
I think it needs to be something like this:
<user>
<id></id>
<username></username>
</user>
That solution doesn't work.
quote:
Try using script to set it when you actually send the
request:
myRequest.send({
"user.id":userId.text,
"user.username":username.text,
"user.password":password.text,
"user.email":email.text
Tim
That works great thanks. I also found that you can use the {}
in the request method/property.
Maybe you are looking for
-
Customers recievable as of date
Dear Experts, I have created this query for Customers Recievables, the problem that I am having is that it only shows the open invoices even if it was closed after the date in my parameter. my requirements is like the Built-In Customers Recievables A
-
Oracle 11g - Listen for remote connections
Hi all, I recently installed Oracle 11.1.0.7.0 on a Windows Server 2008 standard server 6.0 service pack 2. Everything is working as it should. I can open the database control web page on the local computer. I can connect locally to the database from
-
Hie guys i have a requirement to retrive the details of documents made against vendors..i have been trying to use the following FM's but none of them is giving me my desired result. I need an FM that can give me the same details as transaction FB03.
-
Hi guys, I'm working on a SSAS 2012 Tabular Model and am running into some difficulties with one of my measures. What my setup looks like: Dim Time hierarchy: Year - Season (Quarter) - Month Fact Forecast: Account - Material - Month - Forecast Quanti
-
Object Restriction / User exit in Plant Maintenance Module
Dear experts, Can anyone guide me if i want to put certain restrictions like : 1. other Department will not be able to create Order using other dptt. Maintenance work center, equipment etc. 2. user should not be able to cancel TECO status of order, o