Unique Problem: Returning SOAP+ Attachment using a class based webservice

Hi everyone,
Im trying to return a Soap+ attachment response back using the following:
attachDoc(byte[] bdoc, String sTransactionNumber,
               String sRequestedType)
Where byte[] is the attachment and the 2 string parameters are soap message contents.
The attachment is attached successfully to the message and i can send a response back to the clients console using :
message.writeTo(System.out);
My problem is that i dont know how to return this soapmessage+attachment back to the client.
Ive tried using the return type of the method as :
public SOAPMessage attachDoc(byte[] bdoc, String sTransactionNumber,
               String sRequestedType)
but i cant return a SOAPMessage return type in axis.
Does anyone have any clues how i should sort this out so that the client gets the SOAPMessage and attachment when the method is called ?
Please help :S
Thanks,

I dunno if this is what you asked for....
Hope this helps a bit
You may want to check this link out
http://www-unix.globus.org/mail_archive/discuss/2007/02/msg00037.html
MessageContext msgContext = MessageContext.getCurrentContext();
File file = new File("filename.txt");
org.apache.axis.attachments.AttachmentPart replyPart=
new org.apache.axis.attachments.AttachmentPart(new DataHandler(new
FileDataSource(file)));
Message rspMsg= msgContext.getResponseMessage();
rspMsg.addAttachmentPart(replyPart);
so ur basically adding the file to the reply message.
The link i gave has a better description, it has the entire process of sending file to server and downloading file from server codes.

