How to attach XML file in the response of Web Services

Hi
I am new to the WEB SERVICE. this my requirement.
I need to make a class file a web service. and i need to get data from the data base and attach it in the response. I need to use SOAP MEssaging for this. so how to call the service from the JSP and how to get the data from the response,Before that which technology i need to use for this requirement. Plz let me know how to accomplish this task. I have gone thur lot of tech stuff and i am confused a lot, what to use and how to use. Will any one help me out.
Thanks
Vidya

Hey VP, thanks for replyng.
I have read the codes from a book and havesome code for client. The server side is yet to be done....but I have problems in compiling them as I am Unable to import javax.xml.soap.*;
This is basically a request to the Server asking it to find the match of the word "Mickey" from the XMLfile at the server...JAXRPC is involved(I Presume:) There are some supporting files.........hey But it doesn't compile only here. Hope it does in yrs
*******The client..........**********
* Client
package com.aby.jwsdp.soap.client;//the package
import javax.xml.messaging.URLEndpoint;
import javax.xml.soap.SOAPConnectionFactory;
import javax.xml.soap.SOAPConnection;
import javax.xml.soap.SOAPMessage;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Source;
import javax.xml.transform.stream.StreamResult;
import com.aby.jwsdp.soap.client.Fault;//supporting file
import com.aby.jwsdp.soap.client.RequestMessage;//supporting file
public class Client {
     static final string SERVICE_ENDPOINT="http://localhost:8080/chap/servlet/chap.RecieveServlet";
     public static void main(String args[]) {
          if(1!=args.length) {
               System.err.println("Usage: java "+"com.aby.jwsdp.soap.client.Client <name>");
          } else {
               new Client(args[0]);
     public Client(String name) {
          try{
               URLEndpoint endpoint = new URLEndpoint(SERVICE_ENDPOINT);
               SOAPConnectionFactory scf=SOAPConnectionFactory.newInstance();
               SOAPConnection connection = scf.createConnection();
               RequestMessage reqMsg = new RequestMessage();
               reqMsg.setName(name);
               SOAPMessage replySOAP = connection.call(reqMsq.getMessage(),endpoint);
               if(Fault.hasFault(replySOAP)) {
                    Fault fault = new Fault(replySOAP);
                    System.err.println("Recieved SOAP Fault");
                    System.err.println("Fault Code: "+fault.getFaultCode());
                    System.err.println("Fault string: "+fault.getFaultString());
                    System.err.println("Fault detail: "+fault.getFaultDetail());
               }else {
                    ResponseMessage respMsg = new ResponseMessage(replySOAP);
                    String responseValue = null;
                    try{
                         responseValue = respMsg.getValue();
                         System.out.println("Response: "+responseValue);
                    }catch(SchemaException e) {
                         System.err.println("Parsing error");
               connection.close();
          }catch(EXception e) {
               System.err.println(e/toString());
/*@author Aby
*Fault.java
package com.aby.jwsdp.soap.client;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPFault;
import javax.xml.soap.SOAPException;
import javax.xml.soap.Detail;
import javax.xml.soap.DetailEntry;
import java.util.Iterator;
public class Fault {
     protected SOAPFault soapFault;
     public Fault(SOAPMessage msg) throws SOAPException {
          SOAPPart soapPart = msg.getSOAPPart();
          SOAPEnvelope envelope = soapPart.getEnvelope();
          SOAPBody soapBody = envelope.getBody();
          soapFault = soapBody.getFault();
     public static boolean hasFault(SOAPMessage msg) throws SOAPException {
          SOAPPart soapPart = msg.getSOAPPart();
          SOAPEnvelope envelop = soapPart.getEnvelop();
          SOAPBody soapBody = envelop.getBody();
          return soapBody.hasFault();
     public String getFault() {
          return soapFault.getFaultCode();
     public String getFaultString() {
          return soapFault.getFaultString();
     public String getFaultDetail() {
          String ret = null;
          Detail detail = soapFault.getDetail();
          if(null!=detail) {
               Iterator it = detail.getDetailEntries();
               if(it.hasNext()) {
                    DetailEntry detEntry = (DetailEntry)it.next();
               ret = detEntry.getValue();
          return ret;
* RequestMessage.java
package com.aby.jwsdp.soap.client;
import com.aby.jwsdp.soap.client.Client;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPException;
public class RequestMessage {
     protected SOAPMessage soapMessage = null;
     public RequestMessage()
     throws SOAPException {
          MessageFactory mf = MessageFactory.newInstance();
          soapMessage = mf.createMessage();
     public void setName(String name)
     throws SOAPException {
          SOAPPart soapPart = soapMessage.getSOAPPart();
          SOAPEnvelope envelope = soapPart.getEnvelope();
          SOAPBody body = envelope.getBody();
          SOAPElement requestElement;
          requestElement = body.addChildElement(envelope.createName("GetValueByName","myns","www.syngress.com/JWSDP/soap-example"));
          SOAPElement paramElement;
          paramElement = requestElement.addChildElement("name");
          paramElement.addTextNode(name);
     public SOAPMessage getMessage() {
          return soapMessage;
check this out then we will see

Similar Messages

  • How to attach input file in the Test Script in SECATT in ECC6 ?

    Hi ,
    How to attach input file in the Test Script in ECC6  in Tcode SECATT ?
    For Testing in SECATT in ECC6, how to attach input file which contains multiple records ?
    Best Regards,
    Padhy

    Hi and Welcome to the Community!
    Since you have balance, and the issue is in your Work domain, you need to work with your server admins, as it's possible they are forbidding (via IT Policy) the ability to do as you desire.
    Good luck!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • How to attach a file to the mail

    How to attach a file to the mail

    I know that this can be done when going to any PDF program and push (send as  email)
    This also can done with multiple files or even with separate pages from that PDF file (Many programs can do that, like: PDF expert, Adobe Reader, iBooks, PDF Provider, Documents, etc)
    But what if I begin to wright an email, then I wanted to attach a file (such as PDF, or word, or any file) , FOR BASIC APPLE MAIL IT IS UNAVAILABLE
    You can attach Photo or Video but not PDF or other document
    There are some email programs that can attach files to email such as my.mail (as you can see from the photo)
    But why Apple don't provide such simple service ???

  • Manage the response of Web Service in case of Fault

    Hi,
    invoking the adapter HTTA, the Web Service send a response. B1i manage only the failure of adapter HTTA, but not the response of Web Service. If you want use the PostProcessing BizFlow correctly, i need to manage the response for check the presence of node Fault.
    This is the generic code for check this:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:fo="http://www.w3.org/1999/XSL/Format" bfa:force="">
         <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
         <xsl:param name="IDOCNUM"></xsl:param>
         <xsl:template match="/">
              <bfa:call>
                   <xsl:copy-of select="/bfa:call/bfa:in_doc"/>
                   <xsl:copy-of select="/bfa:call/bfa:inbound"/>
                   <bfa:outbound>
                        <bfa:payload>
                             <xsl:apply-templates select="bfa:call/bfa:outbound/bfa:payload"/>
                        </bfa:payload>
                        <xsl:copy-of select="/bfa:call/bfa:outbound/bfa:propertylist"/>
                   </bfa:outbound>
              </bfa:call>
         </xsl:template>
         <xsl:template match="bfa:call/bfa:outbound/bfa:payload">
              <Envelope xmlns="">
                   <Header>
                        <xsl:choose>
                             <xsl:when test="soap:Envelope/soap:Body/node()/node()/env:Envelope/env:Body/env:Fault">
                                  <ActionResult>failure</ActionResult>
                                  <ActionMessage>
                                       <xsl:text>PROCESS FAILURE - IDOC NUM: </xsl:text>
                                       <xsl:value-of select="$IDOCNUM"></xsl:value-of>
                                       <xsl:text> - CAUSE OF FAILURE: </xsl:text>
                                       <xsl:value-of select="soap:Envelope/soap:Body/node()/node()/env:Envelope/env:Body/env:Fault/env:Reason/env:Text"/>
                                  </ActionMessage>
                                  <Exception>
                                  <xsl:value-of select="soap:Envelope/soap:Body/node()/node()/env:Envelope/env:Body/env:Fault/env:Reason/env:Text"/>
                                  </Exception>
                             </xsl:when>
                             <xsl:otherwise>
                                  <ActionResult>success</ActionResult>
                                  <ActionMessage>
                                  <xsl:text>PROCESS SUCCESS - IDOC NUM: </xsl:text>
                                  <xsl:value-of select="$IDOCNUM"></xsl:value-of>
                                  </ActionMessage>
                             </xsl:otherwise>
                        </xsl:choose>
                   </Header>
              </Envelope>
         </xsl:template>
    </xsl:stylesheet>
    With this example you can set the message in B1i GUI (Message Log, Message Result column) and you can set the result of action (success or failure).

    Hi,
    invoking the adapter HTTA, the Web Service send a response. B1i manage only the failure of adapter HTTA, but not the response of Web Service. If you want use the PostProcessing BizFlow correctly, i need to manage the response for check the presence of node Fault.
    This is the generic code for check this:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:env="http://www.w3.org/2003/05/soap-envelope" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:b1im="urn:com.sap.b1i.sim:b1imessage" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms" xmlns:fo="http://www.w3.org/1999/XSL/Format" bfa:force="">
         <xsl:output method="xml" encoding="UTF-8" indent="yes"/>
         <xsl:param name="IDOCNUM"></xsl:param>
         <xsl:template match="/">
              <bfa:call>
                   <xsl:copy-of select="/bfa:call/bfa:in_doc"/>
                   <xsl:copy-of select="/bfa:call/bfa:inbound"/>
                   <bfa:outbound>
                        <bfa:payload>
                             <xsl:apply-templates select="bfa:call/bfa:outbound/bfa:payload"/>
                        </bfa:payload>
                        <xsl:copy-of select="/bfa:call/bfa:outbound/bfa:propertylist"/>
                   </bfa:outbound>
              </bfa:call>
         </xsl:template>
         <xsl:template match="bfa:call/bfa:outbound/bfa:payload">
              <Envelope xmlns="">
                   <Header>
                        <xsl:choose>
                             <xsl:when test="soap:Envelope/soap:Body/node()/node()/env:Envelope/env:Body/env:Fault">
                                  <ActionResult>failure</ActionResult>
                                  <ActionMessage>
                                       <xsl:text>PROCESS FAILURE - IDOC NUM: </xsl:text>
                                       <xsl:value-of select="$IDOCNUM"></xsl:value-of>
                                       <xsl:text> - CAUSE OF FAILURE: </xsl:text>
                                       <xsl:value-of select="soap:Envelope/soap:Body/node()/node()/env:Envelope/env:Body/env:Fault/env:Reason/env:Text"/>
                                  </ActionMessage>
                                  <Exception>
                                  <xsl:value-of select="soap:Envelope/soap:Body/node()/node()/env:Envelope/env:Body/env:Fault/env:Reason/env:Text"/>
                                  </Exception>
                             </xsl:when>
                             <xsl:otherwise>
                                  <ActionResult>success</ActionResult>
                                  <ActionMessage>
                                  <xsl:text>PROCESS SUCCESS - IDOC NUM: </xsl:text>
                                  <xsl:value-of select="$IDOCNUM"></xsl:value-of>
                                  </ActionMessage>
                             </xsl:otherwise>
                        </xsl:choose>
                   </Header>
              </Envelope>
         </xsl:template>
    </xsl:stylesheet>
    With this example you can set the message in B1i GUI (Message Log, Message Result column) and you can set the result of action (success or failure).

  • How to update XML file from the program

    i am new in abap , and i have the following issue,so plz anyone who knows how to do it
    Background :
    An XML file is used as the datasource for a Flex Application. From time to time this requires updating with new staff details.
    i have already saved the xml file in the c drive with the name C:\AdvAC\AC1\bin-debug\assets\staff
    Requirement :  Write a Dialog transaction with the following text input fields.
    Reference Indicator.     (Char10)
    Staff No          (NUMC, Length 5)
    Name               (Char50)
    Room               (Numc, length 3)
    Phone               (Numc Length 7)
    Mail               (char30)
    in screen 100
    The transaction should also have an u201CUpdate Fileu201D button, which when pressed :
    1) Loads the file C:\AdvAC\AC1\bin-debug\assets \ into an ITAB.
    2) Inserts the data into the ITAB using the following XML format.
    <staff>
    <ref_ind> Reference Indicator.</ref_ind>
    <staff_no> Staff No </staff_no>
    <name> Name </name>
    <room> Room </room>
    <phone> Phone </phone>
    <mail> Mail </mail>
    </staff>
    all should be inside  <allstaff> </allstaff> tagsu2026.
    Writes the ITAB back to the file.
    thanx all

    this is what i have done but i dont know how to do the rest. i will apprecite any help from u.
    Edited by: man700s on Feb 16, 2010 6:58 AM
    REPORT  Z_XML_FILE_UPDATE.
    TYPES: BEGIN OF ts_staff,
             REF_IND(10)  TYPE c,
             Staff_No(5)  TYPE c,
             Name(50)     TYPE c,
             Room(3)      Type n,
             Phone(7)     Type n,
             Mail(30)     Type c,
           END OF ts_staff.
    DATA: t_staff TYPE TABLE OF ts_staff WITH HEADER LINE.
    DATA: w_staff Type ts_staff.
    DATA T_STRING TYPE TABLE OF STRING.
    DATA W_STRING TYPE STRING.
    call SCREEN 100.
    PERFORM upload_xml_file.
    PERFORM update_xml_tab.
    *PERFORM download_xml_file.
    MODULE USER_COMMAND_0100 INPUT.
    W_STRING = '<allstaff>'.
      APPEND w_string to t_string.
      loop at t_staff into w_staff.
      w_string ='<staff>'.
      APPEND w_string to t_string.
      if T_staff-Ref_Ind = 'X'.
      CONCATENATE '<Ref_Ind>' w_staff-Ref_Ind '</Ref_Ind>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      if T_staff-staff_no = 'X'.
      CONCATENATE '<staff_no>' w_staff-staff_no '</staff_no>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      if T_staff-name = 'X'.
      CONCATENATE '<name>' w_staff-name '</name>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
    if T_staff-room = 'X'.
      CONCATENATE '<room>' w_staff-room '</room>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      if T_staff-phone = 'X'.
      CONCATENATE '<phone>' w_staff-phone '</phone>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      if T_staff-mail = 'X'.
      CONCATENATE '<mail>' w_staff-mail '</mail>' into w_string.
      APPEND w_string to t_string.
      ENDIF.
      w_string = '</staff>'.
      append w_string to t_string.
    ENDLOOP.
      W_STRING = '</allstaff>'.
      APPEND w_string to t_string.
    ENDMODULE.               
    Edited by: man700s on Feb 16, 2010 7:01 AM

  • How to Save XML file in the same directory as the swf file automatically?

    Hi all,
    I'm really new here with flash and actionscript 3, so i might not make any sense, probably. Any input is greatly appreciated.
    So here's my problem, i'm trying to make a Top Score history for a flash game, which i load from an XML file. The problem comes to when i want to update the XML file. how do i do that automatically without prompting the user (ofcourse). I want it to be saved automatically to the same directory as the flash file.
    here's my code right now, but it prompts the user where it wants to be saved, which i don't want to happen:
    var xml:XML = <XML>
                        <topScoreList>
                        </topScoreList>
                  </XML>;
    for(var i:Number=0; i<10; i++)
         var Record:XML = <Record>
                             <score></score>
                             <playerName></playerName>
                        </Record>;
         Record.score.appendChild(topScores[i].toString()); //topScores[] -> class variable containing scores
         Record.playerName.appendChild(topNames[i].toString()); //topNames[] -> class variable containing names
         xml.topScoreList.appendChild(Record);
    var ba:ByteArray = new ByteArray();
    ba.writeUTFBytes(xml);
    var fr:FileReference = new FileReference();
    fr.save(ba, "topScoreList.xml");

    yeah that makes sense, actually - after reading a dozen more forums. It's really weird tho that flash doesn't have a Buffer writer, unlike other programming frameworks.
    But yeah, thanks. i'll start reading on flash.net.SharedObject, correct ? Thanks.
    Anyways, if anyone out there has a different input, will be greatly appreciated!!

  • How to attach a file in the utl_mail utility in oracle 10.2.0

    hi,
    where is the default file destination to attach a file in the utl_mail utility in oracle 10g. i have to send an attachment..
    regards,
    Deepak
    Edited by: Deepak_DBA on Nov 4, 2009 3:10 PM

    HI,
    I have succesfully created utl_mail and send mail.. but could not able to attach a file in that mail..
    i have used the procedure given below..
    DECLARE
    rfile VARCHAR2(255);
    BEGIN
    UTL_MAIL.send_attach_varchar2(sender =>'[email protected]',recipients =>'[email protected]',subject =>'Test new Mail',message => 'Oracle World',mime_type => 'text; charset=us-ascii',priority => 3,attachment => rfile,att_inline => TRUE,att_mime_type=> 'text/plain; charset=us-ascii',att_filename => 'i:\session.txt');
    END;
    regards,
    Deepak

  • How to attach two files in the send mail action

    Hi experts
    I want to attach two files in the send mail action . I tried using ; as a separator but it did not work .
    Regards,
    Antonio R . Rubalcaba

    Thanks Jeremy,  
    Yes I am contemplating the another threat .  I still want to send two files because the two files have very distinct type of information .  The first one is operational and the second one is about statistics .  Of course that I can send both type of inforrmation in only one file . I just want to save time to the end user and let him select what infomation he wants to see .
    Thanks and my best wishes for you and your family ,
    Antonio

  • How to include xml file without embedding in flex web application?

    Hi
    I have a big XML file around 11 mb. I want to include this xml in my web application without embedding.
    So anyone have idea to include.
    Please suggest me any idea.
    Thanks

    If you don't want to embed the XML file into a SWF, then the SWF can download the XML file from the server at runtime when it needs it. But there will be a delay while that happens. Maybe it would be better to put the data in the XML file into a database and then access only the parts of it that you need.
    Gordon Smith
    Adobe Flex SDK Team

  • How to upload XML file into the internal table in Webdynpro  ABAP ?

    Hi Friends,
    I am not able to upload the XML file into ABAP,can you please help me in solving this issue with the help of source code.
    Regards
    Dinesh

    Hi Dinesh,
    Try go through this program which I had developed earlier. It takes as input an XML file and then breaks it down into name-value pairs of an intrnal table. You need to pass an XML file as input to this program. (I had hard coded the path for my XML file in it. You need to replace it with 1 of your own or you can just delete it and use the browse button to selet the file on your PC)
    Regards,
    Uday
    REPORT  ZUDAY_XML no standard page heading.
    " Internal table to store the XML file in binary mode
    data: begin of it_xml occurs 1,
            c(255) type x,
          end of it_xml,
    " Name-value pairs table rturned by FM SMUM_XML_PARSE
          it_SMUM_XMLTB type SMUM_XMLTB occurs 0 with header line,
    " Table returned by FM SMUM_XML_PARSE for error handling
          it_bapiret2 type bapiret2 occurs 0 with header line.
    " XSTRING variable to be used by FM SCMS_BINARY_TO_XSTRING to hold the XML file in XSTRING format
    data: I_xstring type xstring, 
    " String variable to hold XML file path to pass to GUI_UPLOAD
          I_file_path type string,
    " Variable to store the size of the uploaded binary XML file
          I_LENGTH TYPE I VALUE 0.
    parameters: P_path type IBIPPARMS-PATH default 'C:\Documents and Settings\c5104398\Desktop\flights.xml'.
    " Get the XML file path from the user
    at selection-screen on value-request for P_path.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          FILE_NAME = P_PATH.

  • How to attach a file to the mail in jsp

    hi.i would like to send mails with in local server with files as attachments.i wrote this code but its not working.please help
    <%@ page import="javax.mail.*,javax.mail.internet.*,java.util.Date,java.io.*,java.net.InetAddress,java.sql.*,java.util.Properties,java.net.*,javax.sql.*,javax.activation.*,java.util.*,java.text.*" %>
    <%@ page import="java.io.*,java.sql.*,java.net.*,java.util.*,java.text.*" %>
    <%
         String Attachfiles1="";
    if("Send".equalsIgnoreCase("send"))
    try
         String subject="",from="",url = null,to="";
         String mailhost = "local server";
         Properties props = System.getProperties();
    String msg_txt="";
         String strStatus="";
    String mailer = "MyMailerProgram";
    to=request.getParameter("to");
    from=request.getParameter("from");
    subject=request.getParameter("subject");
    msg_txt=request.getParameter("message");
    Attachfiles1=request.getParameter("fieldname1");
    props.put("mail.smtp.host", mailhost);
    Session mailsession = Session.getDefaultInstance(props, null);
    Message message = new MimeMessage(mailsession);
    message.setFrom(new InternetAddress(from));
    message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
    // message.setSubject(subject);
    // message.setHeader("X-Mailer", mailer);
    // message.setSentDate(new Date());
    message.setText(msg_txt);
                   // Final message = part1 + part2
                   Multipart mp = new MimeMultipart();
                   message.setContent(mp);
                   // Message part 1 is text - add to multipart
                   MimeBodyPart m1 = new MimeBodyPart();
                   m1.setContent(msg_txt, "text/plain");
                   mp.addBodyPart(m1);
                   // Message part 2 is binary (file to send)
                   MimeBodyPart m2;
                   // Support multiple file send (separated by ";")
                   FileDataSource fds = new FileDataSource(Attachfiles1);
                        m2 = new MimeBodyPart();
                        m2.setDataHandler(new DataHandler(fds) );
                        m2.setFileName( new File(Attachfiles1).getName() );
                        mp.addBodyPart(m2);     // add to final message (part 2)
    //message.addAttachment(new Attachment(new File(Attachfiles1)));
    //BodyPart messageBodyPart = new MimeBodyPart();
    //BodyPart messageBodyPart2 = new MimeBodyPart();
    //Multipart multipart = new MimeMultipart();
    ////messageBodyPart = new MimeBodyPart();
    //javax.activation.DataSource source = new javax.activation.FileDataSource(Attachfiles1);
    //messageBodyPart.setDataHandler(new DataHandler(source));
    ////messageBodyPart.setFileName(new File(Attachfiles1).getName());
    //messageBodyPart2.setText(msg_txt); // set the txt message
    //multipart.addBodyPart(messageBodyPart);
    //multipart.addBodyPart(messageBodyPart2);
    //message.setContent(this.multipart);
    Transport.send(message);
    out.println("Message Sent");
    catch (Exception e)
    e.printStackTrace();
    %>
    <html>
    <body>
    <div class="frame">
         <form action="Composemailpp.jsp" method="post">
              <b>SelectPosition:</b> <select name="cars" >
    <option value="ABAP">ABAP
    <option value="JAVA">JAVA
    <option value="DOTNET">DOTNET
    <option value="SAP">SAP
    </select><br><br>
    <table border="1" cellpadding="2" cellspacing="2">
    <tr><th>
    Name<br><input type="text" name="Name"><br>
    </th>
    <th>
    EmailId<br><input type="text" name="EmailId"><br>
    </th>
    <th>
    ContactNumber<br><input type="text" name="ContactNumber"><br>
    </th>
    <th>
    Position<br><input type="text" name="Position"><br>
    </th>
    </tr>
    </table><br>
    <b>SelectUser :</b><select name="cars">
    <option value="Administrator">Administrator
    <option value="User1">User1
    <option value="User2">User2
    <option value="User3">User3
    <option value="User3">User4
    </select>
    <br>
    <b>To :</b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="to" size="72"><br>
    <b>From :</b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="from" size="72"><br>
    <b>Subject :</b>&nbsp&nbsp&nbsp<input type="text" name="subject" size="72"><br>
    <b>Message:</b><br>
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<textarea rows="10" cols="50" name="message">
    </textarea> <br><br>
    <b>AttachedFile:</b>&nbsp<input type="file" name="fieldname1" value="filename" size="50"><br><br>
    <!--<b>AttachedFile:</b>&nbsp<input type="file" name="fieldname2" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>&nbsp<input type="file" name="fieldname3" value="filename" size="50"><br><br>
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="submit" name="attachfiles" value="Attachfiles">
    -->
    <center>
    <input type="submit" name="send" value="Send" >
    </center>
    </form>
    </div>
    </body>
    </html>

    message.setText(msg_txt);Don't do this. You want a multipart message. You want the msg_txt
    to be the first part of the multipart, which you do below.
                   // Final message = part1 + part2
                   Multipart mp = new MimeMultipart();
                   message.setContent(mp);
                   // Message part 1 is text - add to multipart
                   MimeBodyPart m1 = new MimeBodyPart();
                   m1.setContent(msg_txt, "text/plain");m1.setText(msg_txt); // would be better
                   mp.addBodyPart(m1);
                   // Message part 2 is binary (file to send)
                   MimeBodyPart m2;
                   // Support multiple file send (separated by ";")
    FileDataSource fds = new
    new FileDataSource(Attachfiles1);
                        m2 = new MimeBodyPart();
                        m2.setDataHandler(new DataHandler(fds) );
    m2.setFileName( new File(Attachfiles1).getName() );Since you're using JavaMail 1.4, you can replace much of the above
    with simply:
    m2.attachFile(Attachfiles1);
    But none of the problems above should prevent your code from working.
    You do understand, of course, that the name of the file is a filename
    on the server, not the client that's running the browser, right?
    When you say "its not working", what exactly do you mean?

  • How to attach HLP file with the existing forms

    We have FORMS 5.0 application running. We have developed .HLP and .CNT files using ROBOHELP utility. I would like to attach the help file to the existing form. I want to use the registry to set the help file path so that I won't hardcode the path. I tried
    using WINHLP32.exe file using the HOST command. This need path settings in the machine. Does any body know other methods instead of using HOST command.
    Thanks in advance.
    Bye
    Meenakshi Sundaram Ganesh

    You could use the d2kwutil.pll and execute the Win_api_shell.Winhelp procedure

  • How to attach a file fin the middle tier in the workflow notification

    My requirement
    1) File is there in the middle tier (file name : invoice_99.pdf )
    2) From workflow notification I need to read that file (invoice_99.pdf) and
    open it from the notification when user click on it
    can you please let me know is there any way to handle this

    Thiru,
    This is not the right forum for this.
    Btw, I have done exactly same requirement several times and it's easy to do.
    1)Create a Document Attribute and specify to attach it to the notif msg.
    2)Create a PL/SQL function activity in workflow
    3)In the PL/SQL proc, Load the file using dbms_lob into a LOB and set the attribute using
    wf_engine.SetItemAttrText(itemtype      => itemType
    ,itemkey      => itemkey
    ,aname      => 'SRQ_REPORT'
    ,avalue           => 'PLSQLCLOB:xxx_gbl_wf.get_pdf_quote/'||v_report_request_id||':'||v_qot_number);
    Hope this helps
    Srini

  • Help on how to read the content of an XML file from the payload

    I have a receiver channel / mail adapter, that sends e-mails with a XML attachment.
    I’m trying to write a Bean, that should make it possible to rename the attached XML file dynamically.
    In the Bean I want to read the content of the attached XML file, it could be the “order number”.
    The filename should then be “Order number”.XML.
    <u><i>Can anyone help me with how to read the content of the XML file from the payload.</i></u>
    <i><b>Frank</b></i>

    hi,
    check this: http://jakarta.apache.org/poi/

  • Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the rows? Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    Hello Anybody, I have a question. Can any of you please suggest me how to make an xml file from the database table with all the records?
    Note:- I am having the XSD Schema file and the resulted XML file should be in that XSD format only.

    The Oracle documentation has a good overview of the options available
    Generating XML Data from the Database
    Without knowing your version, I just picked 11.2, so you made need to look for that chapter in the documentation for your version to find applicable information.
    You can also find some information in XML DB FAQ

Maybe you are looking for

  • Getting Error - Cause: Status of the batch is not 'Completed' in OIM 11g R2 during Trusted Recon

    Hi All I am new to OIM 11g R2. I am trying to create custom connector for trusted recon. The case is to migrate the users from 10g to 11g R2. The recon event is created but it is in Event Recieved status and when I re-evaluate the event, its giving e

  • Apex 3.1.2 Development Environment typo

    <ol> <li>On the Report Attributes tab of a report...</li> <li>in the Layout and Pagination      section...</li> <li>the field label "Report Attributes Substituion"</li> </ol> I'm thinking there's a 't' missing there. Yet how many times have we all gl

  • Messages won't display images, sandbox violation?

    Can anyone help me figure out why, when I receive an iMessage that contains a photo or other image, Messages on Yosemite won't display the image? It appears to be a sandbox permissions issue, but I can't figure out how to resolve it. Briefly, when I

  • Unicode Error in standard program

    Hi, Iam working on an upgrade project I am getting an error as below "In Unicode, DESCRIBE LENGTH can only be used with the IN BYTE MODE or CHAR mode" How to fix this error,   as  the error is  from STANDARD PROGRAM "Include /IXOS/LDC_CF01" I know th

  • Media import issue

    I have a sony DCR-SR100 HDD Camcorder and have done numerous videos in iMovie '09. My camera is listed on the "supported/tested cameras" page on Apple Support. I previously was able to import video directly from my camera into iMovie, but no longer c