How can I send XML to a servlet without a WebService?

I have created some XML on my Flex app now I want to send it
back to the Servlet, any suggestions on how to do this?
I don't have a web service setup, so I just need to do this
without a webservice.
I appreciate an help!!!!

Hi,
You can use HTTPService or RemoteObject.
If you are using HTTPService, then it is very similar to Form
post from a HTML page. HTTPService will allow you to select the
method (POST/GET) in which you want to send the data to the server.
You can add parameters with the data and the send the request to
the server. On the server side, you can either use JSP/Servlet/ASP
or any other server side scripting technology and access the
parameters using request.getParameter("<parameter name>").
Please find more details on how to pass parameters at the URL
below.
http://livedocs.adobe.com/flex/3/html/data_access_5.html#200238
If you are using RemoteObject, then you need to have
BlazeDS/LCDS on the server which will allow you to invoke methods
in any Java class. When invoking any method you can pass arguments
as you were invoking that method from another Java class. Please
find more details on how to use RemoteObject at the URL below.
http://sujitreddyg.wordpress.com/2008/01/14/invoking-java-methods-from-adobe-flex/
Hope this helps.

Similar Messages

  • How can i send xml file with a http servlet request

    Hi
    Please tell me how can I send a xml file into http servlet request.
    I have a servlet(action) java file.From this servlet I have generate a xml file. Now I need to send that xml file to another servlet with http servlet request object.
    Dave.

    When you say you have generated an XML file what do you mean?
    Is it a file stored on disk? Then pass the file path as a string to the servlet.
    Is it stored in memory as an object? The pass a reference to the object to the servlet.
    Or are you asking how to communicate between servlets?
    Look in the JavaDocs for the RequestDispatcher class. You can use this class to forward the request to another servlet. Data can be passes using the RequestDispatcher by storing it as attributes using the request getAttribute and setAttribute methods. Also described in the JavaDOcs.
    http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/RequestDispatcher.html

  • How can i send parameter to the servlet

    i want send one or more parameter to the servlet
    acturally i am using applet servlet cmmunication
    useing XML and I want to send one parameter to
    the server and depending on tha perform some
    action but i dont know how to send the parmer to
    servlet plz give the answere
    Rahul

    Hi Rahul,
    You will have to use java.net package for tht.. Through applet you will have to make URL connection to your servlet.whc u will make by using java.net.URl
    Just explore this pakage. You will find alots of utility thr.
    HTH?
    ~Gaurav

  • How can I send a photo through messaging without using photo stream?

    Ever since I updated my phone I can't send a pic without photo streaming and not everyone has an iPhone so I can't send pics to everyone I want to/

    Well, if you have iOS 6 on your iPhone 4, and click on a photo in your photo library, then click the "share" button in the lower left, you see these options:
    Mail
    Message
    Photo Stream (OK, you don't want that one)
    Twitter
    Facebook
    [4 other options not directly related to electronic sharing]
    So I would say you have a plethora of options.

  • How can I send a PDF via mail without it becoming an attached file?

    Hi All!
    I need to know how I am able to send a PDF file via mail, without it becoming an attached file. This means when the receiver opens the mail, he automatically sees the PDF without first having to read the normal mail text and scroll down to open the attached PDF file. Just like a spam newsletter
    Also I want to know - I want some illustrations in my portfolio to be a hyperlink to a website, is this possible on a picture (not on an URL) - and if so - How?
    Hope you can help me out here!
    ** I use Adobe Acrobat Reader Pro X 10.1.10 on a Macbook Pro 10.8.5**
    Thanks,
    Carlinsky

    Carlinsky wrote:
    Hi All!
    I need to know how I am able to send a PDF file via mail, without it becoming an attached file. This means when the receiver opens the mail, he automatically sees the PDF without first having to read the normal mail text and scroll down to open the attached PDF file. Just like a spam newsletter
    Not possible with Adobe Reader or Adobe Acrobat.

  • How can i send my SWF for others (without Flash) to open?

    I have just finished making my interactive portfolio in Flash and after opening it in the SWF file it works perfectly. I now want to be able to E-Mail it to potential employers to see, but if they don't have Flash then they won't be able to open it with an SWF file. I tried setting the default program to open it with as Internet Explorer but have had all sorts of problems. Is there any easy way to be able to send them the file, and have them open it without having to sift through loads of unblock buttons or have the videos not play (two recent problem).
    Any help would be appreciated, many thanks
    Flasher87

    Your best bet is to place the swf on a web page on a server and simply send links to the web page.  Having an online portfolio is often a must have for certain professions, such as web design and similar trades.
    Emailing an swf file may hit a security wall on some servers.  A potential employer may not appreciate the extra work they might have to follow thru with to deal with a file you send them if they do not have the software for viewing it on hand.
    If you do email the swf file to anyone, then they need the Flash Player to be able to play the file.  So you should probably include a link for them to the Adobe site where they can download a player that supports your file.

  • How can I send a .pdf in iChat without it turning into a .zip file? I just upgraded to Lion and am now having this issue.. Please help.

    Any solutions would be helpful. I have tried looking in preferences, but to no avail.

    Hi,
    It is no good smiling sweetly as I have children and it odes not work
    To explain further.
    I answer the alerts first, that I get for "New Posts" in threads I have contributed to.
    Then I read my other email.
    Then I come back to the boards to read the oldest Unread thread first.
    Not linking to the Thread to highlight there is one whilst emailing me is a bit like queue jumping.
    As you can see I do read everything eventually during each evening I spend here.
    I will keep to the email and only post here if I find the answer.  The answer should be shared.
    Speak soon.
    10:35 PM      Wednesday; January 25, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • How can I send request to the server through XML using JSP

    How can I send XML request to the server using JSP and servlets

    Ajax may be the one way.

  • How can I send an XML request to the server using servlets

    How can I send an XML request to the server using servlets

    http://forum.java.sun.com/thread.jspa?threadID=5158333
    http://forum.java.sun.com/thread.jspa?threadID=5158705
    Crossposting is lame.

  • How can i produce xml like this ?

    <mms>
    <subject>message subject</subject>
    <url_image>http://image_url</url_image>
    <url_sound>http://sound_url</url_sound>
    <url_video>http://video_url</url_video>
    <text>message text</text>
    <msisdn_sender>6281XYYYYYY</msisdn_sender>
    <msisdn_receipient>6281XYYYYYY</msisdn_receipient>
    <sid>to be define later</sid>
    <trx_id>Unique number</trx_id>
    <trx_date>yyyyMMddHHmmss</trx_date>
    <contentid>see note</contentid>
    </mms>
    How can i produce that xml?
    Can i produce it with this?
    public Element getXML(Document document) {
            // create sentContent Element
            Element sentContent = document.createElement( "mms" );
            // create subject Element
            Element temp = document.createElement( "subject" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getJudulFilm() ) ) );
            sentContent.appendChild( temp );
            // create url_image Element
            temp = document.createElement( "url_image" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create url_sound Element
            temp = document.createElement( "url_sound" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create url_video Element
            temp = document.createElement( "url_video" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getUrl_video() ) ) );
            sentContent.appendChild( temp );
            // create text Element
            temp = document.createElement( "text" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create msisdn_sender Element
            temp = document.createElement( "msisdn_sender" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getMsisdn() ) ) );
            sentContent.appendChild( temp );
            // create msisdn_recipient Element
            temp = document.createElement( "msisdn_recipient" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getMsisdn() ) ) );
            sentContent.appendChild( temp );
            // create sid Element
            temp = document.createElement( "sid" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getSid() ) ) );
            sentContent.appendChild( temp );
            // create trx_id Element
            temp = document.createElement( "trx_id" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getTrx_id() ) ) );
            sentContent.appendChild( temp );
            // create trx_date Element
            temp = document.createElement( "trx_date" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getTrx_date() ) ) );
            sentContent.appendChild( temp );
            // create contentid Element
            temp = document.createElement( "contentid" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getContentid() ) ) );
            sentContent.appendChild( temp );
            return sentContent;
        }& how can i send it to the server using HTTP request post method?

    <mms>
    <subject>message subject</subject>
    <url_image>http://image_url</url_image>
    <url_sound>http://sound_url</url_sound>
    <url_video>http://video_url</url_video>
    <text>message text</text>
    <msisdn_sender>6281XYYYYYY</msisdn_sender>
    <msisdn_receipient>6281XYYYYYY</msisdn_receipient>
    <sid>to be define later</sid>
    <trx_id>Unique number</trx_id>
    <trx_date>yyyyMMddHHmmss</trx_date>
    <contentid>see note</contentid>
    </mms>
    How can i produce that xml?
    Can i produce it with this?
    public Element getXML(Document document) {
            // create sentContent Element
            Element sentContent = document.createElement( "mms" );
            // create subject Element
            Element temp = document.createElement( "subject" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getJudulFilm() ) ) );
            sentContent.appendChild( temp );
            // create url_image Element
            temp = document.createElement( "url_image" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create url_sound Element
            temp = document.createElement( "url_sound" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create url_video Element
            temp = document.createElement( "url_video" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getUrl_video() ) ) );
            sentContent.appendChild( temp );
            // create text Element
            temp = document.createElement( "text" );
            temp.appendChild( document.createTextNode("") );
            sentContent.appendChild( temp );
            // create msisdn_sender Element
            temp = document.createElement( "msisdn_sender" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getMsisdn() ) ) );
            sentContent.appendChild( temp );
            // create msisdn_recipient Element
            temp = document.createElement( "msisdn_recipient" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getMsisdn() ) ) );
            sentContent.appendChild( temp );
            // create sid Element
            temp = document.createElement( "sid" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getSid() ) ) );
            sentContent.appendChild( temp );
            // create trx_id Element
            temp = document.createElement( "trx_id" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getTrx_id() ) ) );
            sentContent.appendChild( temp );
            // create trx_date Element
            temp = document.createElement( "trx_date" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getTrx_date() ) ) );
            sentContent.appendChild( temp );
            // create contentid Element
            temp = document.createElement( "contentid" );
            temp.appendChild( document.createTextNode(
            String.valueOf( getContentid() ) ) );
            sentContent.appendChild( temp );
            return sentContent;
        }& how can i send it to the server using HTTP request post method?

  • How can i generate xml like this?

    Hi all,
    How can i generate xml like this & i need to send it to via HTTP :
    <mms>
                 <subject>message subject</subject>
                 <url_image>http://image_url</url_image>
                 <url_sound>http://sound_url</url_sound>
                 <url_video>http://video_url</url_video>
                 <text>message text</text>
                 <msisdn_sender>6281XYYYYYY</msisdn_sender>
                 <msisdn_receipient>6281XYYYYYY</msisdn_receipient>
                 <sid>to be define later</sid>
                 <trx_id>Unique number</trx_id>
                 <trx_date>yyyyMMddHHmmss</trx_date>
                 <contentid>see note</contentid>
    </mms>& how can i get the value of the sid (for example)?
    I hav tried to generate that xml by using StringBuffer & append, but it's not what i mean...
    Anyone can help me?

    Ok...i got it. But i still hav some problems.
    This is the sample code that i used :
    public class XMLCreator {
         //No generics
         List myData;
         Document dom;
            Element rootEle, mmsEle, mmsE;
            StringWriter stringOut;
            mms mms;
         public XMLCreator(String subject, String image, String sound,
                    String video, String text, String sender, String recipient,
                    int id, String date, String contentid) {
              mms = new mms(subject, image, sound, video, text, sender,
                            recipient, id, contentid, date);
                    createDocument();
         public void run(){
              createDOMTree();
              print();
         private void createDocument() {
              //get an instance of factory
              DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
              try {
              //get an instance of builder
              DocumentBuilder db = dbf.newDocumentBuilder();
              //create an instance of DOM
              dom = db.newDocument();
              }catch(ParserConfigurationException pce) {
                   //dump it
                   System.out.println("Error while trying to instantiate DocumentBuilder " + pce);
         private void createDOMTree(){
              //create the root element <Mms>
              rootEle = dom.createElement("mms");
              dom.appendChild(rootEle);
              createMmsElement(mms);
         private Element createMmsElement(mms b){
              Element subjectEle = dom.createElement("subject");
              Text subjectText = dom.createTextNode(b.getSubject());
              subjectEle.appendChild(subjectText);
              rootEle.appendChild(subjectEle);
              //create url_image element and author text node and attach it to mmsElement
              Element imageEle = dom.createElement("url_image");
              Text imageText = dom.createTextNode(b.getUrl_image());
              imageEle.appendChild(imageText);
              rootEle.appendChild(imageEle);
              // & etc....
              return rootEle;
          * This method uses Xerces specific classes
          * prints the XML document to file.
         private void print(){
              try
                   //print
                   OutputFormat format = new OutputFormat(dom);
                   format.setIndenting(true);
                            stringOut = new StringWriter();
                   //to generate output to console use this serializer
                   XMLSerializer serializer = new XMLSerializer(stringOut, format);
                   //to generate a file output use fileoutputstream instead of system.out
                   //XMLSerializer serializer = new XMLSerializer(
                   //new FileOutputStream(new File("mms.xml")), format);
                   serializer.serialize(dom);
              } catch(IOException ie) {
                  ie.printStackTrace();
            public String getStringOut() {
                return stringOut.toString();
    }when i tried to show the stringOut.toString() in my jsp, it's only showed string like this :
    The Lords Of The Ring http://localhost:8084/movie/lotr.3gp 6281321488448 6281321488448 123 0 20070220114851 LOTR.
    1. Why this is happen?i want to generate xml which its format is like above.
    2. How can i send this xml (put in msg parameter) using jsp (via web) without creating the mms.xml?
    3. if i want to set the msg parameter equal to mms.xml - means that msg = mms.xml, what is the data type for msg? is it an object or anything else?
    Thx b4 in advance...

  • How can we send a collection object to server?

    Hi All
    I am beginner in Flex. I have an assignment to do, plz help
    in this.
    How can we send a collection object to server?
    Means:
    I have a list of user details in a grid.
    And if i want to add a new User or edit a existing user
    details then i don’t want to send a request every time.
    Instead of i want to keep adding new User only in front side
    i.e. in the grid
    And finally i will send a single request with all the Users
    details.
    can it be possible ? If possible please help me.
    Thanks in advance

    Actually, the best way to do is using amfphp but since you
    are new to flex it might be a bit confusing if you dont know php.
    check here for amfphp:
    http://www.amfphp.org/
    you can also traverse through the arraycollection and create
    and xml. (this part is basic programming). Then you can send it to
    server using a post.
    For that think check the liveDocs for classes:
    HTTPService
    and
    URLLoader.

  • How can I send registeration data from Mac machine to NT machine?

    How can i send or post data from Mac machine to NT machine without using browser? I m stucked. I want to register a customer from Mac machine by a container i.e. Form having awt components etc. and send it to NT machine to trigger it into SQL Server. Can i use Servlet for this purpose? The problem is client machine have Mac and no browser. But host machine is NT based.

    Thanks !
    I have got that one. But its documentation API describes very little information. I could not properly follow. if there is some help to start up in HTTP client?
    Can i use classes of HTTP client in my application and why i need it, I m not following as well. Please describe reply in detail.

  • How do I send E-Mail using Servlet or JSP?

    Hi friends,
    Anybody can you please tell me how do I send an email in Servlet or JSP?
    Do I need any special configuration to check in my server space?
    I am puzzled because after surfing on net, I found that some people sending email with Javamail and Activation API
    and some people sending email using import="sun.net.smtp.SmtpClient";Please give me some simple direction or any working code if possible.
    Thanking u,
    ---Sujoy

    What you need is a working SMTP account to be able to send email, that is accessible from the server. If you have that, simply use JavaMail.

  • How can I send email using two different email address that both link back to my one exchange account on my Ipad mini

    How can I send email using two different email address that both link back to my one exchange account on my Ipad mini? 
    On my PC I simply have a master return email address and use a POP for the secondary address.  Both are through the one exchange account without a problem.  I need to be able to do the same on my Ipad.

    Ah, I should have made that clear.  My domain didn't come from google.  It was purchased at and is hosted at dreamhost, but I haven't used their email servers in years - I just route everything through gmail.  I actually have a bunch of domains (with websites).
    Gmail has an option that lets someone with custom domains send (and receive) email through gmail using the custom domain once Google confirms proper ownership of the domain (to prevent spammers and such).  Gmail has a setting for "send email as" which allows gmail to be sent using a custom domain as the sender.  I'm pretty sure Apple's old mobileme had this feature too, but I didn't use it.

Maybe you are looking for

  • Itunes crashes when i plug in my iphone 4

    hmmmi havent seen to find too many other topics about this but everytime i plug my iphone4 into my pc... it crashes....windows 7 suggests finding a solution online but then nothing opens or does anything and itunes just croses. it wont do it if i don

  • Boolean error

    create or replace TYPE NUMTABLE AS TABLE OF INTEGER; i've a function in EQUIP_PKG package FUNCTION Exists_In_Numtable (p_target NUMBER, p_list NUMTABLE) RETURN boolean IS v_found boolean := FALSE; BEGIN FOR i IN p_list.FIRST .. p_list.LAST LOOP IF p_

  • Cannot Open Adobe Reader - EULA error

    I am unablel to launch anything in Adobe as I get an error message telling me that I need to go into Reader and accept the EULA.  How do I do this?  I've re-installed Reader, but was never asked to accept an EULA. 

  • Project  Scheduling

    Dear all, In Project System Scheduling what are the settings to be done? 1. In Configuration 2. In Settings->Planning Board assistant 3. In settigns -> Options -> Sceduling Please guide. SSanjay

  • What happends with the Auzhotizations FLAG in InfoObject

    Hello What happends with the Auzhotizations FLAG in InfoObject THNX from germany barish