Similar Messages

  • Problem with constructors and using public classes

    Hi, I'm totally new to Java and I'm having a lot of problems with my program :(
    I have to create constructor which creates bool's array of adequate size to create a sieve of Eratosthenes (for 2 ->n).
    Then it has to create public method boolean prime(m) which returs true if the given number is prime and false if it's not prime.
    And then I have to create class with main function which chooses from the given arguments the maximum and creates for it the sieve
    (using the class which was created before) and returns if the arguments are prime or not.
    This is what I've written but of course it's messy and it doesn't work. Can anyone help with that?
    //part with a constructor
    public class ESieve {
      ESieve(int n) {
    boolean[] isPrime = new boolean[n+1];
    for (int i=2; i<=n; i++)
    isPrime=true;
    for(int i=2;i*i<n;i++){
    if(isPrime[i]){
    for(int j=i;i*j<=n;j++){
    isPrime[i*j]=false;}}}
    public static boolean Prime(int m)
    for(int i=0; i<=m; i++)
    if (isPrime[i]<2) return false;
    try
    m=Integer.parseInt(args[i]);
    catch (NumberFormatException ex)
    System.out.println(args[i] + " is not an integer");
    continue;
    if (isPrime[i]=true)
    System.out.println (isPrime[i] + " is prime");
    else
    System.out.println (isPrime[i] + " is not prime");
    //main
    public class ESieveTest{
    public static void main (String args[])
    public static int max(int[] args) {
    int maximum = args[0];
    for (int i=1; i<args.length; i++) {
    if (args[i] > maximum) {
    maximum = args[i];
    return maximum;
    new ESieve(maximum);
    for(int i=0; i<args.length; i++)
    Prime(i);}

    I've made changes and now my code looks like this:
    public class ESieve {
      ESieve(int n) {
       sieve(n);
    public static boolean sieve(int n)
         boolean[] s = new boolean[n+1];
         for (int i=2; i<=n; i++)
    s=true;
    for(int i=2;i*i<n;i++){
    if(s[i]){
    for(int j=i;i*j<=n;j++){
    s[i*j]=false;}}}
    return s[n];}
    public static boolean prime(int m)
    if (m<2) return false;
    boolean x = sieve(m);
    if (x=true)
    System.out.println (m + " is prime");
    else
    System.out.println (m + " is not prime");
    return x;}
    //main
    public class ESieveTest{
    public static int max(int[] args) {
    int maximum = args[0];
    for (int i=1; i<args.length; i++) {
    if (args[i] > maximum) {
    maximum = args[i];
    return maximum;
    public static void main (String[] args)
    int n; int i, j;
    for(i=0;i<=args.length;i++)
    n=Integer.parseInt(args[i]);
    int maximum=max(args[]);
    ESieve S = new ESieve(maximum);
    for(i=0; i<args.length; i++)
    S.prime(i);}
    It shows an error for main:
    {quote} ESieveTest.java:21: '.class' expected
    int maximum=max(args[]); {quote}
    Any suggestions how to fix it?                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to download a SOAP attachment using pl/sql

    Gurus,
    I have a custom pl sql application that is web services based. The custom pl sql application invokes the external web services and updates Oracle Field Service application.
    One of the new requirements is to get the signatures from SOAP Attachments (a binary file) and attach it to Field Services transactions in Oracle.
    Does anyone has an example of how to download the SOAP attachment file from web service using pl/sql.
    The pl sql program uses UTL_HTTP to access web services.
    Much Thanx.

    I think you may be in the wrong forum, but anyways...
    What I think your looking for is the htp.print('insert html here'); function. It's plsql, and writes out html to the web server that calls it.
    if you search for htp.print you should find loads of examples.
    hope this helps.
    Merv.

  • Using dll class based

    hie
    i am trying to use a dll based on c++ programing using  classes.
    the only functiones that i can  see / rich  are the ones outside the class .
    why ?
    how can i rich the ones that are inside it ?
    i have the cpp and the  h files . can i use them insted ?
    regards
    zivmer

    zivmer wrote:
    hie
    i am trying to use a dll based on c++ programing using  classes.
    the only functiones that i can  see / rich  are the ones outside the class .
    why ?
    how can i rich the ones that are inside it ?
    i have the cpp and the  h files . can i use them insted ?
    regards
    zivmer
    You can't. LabVIEW's Call Library Node can only access global C style functions exported through the DLL export table. C++ functions are normally not exported at all but instead accessed through the method table of an object. Since the C++ binary interface is compiler dependant supporting such an interface would be very difficult for LabVIEW.
    Your options are to use ActiveX instead, if your dll supports that, or write a standard C wrapper library that translates the C object methods into standard C function calls and export them from your DLL.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Problem in sending attachment using "SO_NEW_DOCUMENT_ATT_SEND_API1"

    Hi All,
    I have a requirement of sending the data available in an internal table via email. I need to populate this content into excel sheet and send it as an attachment to recipients. I am using the following code for that.
    REPORT  z51515t_doc_att.
    DATA: objpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: objhead   LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: objbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: objtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: reclist   LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
    DATA: doc_chng  LIKE sodocchgi1.
    DATA: tab_lines LIKE sy-tabix.
    DATA : BEGIN OF itab OCCURS 0,
              pernr LIKE p0001-pernr,
              name LIKE p0002-vorna,
           END OF itab.
    Creation of the document to be sent
    File Name
    doc_chng-obj_name = 'SENDFILE'.
    Mail Subject
    doc_chng-obj_descr = 'Delivered Mail'.
    Mail Contents
    objtxt = 'My Content 1 '.
    APPEND objtxt.
    objtxt = 'My Content2'.
    APPEND objtxt.
    DESCRIBE TABLE objtxt LINES tab_lines.
    Creation of the entry for the document
    CLEAR objpack-transf_bin. "Will get content from content_text
    objpack-head_start = 1. "Reads given row number in object header
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    objpack-doc_type = 'RAW'.
    APPEND objpack.
    Prepare content for attachment
    DO 3 TIMES.
      itab-pernr = 182.
      itab-name = 'Prasath'.
      APPEND itab.
      itab-pernr = 1000.
      itab-name = 'Praveen'.
      APPEND itab.
    ENDDO.
    Populate attachment content
    LOOP AT itab.
      CONCATENATE itab-pernr itab-name INTO objbin-line.
      APPEND objbin.
    ENDLOOP.
    DESCRIBE TABLE objbin LINES tab_lines.
    Creation of the entry for the compressed attachment
    objpack-transf_bin = 'X'. "Will get content from content_bin
    objpack-head_start = 1.
    objpack-head_num   = 1.
    objpack-body_start = 1.
    objpack-body_num   = tab_lines.
    objpack-doc_type   = 'EXT'.
    objpack-obj_name   = 'WEBSITE'.
    objpack-obj_descr  = 'MyFile.XLS'.
    objpack-doc_size   = tab_lines * 255.
    APPEND objpack.
    target recipent
    CLEAR reclist.
    reclist-receiver = '[email protected]'.
    reclist-express  = 'X'.
    reclist-rec_type = 'U'.
    APPEND reclist.
    copy recipents
    CLEAR reclist.
    reclist-receiver = '[email protected]'.
    reclist-express  = 'X'.
    reclist-rec_type = 'U'.
    reclist-copy     = 'X'.
    APPEND reclist.
    Sending the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data              = doc_chng
        put_in_outbox              = 'X'
        commit_work                = 'X'
      TABLES
        packing_list               = objpack
        object_header              = objhead
        contents_bin               = objbin
        contents_txt               = objtxt
        receivers                  = reclist
      EXCEPTIONS
        too_many_receivers         = 1
        document_not_sent          = 2
        operation_no_authorization = 4
        OTHERS                     = 99.
    Now using this code i am able to send out the file but the data in the XL file is not aligned properly. When i open the attachment that i receive the contents of itab appear inside the same cell - A1 of the XL sheet. I want the data to be available in different rows and columns. How do i achieve this?
    Thanks,
    Prasath N

    See the below program it was sending the file   as  attach in XLS  format   by  column and rows  are  properly placed ...  see the
    <b>Code  in my program  :
    CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                 con_tab TYPE x VALUE '09'.   "OK for non Unicode</b>
    REPORT  ZEMAIL_ATTACH                   .
    TABLES: ekko.
    PARAMETERS: p_email   TYPE somlreci1-receiver
                                      DEFAULT '[email protected]'.
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,
          wa_ekpo TYPE t_ekpo.
    TYPES: BEGIN OF t_charekpo,
      ebeln(10) TYPE c,
      ebelp(5)  TYPE c,
      aedat(8)  TYPE c,
      matnr(18) TYPE c,
    END OF t_charekpo.
    DATA: wa_charekpo TYPE t_charekpo.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   t_packing_list LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_receivers LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
            t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1 OCCURS 0 WITH HEADER LINE,
            w_cnt TYPE i,
            w_sent_all(1) TYPE c,
            w_doc_data LIKE sodocchgi1,
            gd_error    TYPE sy-subrc,
            gd_reciever TYPE sy-subrc.
    *START_OF_SELECTION
    START-OF-SELECTION.
    *   Retrieve sample data from table ekpo
      PERFORM data_retrieval.
    *   Populate table with detaisl to be entered into .xls file
      PERFORM build_xls_data_table.
    *END-OF-SELECTION
    END-OF-SELECTION.
    * Populate message body text
      perform populate_email_message_body.
    * Send file by email as .xls speadsheet
      PERFORM send_file_as_email_attachment
                                   tables it_message
                                          it_attach
                                    using p_email
                                          'Example .xls documnet attachment'
                                          'XLS'
                                          'filename'
                                 changing gd_error
                                          gd_reciever.
    *   Instructs mail send program for SAPCONNECT to send email(rsconn01)
      PERFORM initiate_mail_execute_program.
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp aedat matnr
       UP TO 10 ROWS
        FROM ekpo
        INTO TABLE it_ekpo.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  BUILD_XLS_DATA_TABLE
    *       Build data table for .xls document
    FORM build_xls_data_table.
      CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                 con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    *constants:
    *    con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
    *    con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'EBELN' 'EBELP' 'AEDAT' 'MATNR'
             INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT it_ekpo INTO wa_charekpo.
        CONCATENATE wa_charekpo-ebeln wa_charekpo-ebelp
                    wa_charekpo-aedat wa_charekpo-matnr
               INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
    *       Send email
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error    TYPE sy-subrc,
            ld_reciever TYPE sy-subrc,
            ld_mtitle LIKE sodocchgi1-obj_descr,
            ld_email LIKE  somlreci1-receiver,
            ld_format TYPE  so_obj_tp ,
            ld_attdescription TYPE  so_obj_nam ,
            ld_attfilename TYPE  so_obj_des ,
            ld_sender_address LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver LIKE  sy-subrc.
      ld_email   = p_email.
      ld_mtitle = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    * Fill the document data.
      w_doc_data-doc_size = 1.
    * Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    * Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    * Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    * Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    * Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver = ld_email.
      t_receivers-rec_type = 'U'.
      t_receivers-com_type = 'INT'.
      t_receivers-notif_del = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    * Populate zerror return code
      ld_error = sy-subrc.
    * Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
    *       Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
    *        Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test ekpo records'.
      APPEND it_message.
    endform.                    " POPULATE_EMAIL_MESSAGE_BODY
    reward  points  if it is usefull ....
    Girish

  • Problem in upload file using oreilly classes

    Hi
    I stucked on a problem......
    I want to upload file from html page....On this page I want only a upload button so that when I click on this button file will upload from my client m/c to server m/c....
    I have code n all but browse button on html page....now I want to remove this browse button n want to give the file path somewhere in the code itself........so that on html page there will only the uplod button and by click on this button file will upload from client to server.......server path already there in code.....Please do the needful
    Abhishek
    I m putting the code here:-
    FileUpload.java
    upload-FileUpload.java
    NOTE: This file is a generated file.
    Do not modify it by hand!
    package upload;
    //custom imports for FileUpload
    //add your custom import statements here
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import com.oreilly.servlet.MultipartRequest;
    import java.util.*;
    public class FileUpload extends javax.servlet.http.HttpServlet
         protected boolean create() throws java.lang.Exception
              return true;
         public FileUpload()
         {   // Constructor.
         private void unhandledEvent( String listenerName, String methodName, java.lang.Object event )
         * destroy Method
         public void destroy()
              super.destroy();
              // TODO: implement
         * doGet Method
         protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              System.out.println("abhishek");
              response.setContentType( "text/html" );
              PrintWriter out = response.getWriter();
              out.println("<HTML>");
              out.println("<HEAD><TITLE>FileUpload</TITLE></HEAD>");
              out.println("<BODY>");
              out.println("<H1>FileUpload</H1>");
              out.println("Hello World!");
              out.println("<P>Default Implementation From PowerJ</P>");
              out.println("</BODY></HTML>");
              // TODO: implement
         * doPost Method
         protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
              PrintWriter out = response.getWriter();
              try{
                   response.setContentType("text/html");
                   out.println("<HTML>");
                   out.println("<head><Title>Decoded Uploaded File</title><head>");
                   out.println("<body>");
                   out.println("<H1>UploadFile</h1>");
                   // path must be absolute to upload dir
                   // This is the decoder class that extracts the parameters and transfer file
                   // request argument = Http input stream
                   // c:\\temp\\upload = directory to save file
                   // 15*1024*1024 = 15mb max size file
                   MultipartRequest multi = new MultipartRequest(request, "c:\\temp\\upload",15*1024*1024);
                   // Lists form parameters
                   out.println("Params:");
                   Enumeration params = multi.getParameterNames();
                   out.println("<pre>");
                   while (params.hasMoreElements()) {
                        String name = (String)params.nextElement();
                        String value = multi.getParameter(name);
                        out.println(name + " = " + value);
                   out.println("</pre>");
                   // Show details of uploaded file
                   out.println("Files:");
                   Enumeration files = multi.getFileNames();
                   out.println("<pre>");
                   while (files.hasMoreElements()) {
                        String name = (String)files.nextElement();
                        String filename = multi.getFilesystemName(name);
                        String type = multi.getContentType(name);
                        File f = multi.getFile(name);
                        out.println("name: " + name);
                        out.println("filename: " + filename);
                        out.println("type: " + type);
                        if (f != null) {
                             out.println("f.toString(): " + f.toString());
                             out.println("f.getName(): " + f.getName());
                             out.println("f.exists(): " + f.exists());
                             out.println("f.length(): " + f.length());
                             out.println();
                        out.println("</pre>");
              }catch (Exception e){
                   out.println("<pre>");
                   e.printStackTrace(out);
                   out.println("</pre>");
              out.println("</body></html>");
         * init Method
         public void init(ServletConfig config) throws ServletException
              super.init(config);
              // TODO: implement
         * data members
    //     add your data members here
    UploadFile.html
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <title>File Upload using EAS</title>
    </head>
    <body>
    <form method="POST" enctype="multipart/form-data" action="upload/FileUpload">
    <p><b>File Upload using EAS </b></p>
    <p>Select file to send: <input type="file" name="name" size="30"></p>
    <p>Your Name: <input type="input" name="yourname" size="20"> </p>
    <p align="left"><input type="submit" value="Send File" name="submit"></p>
    </form>
    </body>
    </html>
    You can download the oreilly files from :- (same code is also here)
    http://www.sybase.com/detail?id=1011664

    where I should write down the file path(The file in client pc....e.g. C:\Documents and Settings\abhishek.jain\Desktop\Daily Order Manual.pdf ) in code........I m getting stuck

  • Problem with File Upload using SmartUpload class.

    Hello.
    I need to get a file from client browser. I have HTML form that has mixed data, parameters and files submitted to server. I looked through the forum messages and got the, recommended by many, SmartUpload class. The problem is: when I call SmartUpload.upload() method my system hangs. It takes forever to download a file that is 20Kb. Below is the code from my source:
    SmartUpload su = new SmartUpload();
    su.initialize(getServletConfig(), req, res);
    su.upload(); <--- It stops right here forever...
    Enumeration enum = su.getRequest().getParameterNames();
    I tried the com.oreilly.servlet.multipart.MultipartParser class, also mentioned in forum messages. I used exactly the same html page to submit the same file and other parameters. It worked just fine. The only reason I need SmartUpload class is because it has getParameterValues(�) method that returns String array of values.
    Do you have any idea what is going on? If you know how to get array of values and file(s) without using SmartUpload from a html page, please help me with it.
    Thank you for any suggestions.

    I looked at MultipartRequest class before but the problems is that it saves upload file directly to disk (push technology). I need to save this file into an XML database, using InputStream, (the upload file is normally xml document or an image).

  • Problem with SOAP Attachment in MM7

    Hi, I'm developing with Bea Weblogic 7 sp2 a MM7 server. My problem is when I add an attachment to SOAP message, Weblogic can't receive the message and say something as "The ID referenced by .... is unknow" but the href attribute in SOAP Message has the same value as the Content-ID of the attachment.
    The attachment is multipart/mixed. Please, I need help.
    I add here an old post from other user about this problem.
    <i>Hi
    I need some help for a problem I have with bea 7.0 sp1 web services.
    I'm trying to develop a SOAP Message Handler to intercept a SOAP Messages.It seems
    work properly for simple soap requests.
    But I need to send attachements so my request is like:
    POST /mm7/mm7Service HTTP/1.0
    Content-Type: multipart/related; type="text/xml"; start="<2ED4C017A7C250C35409DE82D1A8E6B1>";
    boundary="----=_Part_18_90248.1076664111251"
    Accept: application/soap+xml, application/dime, multipart/related, text/*
    User-Agent: Axis/1.1
    Host: xxx.xxx.xxx.xxx
    Cache-Control: no-cache
    Pragma: no-cache
    SOAPAction: "http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2?operation=Deliver"
    Content-Length: 5177
    ------=_Part_18_90248.1076664111251
    Content-Type: text/xml; charset=UTF-8
    Content-Transfer-Encoding: binary
    Content-Id: <2ED4C017A7C250C35409DE82D1A8E6B1>
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
    <ns1:TransactionID soapenv:mustUnderstand="0" xsi:type="xsd:string" xmlns:ns1="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">E8D97EC0A80A712B5CF3C7E5A56AF121</ns1:TransactionID>
    </soapenv:Header>
    <soapenv:Body>
    <DeliverReq xmlns="http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2">
    <MM7Version>5.3.0</MM7Version>
    <LinkedID>fa571b8e93C0A809513c33d383069dfb</LinkedID>
    <Sender>
    <RFC2822Address displayOnly="false">[email protected]</RFC2822Address>
    </Sender>
    <Recipients>
    <To>
    <Number displayOnly="false">+123454678</Number>
    </To>
    <Cc>
    <RFC2822Address displayOnly="false">[email protected]</RFC2822Address>
    </Cc>
    <Bcc>
    <RFC2822Address displayOnly="false">[email protected]</RFC2822Address>
    </Bcc>
    </Recipients>
    <Priority>High</Priority>
    <Content href="cid:74935BFBD687B557CE9C25A591FEE0DA" allowAdaptations="true"/>
    </DeliverReq>
    </soapenv:Body>
    </soapenv:Envelope>
    ------=_Part_18_90248.1076664111251
    Content-Type: multipart/mixed;
    boundary="----=_Part_17_2373292.1076664111231"
    Content-Transfer-Encoding: binary
    Content-Id: <74935BFBD687B557CE9C25A591FEE0DA>
    ------=_Part_17_2373292.1076664111231
    I implemented a simple Handler with a system.out in
    public boolean handleRequest(MessageContext mc)
    method
    But weblogic never gets there. It gives me this error instead:
    javax.xml.soap.SOAPException: failed to receive message:
    at weblogic.webservice.core.DefaultWebService.invoke(DefaultWebService.java:227)
    This seems related to this line
    <Content href="cid:74935BFBD687B557CE9C25A591FEE0DA" allowAdaptations="true"/>
    If I remove it, it can reach the handleRequest() method.
    Unfortunately I need the Content parameter....
    Does weblogic support href attributes in soap ?
    many thanks to whatever help
    (I already lost 3 days on that problem.....)
    alan</i>
    Thanks.

    Hello,
    Problem 1)
    In a previous question about this in SDN, someone (sorry, can't remember who) answered:
    "Have you or the user logged into the SAP GUI before? If not, have them login in. Our problems occured
    with new users that never logged into the SAP gui and so the user profile was never loaded with the ini
    file."
    Please try that.
    Problem 2)
    Are you sure it's running with the same variant in the background?
    What if you try every 5 minutes instead - maybe a minute is too short and it gets mixed up.
    You could also try copying RSWUWFML2 to ZRSWUWFML2, inserting an infinite loop and then attaching to it in order to debug it in the background.
    regards
    Rick Bakker
    Hanabi Technology

  • JAXRPC  to handle Soap Attachment using JDeveloper

    I need to write a simple web services to handle request with image attachment. JAXRPC is good enough and I don't manipulate the attachment at a lower level. Is there a easy way to do this using JDeveloper, where shall I start with, a WSDL or a Java class? Which version of JDeveloper supports this?
    Thanks,
    Jia

    JDeveloper 10.1.3 supports JAX-RPC.
    You can start both ways - JDeveloper can generate the WSDL for a Java class that you expose as a WS, or it can generate a Java class for a given WSDL.
    See the online demos and tutorials for 10.1.3 for more info.

  • Problem figuring out annotation using Robot class

    HI
    I have made a desktop sharing tool using the robot class in java. On the server end it captures screen and on the client end i have used a jlabel to diplay it....
    Now i want to extend it to allow users to draw on screen while that is being transmitted to the client end.
    The major problem for me is i dont know how do i get the frame being transmitted as the window i create to diplay the contents being capture would come to the top and hence its contents will be captured by the robot class......
    How can i solve this????
    Thanx in advance...

    I can suggest to you a solution to "draw" on the screen, but you won't be able to see what you're drawing as you draw it.
    You'll need a seperate thread to poll the position of the mouse every 20 or so milliseconds. You can use
    java.awt.MouseInfo.getPointerInfo().getlocation();to get the location of the mouse.
    You then implement your drawing algorithms to draw on a BufferedImage of TYPE_4BYTE_ABGR or any of the other types that support transparency. Of course, the image needs to be the size of the screen. Then on every single image you stream, you draw your ABGR image ontop of the one you are about the stream. Voila.
    As I said though, you can't actually see what you're drawing. In order to see what you are drawing you need to display it in a window that scales down the images and is unobtrusive. Of course, this window in turn will be caught by the screen capture, so the clients will be able to "see" your helper window.
    On the other hand, if all you are doing is streaming images of a *single java window* (not the whole desktop) and all you need to do is draw on that single java window, then I can reccomend to you a better solution that utilizes the GlassPane for drawing. By using the the glass pane, the drawings will appear directly on the window, and you don't need a helper window to see your drawings.

  • Cannot use user classes in webservices interface of appmodule custom method

    Hi,
    I need to expose an application module's custom method that uses user defined classes as parameters and return types as a web service interface. I have not been able to do that. Below are more details.
    In particular, I have an app module that has a client interface with a custom method that takes and returns a serializable Emp object (user defined classes/objects). I need to expose this app module as a web service through the use of a service interface.
    When i run the "Create Service Interface" wizard, under service custom methods (Create Service Interface Step 2 of 4 wizard), i don't see my custom method under "Available."
    In addition, the JDev message log says: Business Components: Method "yourCustomMethod(Emp):Emp" cannot be exposed via service interface because the return type "com.mypackage.Emp" is not supported.
    From what i understand by reading the docs below, it seems that in an application module's service interface (Webservice) you only can use simple data type or java.util.list or AttributeList (which is a wrapper for any viewRow). In other words, i cannot use my user defined object in the custom method parameters and return types.
    This seems to be an artificial limitation of webservice creation through the use of app module because one can use complex/user defined objects in methods of a java class and expose them through a webservice.
    I would appreciate if of the tooling PMs can make a well thought out comment.
    11.2.3 What You May Need to Know About Method Signatures on the Service Interface
    http://docs.oracle.com/cd/E12839_01/web.1111/b31974/bcextservices.htm#CJAEHFJD
    9.8.4 What You May Need to Know About Method Signatures on the Client Interface
    http://docs.oracle.com/cd/E12839_01/web.1111/b31974/bcservices.htm#CHDFHGII
    Thanks,
    AJ
    ps: I am using Build JDEVADF_11.1.1.5.0_GENERIC_110409.0025.6013.

    Hi,
    question 2 doesn't apply as the client interface is for Java access to public methods. For the Service Interface, the document lists the supported data types you can use in arguments and return values. To expose a custom methods, what about using a POJO that accesses ADF BC (using create root application module) and then expose your POJO as a JAWS service. This will allow you to expose the data queried from ADF BC through your custom classes.
    Frank

  • How to Insert & Return a Row using a Function based on the Input parameter

    Hi Guys, Plz help me the following code i am converting from Sql Server to Oracle.
    I want equivalent code in Oracle.
    ALTER FUNCTION [dbo].[GetDateRange]
         @Period     VARCHAR(50)
    RETURNS @DateRange TABLE(StartDate     DATETIME,EndDate DATETIME,[Name] NVARCHAR(500), [Description] Nvarchar(2000) )
    AS
    IF(LTRIM(RTRIM(@Period)) = 'LQ')
    BEGIN
    ''''CALCULATION
              INSERT INTO @DateRange
                             StartDate,
                             EndDate,
    [Name],
    [description]
                   SELECT     @StartDate,@EndDate,'Last Quarter',
    'Last Quarter - '+ Cast(@StartDate as Nvarchar(11))+ ' to '+Cast(@EndDate as Nvarchar(11))
    END
         RETURN
    END
    above Function i am using in another Procedure
    select ----
    FROM     dbo.SalesFact SF ,
                   dbo.DateDimension DD,                    
                   dbo.GetDateRange('LY') GDR
         WHERE     DD.DateKeyID = SF.BillDateKeyID AND
                   DD.Date >= GDR.StartDate AND
                   DD.Date < GDR.EndDate
    Edited by: 801668 on Oct 11, 2010 10:26 PM

    hi i'm sending again the following code
    ALTER FUNCTION [dbo].[GetDateRange]
         @Period     VARCHAR(50)
    RETURNS @DateRange TABLE
    (StartDate     DATETIME,     EndDate     DATETIME,[Name] NVARCHAR(500), [Description] Nvarchar(2000) )
    AS
    BEGIN
    DECLARE @ToDay          DATETIME,
    @StartDate     DATETIME,
    @EndDate     DATETIME
    DECLARE
    @V_Getdate DATETIME
    ,@V_Getdate_2 DATETIME
    ,@V_dateA datetime
    ,@V_dateB datetime
    ,@V_dateC datetime
    ,@V_dateD Datetime
    ,@StartFirstdayofquarter datetime
    ,@EndLastdayofthequarter datetime
    ,@quater int
    ,@FirstdayofPreviousyr Datetime
    ,@LastdayofPreviousyr Datetime
    ,@FirstdayofPreviousyr6MTD Datetime
    ,@TodayDayOfWeek INT
    ,@EndOfPrevWeek DateTime
    ,@StartOfPrevWeek DateTime
    ,@V_Date_1 datetime
    ,@V_P6MV1 datetime
    ,@V_P6MV2 Datetime
    ,@StartFirstdayofquarter_1 datetime
    ,@EndLastdayofthequarter_1 datetime
    ,@i int
    ,@CurrentRowNum int
    ,@CurrentQuarter int
    ,@V_Startdate datetime
    ,@V_Startdate2 datetime
    ,@V_enddate datetime
    ,@V_Quarter int
    ,@V_rownum int
    SET @Period=LTRIM(RTRIM(@Period))
    SET @V_Getdate = (SELECT CONVERT(DATETIME,(SELECT CONVERT(VARCHAR(10),(Select LastETLDate from Parameterconfig),101))))
    --Where parameterconfig is a table
    SET @V_Getdate_2=@V_Getdate
         IF(LTRIM(RTRIM(@Period)) = 'LQ')
         BEGIN
    SET @ToDay = (SELECT CONVERT(DATETIME,CONVERT(VARCHAR(10),@V_Getdate,101) + ' 00:00:00.000'))--#Ch003
    --If Today is in between 1st January to 31st March then return
    --1st Oct of previous year as StartDate and 1st Jan of present year as EndDate
    IF((DATEPART(MM,@ToDay) = 1) OR (DATEPART(MM,@ToDay) = 2) OR (DATEPART(MM,@ToDay) = 3 ))
    BEGIN
    SET @StartDate = (SELECTCONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(YYYY,DATEADD(YYYY,-1,@ToDay))) +'-10-01 00:00:00.000'))
    SET @EndDate = (SELECTCONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(YYYY,@ToDay)) +
              '-01-01 00:00:00.000'))
         INSERT INTO @DateRange(StartDate,EndDate,[Name],[description]     )
         SELECT     @StartDate,@EndDate,'Last Quarter',
    'Last Quarter - '+ Cast(@StartDate as Nvarchar(11))+ ' to '+Cast(@EndDate as Nvarchar(11))
    END
         --If Today is in between 1st April to 30th June then return
         --1st Jan of present year as StartDate and 1st April of present year as EndDate
    IF((DATEPART(MM,@ToDay) = 4) OR (DATEPART(MM,@ToDay) = 5) OR (DATEPART(MM,@ToDay) = 6 ))
    BEGIN
    SET @StartDate = (SELECT     CONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(YYYY,@ToDay)) +
              '-01-01 00:00:00.000'))
    SET @EndDate = (SELECT     CONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(YYYY,@ToDay)) +
              '-04-01 00:00:00.000'))
         INSERT INTO @DateRange(StartDate,EndDate,[Name],[description]     )
    SELECT     @StartDate,@EndDate,'Last Quarter ',
    'Last Quarter - '+ Cast(@StartDate as Nvarchar(11))+' to '+Cast(@EndDate as Nvarchar(11))
    END
    --If Today is in between 1st July to 30th September then return
    --1st April of present year as StartDate and 1st July of present year as EndDate
    IF((DATEPART(MM,@ToDay) = 7) OR (DATEPART(MM,@ToDay) = 8) OR (DATEPART(MM,@ToDay) = 9 ))
    BEGIN
    SET @StartDate = (SELECT     CONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(YYYY,@ToDay)) +
              '-04-01 00:00:00.000'))
    SET @EndDate = (SELECT     CONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(YYYY,@ToDay)) +
              '-07-01 00:00:00.000'))
    INSERT INTO @DateRange(StartDate,EndDate,[Name],[description])
    SELECT     @StartDate,@EndDate,'Last Quarter',
    'Last Quarter - '+ Cast(@StartDate as Nvarchar(11))+' to '+Cast(@EndDate as Nvarchar(11))
    END
              --If Today is in between 1st Oct to 31St Dec then return
              --1st July of present year as StartDate and 1st Oct of present year as EndDate
    IF((DATEPART(MM,@ToDay) = 10 ) OR (DATEPART(MM,@ToDay) = 11) OR (DATEPART(MM,@ToDay) = 12 ))
    BEGIN
    SET @StartDate = (SELECT     CONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(YYYY,@ToDay)) +
              '-07-01 00:00:00.000'))
    SET @EndDate = (SELECT     CONVERT(DATETIME,CONVERT(VARCHAR(4),DATEPART(YYYY,@ToDay)) +
              '-10-01 00:00:00.000'))
    INSERT INTO @DateRange(StartDate,EndDate,[Name],[description])
    SELECT     @StartDate,@EndDate,'Last Quarter',
    'Last Quarter - '+ Cast(@StartDate as Nvarchar(11))+' to '+Cast(@EndDate as Nvarchar(11))
    END
    END
    RETURN
    END
    above function i'm using in another procedure. which acts as a virtual table. for joining purpose.

  • Return zip file as soap attachment  from server..

    Dear Friends,
    Requirement:
    I would like to download a zip file from server(tomcat) with soap attachment using wsdl.
    I have tried googling but didn't get exact information and samples on this.
    Please help me on this and it would be helpful if u can provide me one sample on this.
    Thanks in advance.
    Cheers
    Cap

    pls http://www.catb.org/~esr/faqs/smart-questions.html#writewell
    How To Ask Questions The Smart Way
    Eric Steven Raymond
    Rick Moen
    Write in clear, grammatical, correctly-spelled language
    We've found by experience that people who are careless and sloppy writers are usually also careless and sloppy at thinking and coding (often enough to bet on, anyway). Answering questions for careless and sloppy thinkers is not rewarding; we'd rather spend our time elsewhere.
    So expressing your question clearly and well is important. If you can't be bothered to do that, we can't be bothered to pay attention. Spend the extra effort to polish your language. It doesn't have to be stiff or formal - in fact, hacker culture values informal, slangy and humorous language used with precision. But it has to be precise; there has to be some indication that you're thinking and paying attention.
    Spell, punctuate, and capitalize correctly. Don't confuse "its" with "it's", "loose" with "lose", or "discrete" with "discreet". Don't TYPE IN ALL CAPS; this is read as shouting and considered rude. (All-smalls is only slightly less annoying, as it's difficult to read. Alan Cox can get away with it, but you can't.)
    More generally, if you write like a semi-literate b o o b you will very likely be ignored. So don't use instant-messaging shortcuts. Spelling "you" as "u" makes you look like a semi-literate b o o b to save two entire keystrokes.

  • SOAP Attachements in Webservices

    Hi,
    Is there any way to send SOAP attachements while accessing the weblogic Webservices,
    i.e As a part of my client program, I want to attach a document/image to a SOAP
    message.
    Thanks in advance
    pidix

    user10455639 wrote:
    Yes I can..what I still dont understand from yourr email is why are you askign this..
    "if you can get the soap header"
    Because any header we should be able to retrieve from this context...Because I saw the following statement from [JavaDoc | http://e-docs.bea.com/wls/docs103/javadocs/weblogic/wsee/jws/JwsContext.html#getInputHeaders()].
    <<<<<<<<<<
    ....The SOAP headers used by WebLogic Workshop to manage conversations are included in the list of headers returned.
    <<<<<<<<<<
    If it works, then just use it :) because it is public supported
    Edited by: LJ on Apr 23, 2009 10:04 PM
    Edited by: LJ on Apr 23, 2009 10:21 PM

  • ABAP OO Exception Class based processing

    Hi there,
    Note: In going forward with SAP WAS 6.20, one can handle exceptions using exception-class based handling using RAISE EXCEPTION TYPE abc and then CATCHing it in TRY/ ENDTRY block. Standard method like GET_TEXT can be used to get the text of the exception raised.
    Question: If I know the EXCEPTION CLASS and Exception ID of my exception class, is it possible to get the exception text directly from the repository without creating the exception class object?
    E.g. Exception class is CX_MY_SECRET_ID
    and Exception IDs for this class are
    ID_NOT_FOUND,
    ID_EXPIRED,
    ID_IS_FOR_SPECIAL_ACCESS
    E.g. last two exception IDs are my warning conditions, and if such conditions are encountered, all I want to do is collect the warning messages. Whereas first exception ID condition (i.e. ID_NOT_FOUND) is an error for me, in which I have pass the exception back to the calling program. E.g. the source code is like this:
    PERFORM.......
    If ID is not found
       RAISE EXCEPTION TYPE ZCX_MY_SECRET_ID
               EXPORTING TEXT_ID = 'ID_NOT_FOUND'.
    else if ID has expired
       ...... then do I have to first raise the exception like raised above and CATCH it before I can get its text? or can I get the exception text directly without raising the exception first (as I know i have to retrieve the text of ZCX_MY_SECRET_ID exception class for Exception ID ID_EXPIRED)?
    In other words, if a certain condition is warning for my program, can I get the condition for that exception (from exception class based on exception class name and exception ID), or do I have to RAISE it first explicitely and then CATCH it immediately and execute GET_TEXT to get its text?
    Thanks very much!

    Hello Chetan,
    in basic the raise exception type xxx creates an exception object and aborts normal execution continuing in the enclosing try block.
    The Abap runtime contains some optimizations regarding the try block has an 'into xxx' clause. But as long you use the same exception you cant take benefit from this.
    As far I understand your problem you have two different kind of severities. So I would use 2 differnt exception classes (maybe derived from a common parent type, or one from the other).
    So both the code which throws the exception and the one which catches it are aware of the different semantic.
    Kind Regards
    Klaus

Maybe you are looking for