Newbie to Flex Http Services
Hi,
I am trying to Integrate Flex with Hibernate and want to use
Http Service to communicate with the back end. Most of the related
articles I read mention about Flex Data services. But I don't want
to use them.
Is it possible to build an application that integrates with
Hibernate without using Data services?
Thanks in advance
Hi,
Yes you can do that. Create a servlet/JSP page which will
invoke the Hibernate classes and give the URL to the servlet/JSP to
the HTTPService component.
Hope this helps.
Similar Messages
-
Change this to an XML array collection with an HTTP service in flex 3.0
I need to change this to an XML array collection with an HTTP
service in flex 3.0
private var flatData:ArrayCollection = new ArrayCollection([
{ Country:"India", State:"Karnataka", Region:"South-West",
Company:"Horizon", Product:"flexo",
Year:"2000", Quarter:"Q1", Month:"Jan", Sales:-10, Cost:5,
Production: 20 },
{ Country:"India", State:"Tamil Nadu",
Region:"South-East",Company:"Horizon", Product:"flexo",
Year:"2000", Quarter:"Q1", Month:"Mar", Sales:10, Cost:5,
Production: 20 },
{ Country:"India", State:"Kerala", Region:"South-West",
Company:"Horizon", Product:"flexo",
Year:"2000", Quarter:"Q4", Month:"Nov", Sales:10, Cost:5,
Production: 20},
{ Country:"India", State:"Assam", Region:"North-East",
Company:"Horizon", Product:"Trinetra",
Year:"2000", Quarter:"Q1", Month:"Feb", Sales:40, Cost:20,
Production: 20 },
{ Country:"India", State:"Kerala", Region:"South-West",
Company:"Horizon", Product:"Trinetra",
Year:"2000", Quarter:"Q4", Month:"Dec", Sales:55, Cost:27.5,
Production: 20 },
{ Country:"India", State:"Karnataka", Region:"South-West",
Company:"Horizon", Product:"Trinetra",
Year:"2000", Quarter:"Q2", Month:"Apr", Sales:20, Cost:10,
Production: 20 },
// confusion
{ Country:"India", State:"Delhi", Region:"North-East",
Company:"Confusion", Product:"Besto",
Year:"2000", Quarter:"Q1", Month:"Jan", Sales:20, Cost:10,
Production: 20 },
{ Country:"India", State:"Orissa", Region:"South-East",
Company:"Confusion", Product:"Besto",
Year:"2000", Quarter:"Q1", Month:"Feb", Sales:10, Cost:5,
Production: 20 },
{ Country:"India", State:"Gujrat", Region:"North-West",
Company:"Confusion", Product:"Besto",
Year:"2001", Quarter:"Q4", Month:"Oct", Sales:50, Cost:25,
Production: 20 },
{ Country:"India", State:"Delhi", Region:"North-East",
Company:"Confusion", Product:"Besto",
Year:"2001", Quarter:"Q4", Month:"Nov", Sales:60, Cost:30,
Production: 20 },
{ Country:"India", State:"Tamil Nadu",Region:"South-East",
Company:"Confusion", Product:"Besto",
Year:"2001", Quarter:"Q4", Month:"Dec", Sales:70, Cost:35,
Production: 20},
{ Country:"India", State:"Gujrat", Region:"North-West",
Company:"Confusion", Product:"Best",
Year:"2000", Quarter:"Q1", Month:"Mar", Sales:30, Cost:15,
Production: 20 }
can u pls tell meCreate a uriTemplate like this
/auth?uname={uname}&pass={pass}
use GET method only.
generate the personalization keys. -
Populate ComboBox from database - NOT using Flex Data Services
Hi there,
We are using CF with Flex but are not using the Flex Data
Service. I'm very much a newb and I'm having trouble finding any
information on how to populate controles from a database without
using Flex Data Service. Any help would be greatly appreciated.
First I have a page... JobSearch.mxml that contains a combo
box that I want to populate with the job_id and job_title from a
MSSQL database.
In Flex in the RDS DataView I used the "Create CFC" Wizard
which generated "job.cfc" and "jobGateway.cfc". It also generated
"job.as".
The CF Function that selects the data appears to be defaulted
and called "load" and the .as function is called simply "job".
So, that all looks great. But I can't find any information on
what I need to have on my JobSearch.mxml to actually get this data
into the comboBox.
I did:
<mx:Script>
<![CDATA[
[Bindable]
public var jobData:job = null;
]]>
</mx:Script>
And then:
<mx:ComboBox
text="{jobData.job_title}"></mx:ComboBox>
But I'm being told "Type was not found or was not a
complie-time constant: job"
I guess I'm missing something, or doing something way
wrong... I just don't know enough of Flex at this point to know
what it is.
Thanks!
AprilUsing php or asp is not an option, as we are a Cold Fusion
House.
I was looking at an article on Ben Forta's blog (
http://www.forta.com/blog/index.cfm?mode=e&entry=1786)
and following his example I did this... only it doesn't work:
I'm very very new to Flash and we are using ColdFusion but
are not using Flex Data Services. I've been trying to figure out
how to populate a combobox from a database and I'm just not having
any luck.
My project is called "PreTraffic". I have my main file as
"JobSearch.mxml" and a folder under the root named "cfc" with a
file called "job.cfc".
job.cfc contains the following code:
<cfcomponent>
<!--- Get jobs --->
<cffunction name="GetJob" access="remote"
returntype="query" output="false">
<cfset var job="">
<cfset var results="">
<cfquery datasource="discsdev" name="job">
SELECT job_id, job_title
FROM job
WHERE status = 'O'
ORDER BY job_title
</cfquery>
<cfquery dbtype="query" name="results">
SELECT job_title AS label, job_id AS data
FROM job
ORDER BY label
</cfquery>
<cfreturn results>
</cffunction>
</cfcomponent>
And JobSearch.mxml has the following code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="
http://www.adobe.com/2006/mxml"
xmlns="*"
layout="absolute"
backgroundGradientColors="[#ffffff, #d0d0d0]"
creationComplete="InitApp()">
<mx:Style source="style.css" />
<mx:Script>
<![CDATA[
public function InitApp():void {
jobSvc.GetJob();
]]>
</mx:Script>
<!-- ColdFusion CFC (via AMF) -->
<mx:RemoteObject id="jobSvc" destination="PreTraffic"
showBusyCursor="true" />
<mx:VBox label="Job History" width="100%" height="100%"
x="10" y="92">
<mx:Label text="Search jobs by"/>
<mx:Form label="Task" width="100%">
<mx:FormItem label="Job Name:">
<mx:ComboBox id="jobNameCB"
dataProvider="{jobSvc.GetJob.results}"></mx:ComboBox>
</mx:FormItem>
</mx:Form>
<mx:HBox>
<mx:Button label="Search"/>
<mx:Button label="Clear"/>
</mx:HBox>
</mx:VBox>
</mx:Application>
My Compiler thingy points to:
-services
"/Volumes/flexwwwroot/WEB-INF/flex/job-services-config.xml" -locale
en_US
and job-services-config.xml contains the following code:
<destination id="PreTraffic">
<channels>
<channel ref="my-cfamf"/>
</channels>
<properties>
<source>flex.pretraffic.cfc.job</source>
<lowercase-keys>true</lowercase-keys>
</properties>
</destination>
Well, when I run the app... the combobox is not populated...
Can anyone help with what I've done wrong?
Thanks!
April -
How do I debug an http service over a LAN in flex4
Hi I have a problem I would really like some help with.I am hoping to use PHP as a back end for my app. I don't think AMF looks viable as I can't change the php.ini file on the production server or install Zend. As my data requirements are very small I have opted for http service calls .My set up is all my files are on a development machine and I'm editing them through a lan connection on windows vista. I have php Zend server runing on the server with mysql set up.
My problem relates to testing. When I debug the file the calls don't seem to get through. The Network monitor confirms this. Also the spinning Icon stays up. I don't get any exception however.
If I then open up the swf file through the network share then the file works. If I copy it from the share to my hard drive it doesn't. I don't understand whats going on but it's making debugging difficult as I can't use traces this way and exceptions are ugly.
Is there a simple solution to this problem?
Things it can't be : firewall. I can definitely open this address on port 80. Also the network address is right and I assume that if I open the client on my machine then it is connecting from my machine, so when it works the address must be right.The only thing I can think is the cross domain policy but I don't see why that should occur when the files on the same machine or does flex create a local copy for testing?I'm pretty sure you can do this by making a manual menu.
>Insert a menu from your widget menu
>Select the menu options for your widget
>You will see an option that says "Menu Type" with choices of All Pages, Top Level Pages, or Manual
>Select "Manual"
You will have to manually set up your entire menu, but it will enable you to do what you are trying to do. Create the menu buttons that you need and name them. You can then select an individual menu button and the "Hyperlink" option appears in the top menus. You can either direct it to a page on your site or put in a link that directs them away from your site like you are looking to do.
Hope this helps! Nobody is responding to my request, so I figured I would try to respond to someone else while I was waiting! -
Flex Data Services JOTM, JTA and JMX downloads
I am not a Java developer. I am an Information Architect/UI
Designer and up until a few months ago, I designed GUIs using MS
Studio.Net -- Tomcat is a little different IIS, to say the least.
=)
I have downloaded the trial software of Flex Builder 2 and
Flex Data Services to test it with intent to purchase.
I was getting real happy with Flex Builder 2. Breezing
through the "Getting Started" and all the tutorials. Absolutely
Love it.
Then along comes Flex Data Services. This application has
bought me to a screeching halt.
I've downloaded the files according to the instructions at:
http://www.adobe.com/support/documentation/en/flex/2/install.html#flexj2ee.
I placed the files in my webapps directory running on tomcat.
However, according to the instructions at:
http://www.adobe.com/support/documentation/en/flex/2/install.html#tomcat,
I need to download additional applications in order to
correctly use FDS. I have tried to download the JOTM 2.0.10.tgz
from
http://forge.objectweb.org/project/download.php?group_id=19&file_id=3926
without success. When I try to unzip the file (I am running
Windows XP Professional), I get the following error:
"Error reading header after processing 0 entries."
I've tried to download three different versions of JOTM, no
luck. Our Java developer suggested that I save the "tar" file as a
"zip" file and try to open it after download. However, when I try
to open the archive in WinZip it returns this error:
"Cannot open file: it does not appear to be a valid archive.
If you downloaded this file, try downloading the file again."
Both of these errors occur when trying to open the downloaded
JOTM 2.0.10.tgz and JOTM 2.0.8.tgz files.
How can I get these applications? Has anyone had any success
in downloading these files from:
http://forge.objectweb.org/project/showfiles.php?group_id=19&release_id=1024
The downloaded archive files are empty. I can not run any of
the Data Service samples.
When I tried at:
http://localhost:8080/samples/dataservice/flexcab/flexcabDispatcher.mxml
A service error prompt returns: "Unable to access
UserTransaction in Dataservice".
I'm assuming this is because the JOTM (et. al) is not on my
box, because the archive is empty when I try to open it in WinZip.
Also, while I was reading the installation instructions for
Tomcat at:
http://www.adobe.com/support/documentation/en/flex/2/install.html#tomcat
it seems pretty complicated for a non-Java programmer to
understand. I asked one of our 6-year veteran Java developers here
to help me with this and he said it was a pretty a complicated
process for someone w/o Java programming experience. I thought it
was geared towards front-end developers. But he did say that if I
can't download the JOTM, I won't be able to do whatever it is that
Flex Data Services is supposed to do. I say the latter because I am
still in the "Getting Started" manual going through the last of the
tutorials (which is the Flex Data Services distributed application
tutorial) before I start reading "Using Flex", so I'm not really
sure what lessons I will be doing that require FDS to work
correctly on my box.
Do I really need the FDS to build interactive applications in
Flex Builder?
I appreciate your answers. Thanks in advance.I agree with you about the process of getting FDS installed
and working. I recommend that you try Christophe Coenraets FDMS
tutorial. The JOTM files are in "tar" format, and so I think you'll
have to extract them using a "tar" utility. This is included with
any Unix variant, and so I asked someone at work to extract the
files; on Windows I think you'll have to find a free "tar" program.
I downloaded jotm-2.0.10.tar from the JOTM Sourceforge. Use
parameters "-xf" if the tar file is not compressed, or "-zxf" if it
is compressed. Good luck! -
Hi
I have an application which requires interaction with both coldfusion and java.I have taken the configuration files from the blazeDS turnkey project and added it to my application.My application server is coldfusion deployed in a weblogic.I was able to call coldfusion from my flex but whenever i try making java calls i get the following error
[RPC Fault faultString="No destination 'testClass' exists in service flex.messaging.services.RemotingService" faultCode="Server.Processing" faultDetail="null"]
services-config file is as follows
<?xml version="1.0" encoding="UTF-8"?>
<services-config>
<services>
<service-include file-path="remoting-config.xml" />
<!--<service-include file-path="proxy-config.xml" />
<service-include file-path="messaging-config.xml" />-->
</services>
<security>
<login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/>
<!-- Uncomment the correct app server
<login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
<login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/>
<login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/>
-->
<!--
<security-constraint id="basic-read-access">
<auth-method>Basic</auth-method>
<roles>
<role>guests</role>
<role>accountants</role>
<role>employees</role>
<role>managers</role>
</roles>
</security-constraint>
-->
</security>
<channels>
<!-- CF Based Endpoints -->
<channel-definition id="my-cfamf" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://localhost:7002/flex2gateway/" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
<serialization>
<instantiate-types>false</instantiate-types>
</serialization>
</properties>
</channel-definition>
<channel-definition id="cf-polling-amf" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/cfamfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>true</polling-enabled>
<polling-interval-seconds>8</polling-interval-seconds>
<serialization>
<instantiate-types>false</instantiate-types>
</serialization>
</properties>
</channel-definition>
<channel-definition id="my-cfamf-secure" class="mx.messaging.channels.SecureAMFChannel">
<endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/cfamfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
<properties>
<polling-enabled>false</polling-enabled>
<serialization>
<instantiate-types>false</instantiate-types>
</serialization>
</properties>
</channel-definition>
<!-- Java Based Endpoints -->
<channel-definition id="java-amf" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://localhost:7002/flex2gateway/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
</channel-definition>
<channel-definition id="java-secure-amf" class="mx.messaging.channels.SecureAMFChannel">
<endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/>
</channel-definition>
<channel-definition id="java-polling-amf" class="mx.messaging.channels.AMFChannel">
<endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
<polling-enabled>true</polling-enabled>
<polling-interval-seconds>8</polling-interval-seconds>
</properties>
</channel-definition>
<!--
<channel-definition id="java-http" class="mx.messaging.channels.HTTPChannel">
<endpoint uri="http://{server.name}:{server.port}{context.root}/flex2gateway/http" class="flex.messaging.endpoints.HTTPEndpoint"/>
</channel-definition>
<channel-definition id="java-secure-http" class="mx.messaging.channels.SecureHTTPChannel">
<endpoint uri="https://{server.name}:{server.port}{context.root}/flex2gateway/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/>
</channel-definition>
-->
</channels>
<logging>
<target class="flex.messaging.log.ConsoleTarget" level="Error">
<properties>
<prefix>[BlazeDS] </prefix>
<includeDate>false</includeDate>
<includeTime>false</includeTime>
<includeLevel>false</includeLevel>
<includeCategory>false</includeCategory>
</properties>
<filters>
<pattern>Endpoint.*</pattern>
<pattern>Service.*</pattern>
<pattern>Configuration</pattern>
<pattern>Message.*</pattern>
</filters>
</target>
</logging>
<system>
<!-- <manageable>false</manageable>-->
<!--
<redeploy>
<enabled>true</enabled>
<watch-interval>20</watch-interval>
<watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file>
<watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file>
<watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file>
<watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file>
<watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file>
<touch-file>{context.root}/WEB-INF/web.xml</touch-file>
</redeploy>
-->
</system>
</services-config>
remote-config.xml
<?xml version="1.0" encoding="UTF-8"?>
<service id="remoting-service"
class="flex.messaging.services.RemotingService"
messageTypes="flex.messaging.messages.RemotingMessage">
<adapters>
<adapter-definition id="cf-object" class="coldfusion.flash.messaging.ColdFusionAdapter" default="true"/>
<adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter"/>
</adapters>
<default-channels>
<channel ref="my-cfamf"/>
</default-channels>
<destination id="ColdFusion">
<channels>
<channel ref="my-cfamf"/>
</channels>
<properties>
<source>*</source>
<!-- define the resolution rules and access level of the cfc being invoked -->
<access>
<!-- Use the ColdFusion mappings to find CFCs, by default only CFC files under your webroot can be found. -->
<use-mappings>false</use-mappings>
<!-- allow "public and remote" or just "remote" methods to be invoked -->
<method-access-level>remote</method-access-level>
</access>
<property-case>
<!-- cfc property names -->
<force-cfc-lowercase>false</force-cfc-lowercase>
<!-- Query column names -->
<force-query-lowercase>false</force-query-lowercase>
<!-- struct keys -->
<force-struct-lowercase>false</force-struct-lowercase>
</property-case>
</properties>
</destination>
<destination id="testClass">
<properties>
<source>TestClass</source>
</properties>
<adapter ref="java-object" />
<channels>
<channel ref="java-amf"/>
</channels>
</destination>
<destination id="testClass2">
<properties>
<source>TestClass2</source>
</properties>
<adapter ref="java-object"/>
<channels>
<channel ref="java-amf"/>
</channels>
</destination>
</service>
Can anyone please tell me where i m going wrong.Is that because i m using flex2gateway for java calls?.I used it since it was how it has been configured in the turnkey project for coldfusion.I have replicated the file as it was there and since it is using flex2gateway even for javaEndpoints i felt we could use the same.
regards
SiddThanks for the reply. Yes, I did compile all the Java and it
works OK with a simple Java program. It just will not work in a
Flex application.
The java classes are:
RRA:
package blah.myPackage;
import java.util.List;
import java.util.Collection;
import flex.data.DataSyncException;
import flex.data.assemblers.AbstractAssembler;
class RRA extends AbstractAssembler
public Collection fill( List fillParameters )
RRS service = new RRS();
return service.getSome();
RRS:
package blah.myPackage;
import java.util.ArrayList;
import java.util.List;
import java.sql.*;
import flex.EORS.*;
class RRS
public List getSome()
ArrayList list = new ArrayList();
String str = "bob";
RR rr = new RR(str);
list.add(rr);
return list;
RR:
package blah.myPackage;
class RR
private String name;
public RR() { }
public RR(String name)
this.name = name;
public String getName()
return this.name;
public void setName(String name)
this.name = name;
I started with something that retrieved data from a database
but watered it down just to try and get some kind of communication
between Flex and Java. -
How to receive XML from Flex HTTP POST
Hi,
We curreontly have a setup where we have a FLEX frontend send an XML through a HTTP POST and awaiting a response also in XML. On the backend this is handled relatively simply by a PHP script that basically does the following:
read data (in XML)from FlEX HTTP POST into a new temp XML file.
execute a c++ program with the XML file as one of the parameter.
return the result to FLEX
We have decided to move to BlazeDS for various reasons.
Looking at the examples bundled with BlazeDS they have a jsp example that returns an XML result to FLEX so that part is fine. I am trying to find an example of JSP (or Servlet) that is able to read the XML data from FLEX and write it into a temp XML file. I would then try to use runtime.exec to invoke a local C++ program to process the XML file the result of which will be sent back to FLEX.
Any help will be very much appreciated!<div class=Section1><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>I’d avoid calling an executable just to process XML –your<br />application server would provide enough support for reading and writing XML, no?<br />Also, if you’re only planning on working with XML then even BlazeDS might<br />be overkill because its focus is on sending strongly typed ActionScript data efficiently<br />to and from a client (it’s true that it does have a proxy service, but<br />that is not involved with processing the actual XML data).<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>How complex is your XML? Do you need to resolve ids and<br />references or can you parse it top down in a single pass? There are several<br />well known libraries in Java for dealing with XML – the choice depends on<br />how you need to interact with the XML. Most of them take an InputStream as a<br />source for reading XML and you can get the InputStream from the servlet<br />request. Googling should turn up numerous examples.<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'>Pete<o:p></o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";<br />color:#1F497D'><o:p> </o:p></span></p><br /><br /><div style='border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt'><br /><br /><div><br /><br /><div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'><br /><br /><p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span<br />style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> khwong<br />[mailto:[email protected]] <br><br /><b>Sent:</b> Sunday, September 28, 2008 12:09 PM<br><br /><b>To:</b> [email protected]<br><br /><b>Subject:</b> How to receive XML from Flex HTTP POST<o:p></o:p></span></p><br /><br /></div><br /><br /></div><br /><br /><p class=MsoNormal><o:p> </o:p></p><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>A new discussion was started by<br />khwong in <br><br /><br><br /><b>General Discussion</b> --<br><br /> How to receive XML from Flex HTTP POST<br><br /><br><br />Hi, <br><br /><br><br />We curreontly have a setup where we have a FLEX frontend send an XML through a<br />HTTP POST and awaiting a response also in XML. On the backend this is handled<br />relatively simply by a PHP script that basically does the following: <br><br /><br><br />read data (in XML)from FlEX HTTP POST into a new temp XML file. <br><br />execute a c++ program with the XML file as one of the parameter. <br><br />return the result to FLEX <br><br /><br><br />We have decided to move to BlazeDS for various reasons. <br><br /><br><br />Looking at the examples bundled with BlazeDS they have a jsp example that<br />returns an XML result to FLEX so that part is fine. I am trying to find an<br />example of JSP (or Servlet) that is able to read the XML data from FLEX and<br />write it into a temp XML file. I would then try to use runtime.exec to invoke a<br />local C++ program to process the XML file the result of which will be sent back<br />to FLEX. <br><br /><br><br />Any help will be very much appreciated! <o:p></o:p></p><br /><br /><div class=MsoNormal><br /><br /><hr size=2 width=200 style='width:150.0pt' align=left><br /><br /></div><br /><br /><p class=MsoNormal style='margin-bottom:12.0pt'>View/reply at <a<br />href="http://www.adobeforums.com/webx?13@@.59b69b23">How to receive XML from<br />Flex HTTP POST</a><br><br />Replies by email are OK.<br><br />Use the <a<br />href="http://www.adobeforums.com/webx?280@@.59b69b23!folder=.3c061a83">unsubscribe</a>< br />form to cancel your email subscription.<o:p></o:p></p><br /><br /></div><br /><br /></div>
-
Mapping Objects in Flex Data Services
Hi My Dear Friends
This is yogans, i am working in flex for the last 15 days
and i learned the basic things like syntax, tags, scripts. and i am
doing
some data services work now. especially with the help of
Java Remote objects. I dont know http services and
webservices(WSDL).
My doubt here is, I created a user defined object in java
and i want to send this object through Remote call from flex. how
can i
type cast the java object to flex. And i want to add these
objects to the dataprovider of a datagrid. Please help me in
acheiving
this. i will be very thank ful to you in my life. I know
that i have to create same kind of object in flex. But i dont have
concrete idea
please explain me with very simple example step by step . I
am awaiting in hope that God will send some one to help me.
Thanks and Regards
Yogans.sHi,
If you want to map your actionscript class to your server's
Java class. You can run a util function
registerClassAlias("dev.echoservice.Book",Book);
where "dev.echoservice.Book" is the fully qualify name of
your java class. Book is your actionscript class.
Calling this util before you make your remoteobject call. You
can put this in your actionscript class constructor, it makes this
call whenever you create your class. However, it seems to be better
to call it when the class is loaded. To do so you can declare it as
static
public static var a:* =
registerClassAlias("dev.echoservice.Book",Book);
OR
You can also declare it as metaData in your class as:
[RemoteClass(alias="dev.echoservice.Book")]
However, I found someone saying that it didn't work in sdk
compilation, but webtier compilation. It might be some
configuration issue. I haven't tried it yet.
To display the properties in the dataGrid, you just have to
either use Array or ArrayCollection. If databinding is involved,
the datagrid need to know the Collection.Change event. It is better
to use ArrayCollection, therefore, adding new item to
arrayCollection the datagrid get repopulate.
hope it helps!
William Chan -
Using HTTP Services with SSL using Internet Explorer
Hello,
Basically what's happening is that the secure services aren't
loading when I pull up the website when using Internet Explorer.
The website works perfect in FireFox and Safari however nothing
loads via the HTTP services when they use SSL. I've read over Lin
Lin's article
http://weblogs.macromedia.com/lin/archives/flex/security/index.cfm
about using SSL with IE however I'm confused as how to implement
the changes she mentions. She basically mentions a couple of the
reasons why the httpServices wouldn't be able to load data in when
connecting via SSL. I've read over the Adobe TechNote at
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=fdc7b5c&pss=rss_flashplayer_fdc7b5 c
but this wasn't clear either.
1. How do I change the server settings to have the correct
header information?
2. Can I change something in the Flex Compiler to allow for
SSL and IE?
This works perfect in FireFox and Safari and retrieves data
with no problems. Any ideas, information would be appreciated.Hello,
Basically what's happening is that the secure services aren't
loading when I pull up the website when using Internet Explorer.
The website works perfect in FireFox and Safari however nothing
loads via the HTTP services when they use SSL. I've read over Lin
Lin's article
http://weblogs.macromedia.com/lin/archives/flex/security/index.cfm
about using SSL with IE however I'm confused as how to implement
the changes she mentions. She basically mentions a couple of the
reasons why the httpServices wouldn't be able to load data in when
connecting via SSL. I've read over the Adobe TechNote at
http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=fdc7b5c&pss=rss_flashplayer_fdc7b5 c
but this wasn't clear either.
1. How do I change the server settings to have the correct
header information?
2. Can I change something in the Flex Compiler to allow for
SSL and IE?
This works perfect in FireFox and Safari and retrieves data
with no problems. Any ideas, information would be appreciated. -
How to handle HTTPS Service that returns XML
When using Flash + AMF remoting I've always typecast the event.result as XML(event.result). Typecasting isn't working in Flash Builder, I'm getting an object as the result [object MYXMLROOT] and I can access it's properties, but I can't typecast it as XML, nor can I loop each of it's properties....
Hi,
There are ways to use XML returned by Http Service in flex. Is this what you are looking to achieve?
http://blog.flexexamples.com/2008/03/29/dynamically-loading-xml-files-using-the-httpservic e-tag/
The DCD features of Flash Builder 4 can also be used to access the XML as Services.
Nishad -
Flex Data Services tutorial error
In the "Before You Begin" section of the Flex Data Services
tutorial in "Getting Started with Flex", the first bullet is
incorrect. It text should be:
"Ensure that you have installed the Flex Data Services Beta 3
release and that you can run the applications in the samples web
application."
The installation instructions are located here:
http://www.adobe.com/go/flex2_installation
The tutorial zip file is located here:
http://www.macromedia.com/go/flex2beta1_quickstart_tutorial_zip
- Mike Peterson
Adobe Flex documentation teamHi, I found some more "issues" with these data services
tutorial.
First of working with the notes example at first I couldn't
get the two browsers to talk to eachother until I found this
comment by funk_sf on the livedocs:
quote:
after some searching, I located a link to the tutorial.zip
here:
http://www.macromedia.com/go/flex2beta1_quickstart_tutorial_zip.
i unzip'd the contents into my samples directory so that I had the
following path: C:\fds2\jrun4\servers\default\samples\tutorials
the xml file in WEB-INF for the standalone flexbuilder 2b3 is
located at C:\fds2\resources\config as mentioned in the comments on
the previous page (
http://livedocs.macromedia.com/labs/1/flex20beta3/00000129.html)
as for creating the tutorial1.mxml file, i created a new Flex
project with the following settings (this is from memory, so
hopefully i recall all the steps right):
File->New Flex Project
How will you flex application access data? -> Flex Data
Services -> Compile application locally in Flex Builder
root folder: C:\fds2\jrun4\servers\default\samples
root url:
http://localhost:8700/samples/
I left the build paths to their defaults (ie. blank)
named the main application file: tutorial1.mxml
output folder: tutorial
output folder url: [blank]
So I followed his advice, deleted my project and made it in
the samples directory and the notes application started to work, so
all appeared good.
Until I was making the Java example and I'm now faced with
the following errors:
Severity Description Resource In Folder Location Creation
Time Id
2 Definition samples.contact:Contact could not be found.
tutorial2.mxml Tutorials line 8 6 juni 2006 16:36:25 20
Severity Description Resource In Folder Location Creation
Time Id
2 Type was not found or was not a compile-time constant:
Contact. tutorial2.mxml Tutorials line 13 6 juni 2006 16:36:25 21
I'm not sure what is happening, I think it can't find the
data service files but I don't know how to make it so that it does
find those files, the manual is still a bit vague on that and when
I try to run this application it just shows a blue (flex) screen.
The code I'm using is straight from the example documentation after
tinkering around for 2 days to get this to work I thought using
original code is the best way to go.
My application tries to run from
http://localhost:8700/samples/bin/tutorial2.html
The documentation states:
Open the following URL in two browser windows:
[L=http://localhost:port/samples/tutorials/tutorial2.mxml
The screenshots in the documentation show:
Window1: /tutorial/tutorial1.mxml
Window2: /dataservice/contact/tutorial_step4.mxml
Now I'm just confused, tutorial1.mxml is my notes application
which was the previous tutorial and there was no mention of a
tutorial_step4.mxml file ?
Someone help me please with where to place these files and
why so I can understand what is happening here.
Thanks :) -
Http Service in FlashBuilder 4
I have been attempting to connect a Flex4 List to an HTTP service with no luck whatsoever. Are there any tutorials for this? Is this even working? Flex Builder 4 did a fantastic job of auto-discovering my XML data and presenting me type options for the data, but a truly horrible job of letting me know what it was doing with that information.
This seems to be partly a problem of excessive MXML dependency. After 10 hours of chasing rabbit trails, I still have not been able to stick a debugger on anything that would help me to understand what is going wrong. Looks like it's back to HTTPService and E4X :SI finally figured out what was wrong... the automically generated dataProvider was set to the parent object of the object that it should have been. So, after that and ditching the spark BitmapImage for the Halo Image (b.c. of its auto URL capabilities) I was in business. I definitely still vote for greater developer visibility into the whole magical world of data services.
-
When I configure an http service, I create an operation updateItem, assign it a method of POST, Content-Type application/xml, and then specify a URL: http://localhost:3000/sites/1/students/3. Now when I go to test the operation, this is what I get:
InvocationTargetException:There was an error while invoking the operation. Check your operation inputs and try invoking the operation again.
Response Received:
Length Required
WEBrick::HTTPStatus::LengthRequired
Yet, in my application there is no such error when doing an update. However, when I try to accomplish it using Flash Builder, I get the above error. Am I doing something wrong in the Configure HTTP Service window? Thanks for any suggestions.I completely abandoned the CallResponder route. It just took too much time to figure out and there's practically no in-depth resources out there for setting it up with HTTP Service (although you will find resources for ColdFusion and PHP). So I tried HTTP Service rather than CallResponder in the code:
<mx:HTTPService id="user_requestsUpdate" url="{CONTEXT_URL}/user_requests/{user_requestsGrid.selectedItem.id}/confirm_request"
method="POST"
resultFormat = "e4x"
contentType="application/xml"
headers="{{X_HTTP_METHOD_OVERRIDE: 'PUT'}}" />
This produces this:
[RPC Fault faultString="Error #1090: XML parser failure: element is malformed." faultCode="Client.CouldNotDecode" faultDetail="null"]
It's shocking to me how difficult it is just to make a simple update using flex. -
"Security error accessing url" - Accessing HTTP service running on another machine
Flex app is hosted as web service and is trying t access data
from HTTP Service
running on different machine. It throws following error
[RPC Fault faultString="Security error accessing url"
faultCode="Channel.Security.Error" faultDetail="Destination:
DefaultHTTP"]
at
mx.rpc::AbstractInvoker/
http://www.adobe.com/2006/flex/mx/internal::faultHandler
at mx.rpc::Responder/fault()
at mx.rpc::AsyncRequest/fault()
at ::DirectHTTPMessageResponder/securityErrorHandler()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio
n()
at flash.events::EventDispatcher/dispatchEvent()
But when I run the HTTP Services (data provider) on same
machine application
works fine.
Already used crossdomain.xmlSorted the cross domain problem by using mx:Webservice rather
than an httpservice. -
is there any difference between Http service and data services?
Hi
Data service is probably a server pushed communication like messaging.. It carries lots of changes as an object or arraycollection and as ubuntu said something like asyn service calls..
and http service is like traditional http service .. we can use http services to load remote resources also in flex application..
Maybe you are looking for
-
i think this is a command line question. i recently unplugged my B&W G3 so i could use the space to play with my new (to me) G4. i also "borrowed" some RAM from the G3 to install in the new machine. when i tried to hook up the G3 again, it would not
-
How do I email Apple about a problem?
I am having a hard time figuring out where or how to email Apple about a problem that I am having. Could someone please help me?
-
Hi, i want to install Forms and Reports Server on SuSE Linux 6.4, but i get always an error message: 'rdbms' Software is not available in the current distribution source and has not installed. You must obtain and .... Must I install it in the same Ho
-
I have a Macbook Pro 17" and i can't seem to make it past the grey screen with the waiting spiral. I have EXTREMELY important information on the hard drive. I need to get this information off of the hard drive. I have tried using a firewire attaching
-
Inserting,updating n deleting through API
Hello everybody, My client has a requirement to build a OAF page which does the GL coding(splitting the invoice lines). But they want the insertions, updations & deletions to be done by the standard API(AP_INVOICE_DISTRIBUTION_PKG). I know it would v