Handling SOAP DIME attachments with Flex

Hi,
Is possible to get SOAP DIME attachments with Flex?
I'm trying to get thumbnails of pages returned in jpeg by a
WebService request that has that thumbnail as DIME attachment on
its response, but don't know how to handle it with Flex.
Thanks
Aleix

Please,
Is anybody able to answer this question?
Thank you so much.
Aleix

Similar Messages

  • DIME format for handling SOAP attachments

    Hi all,
    There is a proposal (I think by Microsoft) called the Direct Internet Message Encapsulation (DIME) format to handle SOAP attachments. This is a binary format which defines how to construct a single message with multiple payloads and it is suppose to be more efficient that MIME especially for large attachments.
    Does anybody know the status of this proposal?
    Thanks,
    Ken

    Hi, I'm also looking for a DIME java implementation,
    let me know if you find something
    maybe we will develop it ourselves

  • How to pass SOAP Attachments with JAX-RPC Web Service

    I'm confused...
    This sample shows how to send/receive SOAP attachments by using the JAX-RPC Handler mechanism. Can somebody confirm if this is the preferred way to do this. I've seen an example wich does something like:
      public interface AttachmentService extends Remote {
        public String storeDocumentService(javax.activation.DataHandler dh, String filename) throws RemoteException;
      }and then uses JAX-RPC utilities to create wsdl, stubs and stuff. Does this have the same result, as what the OTN example shows (from an architecture perspective?
    Thx,
    Jan.

    Well, how an attachment is processed depends on your application logic...if your application logic requires to processing attachments and verify it before processing the SOAP message, handlers could be better option.
    If you need to process the attachment while processing the SOAP message, you can do it in the service implementation class.
    In both the cases you need to get access to SOAPMessage object and from there get the attachments with getAttachments method.

  • Send SOAP DIME Attachment (please comment on my sample code)

    Hi All,
    I had hard time trying to find a send SOAP DIME attachment
    code for the web service. And here it is, I wrote one,
    but I use to easy way to deploy the service.
    I just simply change the extension .java to .jws,
    so, can you all tell me whether it will be a problem or not ?
    And please review my code below, I debugged and no error,
    but I am not sure if it is working right.
    Basiclly 2 operations:
    public String generateID(int artID)
    public File detachFile(String filename)
    Please comment on this code, I am trying to make it
    more robust, so, that I can redo it and post it to share with
    everybody.
    thanks,
    Derek
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Iterator;
    import java.io.*;
    import java.security.*;
    import java.security.NoSuchAlgorithmException;
    import javax.activation.DataHandler;
    import javax.activation.FileDataSource;
    import javax.xml.soap.AttachmentPart;
    import org.apache.axis.AxisFault;
    import org.apache.axis.Message;
    import org.apache.axis.MessageContext;
    import org.apache.axis.attachments.Attachments;
    import org.apache.axis.attachments.AttachmentsImpl;
    import org.apache.log4j.Logger;
    public class AttachmentYPMG
         private static final Logger _logger = Logger.getLogger(AttachmentYPMG.class);
         public AttachmentYPMG()
         public String generateID(int artID)
              String artid = Integer.toString(artID);
              String md5_hash_string = plainStringToMD5(artid);
              return md5_hash_string;
         private String plainStringToMD5(String input) {
                // Some stuff we will use later
                MessageDigest md = null;
                byte[] byteHash = null;
                StringBuffer resultString = new StringBuffer();
                // Bad things can happen here
                try {
                  // Choose between MD5 and SHA1
                       md = MessageDigest.getInstance("MD5");
                } catch(NoSuchAlgorithmException e) {
                    System.out.println("NoSuchAlgorithmException caught!");
                    System.exit( -1);
                // Reset is always good
                md.reset();
                // We really need some conversion here
               md.update(input.getBytes());
                // There goes the hash
                byteHash = md.digest();
               //  Now here comes the best part
                for(int i = 0; i < byteHash.length; i++) {
                  resultString.append(Integer.toHexString(0xFF & byteHash));
              // That's it!
              return(resultString.toString());
         public File detachFile(String filename)
              InputStream is = null;
              FileOutputStream os = null;
              File file = null;
              int totalAttachments ;
              try
                   //Get all the attachments
                   AttachmentPart[] attachments = getMessageAttachments();
                   * getMessageAttachments() as provided by Steve Loughran in his mail
                   * to axis-user group
                   * http://www.mail-archive.com/[email protected]/msg08732.html
                   //Put the logic in a loop for totalAttachments for multiple
                   // attachments.
                   totalAttachments = attachments.length;
                   _logger.debug("saveFile(String filename = " + filename + ") - " +
                                  "Total Attachments Received Are: "+ totalAttachments);
                   //Extract the first attachment. (Since in this case we have only one attachment sent)
                   DataHandler dh = attachments[0].getDataHandler();
                   //Extract the file name of the first attachment.
                   String name = filename;
                   _logger.debug("saveFile(String filename = " + filename + ") - File received on server is: " + name);
                   //Get the streams to file and from attachment, then stream to disk
                   is = dh.getInputStream();
                   file = new File(name);
                   os = new FileOutputStream(file);
                   this.writeBuffersAndClose(is, os);
              } catch (Exception e)
                   _logger.error("detachFile(String filename = " + filename + ")", e);
                   //throw new AttachmentException(e);
              //if(file!= null)
                        return file;
              //else
                   //throw new AttachmentException("The attachment was not saved");
         * extract attachments from the current request
         * @return a list of attachmentparts or an empty array for no attachments
         * support in this axis buid/runtime
         private AttachmentPart[] getMessageAttachments() throws AxisFault
              * Reusing the method implementation for AttachmentPart[]
              * getMessageAttachments() as provided by Steve Loughran in his mail to
              * axis-user group
              * http://www.mail-archive.com/[email protected]/msg08732.html
              MessageContext msgContext = MessageContext.getCurrentContext();
              Message reqMsg = msgContext.getRequestMessage();
              Attachments messageAttachments = reqMsg.getAttachmentsImpl();
              if (null == messageAttachments)
                   System.out.println("no attachment support");
                   return new AttachmentPart[0];
              int attachmentCount = messageAttachments.getAttachmentCount();
              AttachmentPart attachments[] = new AttachmentPart[attachmentCount];
              Iterator it = messageAttachments.getAttachments().iterator();
              int count = 0;
              while (it.hasNext())
                   AttachmentPart part = (AttachmentPart) it.next();
                   attachments[count++] = part;
              return attachments;
         * Simple method for writing one stream from another.
         * @param is
         * @param os
         * @throws IOException
         private void writeBuffersAndClose(InputStream is, OutputStream os)
              throws IOException
              int i = 0;
              byte [] buffer = new byte[1024];
              while (i != -1)
                   i = is.read(buffer, 0, buffer.length);
                   if(i > 0)
                        os.write(buffer, 0, buffer.length);
              is.close();
              os.close();

    Hi All,
    I had hard time trying to find a send SOAP DIME attachment
    code for the web service. And here it is, I wrote one,
    but I use to easy way to deploy the service.
    I just simply change the extension .java to .jws,
    so, can you all tell me whether it will be a problem or not ?
    And please review my code below, I debugged and no error,
    but I am not sure if it is working right.
    Basiclly 2 operations:
    public String generateID(int artID)
    public File detachFile(String filename)
    Please comment on this code, I am trying to make it
    more robust, so, that I can redo it and post it to share with
    everybody.
    thanks,
    Derek
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Iterator;
    import java.io.*;
    import java.security.*;
    import java.security.NoSuchAlgorithmException;
    import javax.activation.DataHandler;
    import javax.activation.FileDataSource;
    import javax.xml.soap.AttachmentPart;
    import org.apache.axis.AxisFault;
    import org.apache.axis.Message;
    import org.apache.axis.MessageContext;
    import org.apache.axis.attachments.Attachments;
    import org.apache.axis.attachments.AttachmentsImpl;
    import org.apache.log4j.Logger;
    public class AttachmentYPMG
         private static final Logger _logger = Logger.getLogger(AttachmentYPMG.class);
         public AttachmentYPMG()
         public String generateID(int artID)
              String artid = Integer.toString(artID);
              String md5_hash_string = plainStringToMD5(artid);
              return md5_hash_string;
         private String plainStringToMD5(String input) {
                // Some stuff we will use later
                MessageDigest md = null;
                byte[] byteHash = null;
                StringBuffer resultString = new StringBuffer();
                // Bad things can happen here
                try {
                  // Choose between MD5 and SHA1
                       md = MessageDigest.getInstance("MD5");
                } catch(NoSuchAlgorithmException e) {
                    System.out.println("NoSuchAlgorithmException caught!");
                    System.exit( -1);
                // Reset is always good
                md.reset();
                // We really need some conversion here
               md.update(input.getBytes());
                // There goes the hash
                byteHash = md.digest();
               //  Now here comes the best part
                for(int i = 0; i < byteHash.length; i++) {
                  resultString.append(Integer.toHexString(0xFF & byteHash));
              // That's it!
              return(resultString.toString());
         public File detachFile(String filename)
              InputStream is = null;
              FileOutputStream os = null;
              File file = null;
              int totalAttachments ;
              try
                   //Get all the attachments
                   AttachmentPart[] attachments = getMessageAttachments();
                   * getMessageAttachments() as provided by Steve Loughran in his mail
                   * to axis-user group
                   * http://www.mail-archive.com/[email protected]/msg08732.html
                   //Put the logic in a loop for totalAttachments for multiple
                   // attachments.
                   totalAttachments = attachments.length;
                   _logger.debug("saveFile(String filename = " + filename + ") - " +
                                  "Total Attachments Received Are: "+ totalAttachments);
                   //Extract the first attachment. (Since in this case we have only one attachment sent)
                   DataHandler dh = attachments[0].getDataHandler();
                   //Extract the file name of the first attachment.
                   String name = filename;
                   _logger.debug("saveFile(String filename = " + filename + ") - File received on server is: " + name);
                   //Get the streams to file and from attachment, then stream to disk
                   is = dh.getInputStream();
                   file = new File(name);
                   os = new FileOutputStream(file);
                   this.writeBuffersAndClose(is, os);
              } catch (Exception e)
                   _logger.error("detachFile(String filename = " + filename + ")", e);
                   //throw new AttachmentException(e);
              //if(file!= null)
                        return file;
              //else
                   //throw new AttachmentException("The attachment was not saved");
         * extract attachments from the current request
         * @return a list of attachmentparts or an empty array for no attachments
         * support in this axis buid/runtime
         private AttachmentPart[] getMessageAttachments() throws AxisFault
              * Reusing the method implementation for AttachmentPart[]
              * getMessageAttachments() as provided by Steve Loughran in his mail to
              * axis-user group
              * http://www.mail-archive.com/[email protected]/msg08732.html
              MessageContext msgContext = MessageContext.getCurrentContext();
              Message reqMsg = msgContext.getRequestMessage();
              Attachments messageAttachments = reqMsg.getAttachmentsImpl();
              if (null == messageAttachments)
                   System.out.println("no attachment support");
                   return new AttachmentPart[0];
              int attachmentCount = messageAttachments.getAttachmentCount();
              AttachmentPart attachments[] = new AttachmentPart[attachmentCount];
              Iterator it = messageAttachments.getAttachments().iterator();
              int count = 0;
              while (it.hasNext())
                   AttachmentPart part = (AttachmentPart) it.next();
                   attachments[count++] = part;
              return attachments;
         * Simple method for writing one stream from another.
         * @param is
         * @param os
         * @throws IOException
         private void writeBuffersAndClose(InputStream is, OutputStream os)
              throws IOException
              int i = 0;
              byte [] buffer = new byte[1024];
              while (i != -1)
                   i = is.read(buffer, 0, buffer.length);
                   if(i > 0)
                        os.write(buffer, 0, buffer.length);
              is.close();
              os.close();

  • AIR application with Flex 4.5 will not render content. What gives?

    OK,
    So I've upgraded to Flash Builder 4.5 Premium and I am unable to develop desktop AIR applications with the 4.5 Flex SDK. I start by simply creating a brand new AIR application using the default SDK (Flex 4.5). I set the title property on WindowedApplication and include a simple Label component. The project compiles fine but when I run the application all I see is the adl window in the dock but that's it. If I modify the Main-app.xml file to set the visible attribute to true, I will get a small window but there is no content although the output window shows the application swf being loaded. Checking the release version of the Main-app.xml file shows the correct path location to the swf.
    Here is what I've tried so far:
    Install/reinstall Flash Builder, 4+ times
    Downloaded the trial installation twice
    Downloaded the SDK's for 3.6, 4.1 and 4.5.0. I then copied each SDK folder and merged the AIR 2.6 SDK with each copy. So now I have 6 SDK versions; one pristine and the other with the AIR 2.6 SDK merged. I then added each SDK individually and created an AIR desktop application for each. Each and every one works fine with the exception of the two 4.5 SDK's. They will not render content.
    I created a simple creation complete handler for the application that declares a simple variable and assigns a value to it. I then put a break point on the assignment and it never gets caught. More evidence that the swf isn't getting loaded.
    The computer I'm running on is a Mac Book Pro with Snow Leopard 10.6.7. If I create a web project in each of the 6 SDK's, those will work just fine. What the heck is it with Flex 4.5 and the AIR 2.6 SDK on this machine? I have the AIR 2.6 runtime installed as well as a number of AIR applications that work just fine. I also tried my 4.5 test on my windows machine and that worked like a champ.
    I am completely out of ideas. Finding information has been difficult because everyone is all about mobile so searching for desktop issues is a losing battle. I realize this is a long email but I'm desperate for help. There must be someone out there that knows more about the low level interaction between Flex 4.5/AIR 2.6 and the OS.

    Well, I finally found the issue, a corrupted mm.cfg file in /Library/Application Support/Macromedia. I deleted the file and then adl ran just fine.

  • Handling SOAP faults

    hello,
    I created a java control which calls an external webservice. How do you handle
    SOAP fault messages coming back from the webservice?
    Weblogic just throws an java.lang.reflect.UndeclaredThrowableException since it
    cannot parse the expected XML message.
    For example, when I call Logon() via the java control. The WebService should
    reply with a LogonResult object(in xml format). However, if there's an error,
    the WebService returns a SOAP Fault message. Since this fault message is not
    in the format of the expected LogonResult xml schema, weblogic throws an error
    (since it cannot create the LogonResult object) and the caller just receives the
    UndeclaredThrowableException without knowing any of the contents within the SOAP
    Fault.
    I'd like to be able to send back the SOAP fault content back to the calling function.
    I've tried throwing an exception from the java control handler, but it gets swallowed
    up by the SOAP Handler so I still get an exception with no content.
    any info is appreciated.
    thanks,
    Tom

    Hi,
    Do you get answer for that?
    I had similar problem and solved this in this way:
    In this java.lang.reflect.UndeclaredThrowableException handler is possible to get also SoapFault back:
    catch (java.lang.reflect.UndeclaredThrowableException e){
    RemoteException re = (RemoteException).getUndeclaredThrowable();
    ServiceControlException sfe = (ServiceControlException)re.getCause();
    SoapFault fault = sfe.getSoapFault();
    XmlObject[] objs = fault.getDetailContents();
    // more procssing here to get Soap detailed error
    Maybe this helps.
    rgrds,
    H

  • Attachments with Webservices -  weblogic 9.2

    Is there a standard stack available for sending attachments with SOAP ? I guess SAAJ 1.2 is partially supported by weblogic. But does this require any changes to WSDL ? SWA and SAW ref implementations as indicated in the JAX-RPC specification is resulting in errors during web service generation from WSDL
    I would like to attach a WAV file to the SOAP request and invoke the web service. I would like to know the best possible way to acheive this in the 9.2 platform. Also let me know whether the service packs have resolved certain issues in this area

    Try using a tool like tcpmon to see the actually HTTP headers and content between IE and WebLogic:
    https://tcpmon.dev.java.net/
    That might give you some clues whether there is something unique in the IE6 request or response.

  • How to deal with Flex Exceptions ??

    Hi ,
    I know how to handle an Exception when dealing with Flex with server side that is , when an Exception comes from the server side (java) i can easily handle that on the fault event with the help of ErrorMessage .
    But can anybody please let me know how to handle an Exception when it comes on to the ActionScript and show it to the User .
    For instance , i have seen a half example like this :
    try
    catch(error:EOFError)
    MyTextFiled.text = error.toString();
    Now please let me know how can i show this to the End User ??
    And i can only see Errors in ActionScript , is there anything like Exceptions on to Flex??
    Thanks in advance .

    you can use any one of following
    mx.controls.Alert.show(
    "Error:"+e.message.toString())mx.controls.Alert.show(
    "Error:"+e.toString());

  • How to handle soap responses

    I am following this tutorial to handle SOAP responses but it does not work http://livedocs.adobe.com/flex/3/html/help.html?content=data_access_6.html
    using code blew I am trying to parse the following soap response.
        <?xml version="1.0" encoding="utf-8"?>
        <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                         xmlns:s="library://ns.adobe.com/flex/spark"
                                         xmlns:mx="library://ns.adobe.com/flex/mx"
                                         xmlns:components="components.*"
                                         xmlns:hellos="services.hellos.*"
                                         height="957"  creationComplete="initApp()" >
                  <fx:Style source="Styles.css"/>
                  <fx:Script>
                            <![CDATA[
                                      import mx.controls.Alert;
                                      private namespace invesbot = "http://Services.com";
                                      use namespace invesbot;
                                      private namespace a = "http://schemas.xmlsoap.org/soap/envelope/";
                                      private namespace b = "http://www.w3.org/2001/XMLSchema";
                                      private namespace c = "http://www.w3.org/2001/XMLSchema-instance";
                                      use namespace a;
                                      use namespace b;
                                      use namespace c;
                                      [Bindable]
                                      var _result:*
                                      private function initApp():void
                                                myService.mycustomers();
                            ]]>
                  </fx:Script>
                  <fx:Declarations>
                            <mx:WebService id="myService" wsdl="http://localhost:8081/WebServiceTest/services/Hellos?wsdl"
                                                             showBusyCursor="true"
                                                             fault="Alert.show(event.fault.faultString), 'Error'">
                                      <mx:operation name="mycustomers" resultFormat="e4x">
                                                <mx:request>
                                                </mx:request>
                                      </mx:operation>
                            </mx:WebService>
                  </fx:Declarations>
        <mx:HBox>
                            <mx:Text
                                      text="{myService.mycustomers.lastResult.mycustomersReturn.name}"
                                      />
                  </mx:HBox>
        </s:Application>
    The SOAP response is as following
        <?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:Body>
            <mycustomersResponse xmlns="http://Services.com">
              <mycustomersReturn>
                <age>28</age>
                <name>John</name>
              </mycustomersReturn>
              <mycustomersReturn>
                <age>29</age>
                <name>Alex</name>
              </mycustomersReturn>
              <mycustomersReturn>
                <age>30</age>
                <name>Jack</name>
              </mycustomersReturn>
            </mycustomersResponse>
          </soapenv:Body>
        </soapenv:Envelope>
    Using the above code the output will be
        <name xmlns="http://Services.com" 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">John</name>
        <name xmlns="http://Services.com" 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">Alex</name>
        <name xmlns="http://Services.com" 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">Jack</name>
    but when I use the following code to put the result in dropdown box it gives the following error
        <s:FormItem label="Employee:">
                            <s:DropDownList id="dropDownList3"
                                                                    labelField="name"
                                                                    dataProvider ="{myService.mycustomers.lastResult.mycustomersReturn}"/>
                  </s:FormItem>
    TypeError: Error #1034: Type Coercion failed: cannot convert XMLList@106e9af1 to mx.collections.IList.

    Hi Ashish,
    You can use Catch All error handler within scope of InvokeService action. By specifying SOAP Fault variable name there, response soap fault will be populated in variable.
    In 11g(As per observation), split joins are strict towards definition of input and output message based on WSDL of target service which causes exception for invalidMessage in InvokeService action.
    Hope this helps.

  • SOAP Mime Attachments

    I'm new to web services.. before actually getting my hands dirty.. I need to figure out some things before deciding i will undertake a project..
    I'm thinking of an asynchronous setup..were clients submit batches of data to a web method...clients will poll the service for a response
    (see pattern 3 > http://www.ibm.com/developerworks/library/ws-asynch2/index.html)
    This system must use web standards.. as more then 1 organisation will participate
    this will be a mixed environment - some clients will submit data on the fly, others will send batches
    Each entry in the batch will have 2 images of 3k each ...it seems that the problem is with memory allocation rather than the network performance.
    I'm estimating 500 records per batch.. so a typical payload would come up to 3mb
    Does using SOAP MIME attachments resolve this issue? from what i understood.. this avoids having the images loaded memory as part of the DOM tree..
    would this setup even work??

    Hi I'm in the same boat... can we get some help?
    Thanks

  • IExpense - Could not get handle to the Attachments VO

    Friends, I am stuck, so thought to get your help.
    On iExpense Final Review Page "FinalReviewPG" Submitt button, We have a requirement to throw the exception to user if he/she does not attach the Receipts Attachments with some specific Attachment Categories. In order to acheive this I need to get Handle to the Attachments VO but I could not as It throws the Java Exception error upon getting handle to the Attachments VO even though i added few atatchments and they showup on screen. Below is the portion of the problematic code and after that the full code. Thanks for your help.
    //below is the problmeatic code
    OAApplicationModule RootAM = oapagecontext.getRootApplicationModule();
    //OAApplicationModule AttachAM = (OAApplicationModule)RootAM.findApplicationModule("OAAttachmentsAM");//doesnt work
    //OAApplicationModule AttachAM = (OAApplicationModule)RootAM.findApplicationModule("oracle_apps_fnd_server_OAAttachmentsAM");//get the AM handle but null VOs
    OAAttachmentsAMImpl AttachAM = (OAAttachmentsAMImpl)RootAM.findApplicationModule("oracle_apps_fnd_server_OAAttachmentsAM");//throws me java null pointer exception
    FndAttachedDocumentsDomExtensionVORowImpl AttachRow =
    (FndAttachedDocumentsDomExtensionVORowImpl)AttachAM.getFndAttachedDocumentsDomExtensionVO().getCurrentRow();
    String strCategory = AttachRow.getAttachmentCategoryName();
    oapagecontext.writeDiagnostics("tc.oracle.apps.ap.oie.webui.TCFinalReviewPageCO",
    "IM90978: 14-Feb-2013 14:32 strCategory = "+ strCategory, 2);
    //below is my full code
    package tc.oracle.apps.ap.oie.entry.summary.webui;
    import oracle.apps.ap.oie.entry.summary.webui.FinalReviewPageCO;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageAttachmentLinkBean;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.ap.oie.server.WebExpensesAMImpl;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageAttachmentLinkBean;
    import oracle.apps.fnd.framework.webui.beans.message.OAMessageInlineAttachmentBean;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.ap.oie.server.ExpenseReportHeadersVORowImpl;
    import oracle.apps.ap.oie.server.WebExpensesAMImpl;
    import oracle.apps.fnd.framework.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.beans.layout.OAAttachmentTableBean;
    import oracle.apps.fnd.server.FndAttachedDocumentsDomExtensionVORowImpl;
    import oracle.apps.fnd.server.FndAttachedDocumentsVORowImpl;
    import oracle.apps.fnd.server.*;
    import oracle.apps.fnd.server.OAAttachmentsService;
    import oracle.apps.fnd.server.OAAttachmentsAMImpl;
    import oracle.apps.fnd.framework.*;
    import oracle.apps.fnd.framework.OAViewObject;
    import oracle.apps.fnd.framework.OARow;
    public class TCFinalReviewPageCO extends FinalReviewPageCO
    public void processRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processRequest(oapagecontext, oawebbean);
    public void processFormData(OAPageContext oapagecontext, OAWebBean oawebbean)
    super.processFormData(oapagecontext, oawebbean);
    public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
    String s = oapagecontext.getParameter("OIESubmit");
    if (s != null)
    OAMessageStyledTextBean oamessagestyledtextbean = (OAMessageStyledTextBean)oawebbean.findChildRecursive("ReceiptRequired");
    String strReceiptRequired = oamessagestyledtextbean.getText(oapagecontext);
    WebExpensesAMImpl am =
    (WebExpensesAMImpl)oapagecontext.getRootApplicationModule();
    ExpenseReportHeadersVORowImpl row =
    (ExpenseReportHeadersVORowImpl)am.getExpenseReportHeadersVO().getCurrentRow();
    String isPaperLessClaim = row.getAttribute5();
    OAApplicationModule RootAM = oapagecontext.getRootApplicationModule();
    //OAApplicationModule AttachAM = (OAApplicationModule)RootAM.findApplicationModule("OAAttachmentsAM");//doesnt work
    //OAApplicationModule AttachAM = (OAApplicationModule)RootAM.findApplicationModule("oracle_apps_fnd_server_OAAttachmentsAM");//get the AM handle but null VOs
    OAAttachmentsAMImpl AttachAM = (OAAttachmentsAMImpl)RootAM.findApplicationModule("oracle_apps_fnd_server_OAAttachmentsAM"); // I get error right here :(
    FndAttachedDocumentsDomExtensionVORowImpl AttachRow =
    (FndAttachedDocumentsDomExtensionVORowImpl)AttachAM.getFndAttachedDocumentsDomExtensionVO().getCurrentRow();
    String strCategory = AttachRow.getAttachmentCategoryName();
    oapagecontext.writeDiagnostics("tc.oracle.apps.ap.oie.webui.TCFinalReviewPageCO",
    "IM90978: 14-Feb-2013 14:32 strCategory = "+ strCategory, 2);
    if ("Required".equals(strReceiptRequired) && "Y".equals(isPaperLessClaim))
    // Receipt is required, check for required attachment
    oapagecontext.writeDiagnostics("tc.oracle.apps.ap.oie.webui.TCFinalReviewPageCO",
    "IM90978: 14-Feb-2013 14:32 both conditions met = ", 2);
    OAMessageAttachmentLinkBean oamessageattachmentlinkbean = (OAMessageAttachmentLinkBean)oawebbean.findChildRecursive("ReviewGenInfoHeaderAttachments");
    String strAttachment = (String)oamessageattachmentlinkbean.getAttributeValue(oapagecontext.getRenderingContext(), TEXT_ATTR);
    if("None".equals(strAttachment.trim()))
    oapagecontext.writeDiagnostics("tc.oracle.apps.ap.oie.webui.TCFinalReviewPageCO",
    "IM90978: 14-Feb-2013 14:32 before exception = ", 2);
    throw new OAException("XXTFA", "XXTFA_ATTACH_RECEIPT");
    else
    super.processFormRequest(oapagecontext, oawebbean);
    else
    super.processFormRequest(oapagecontext, oawebbean);
    else
    super.processFormRequest(oapagecontext, oawebbean);
    }

    Hi,
    Check and see the below code works or not, see which option suits for you,
    1) Check any attachment is there or not
    ======================================
    public boolean checkAttachment(OAPageContext oapagecontext,OAWebBean oawebbean)
    OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
    String amName = "";
    String objectivesAMName = "OAAttachmentsAM";
    String objectiveVOName = "FndAttachedDocumentsDomExtensionVO";
    String nestedAMArray[] = am.getApplicationModuleNames();
    oapagecontext.writeDiagnostics(this,"Root AM=>"+am.getName() + " Child AMs=>"+ nestedAMArray.length,1);
    OAApplicationModule currentAM = null;
    OAViewObject vo = null;
    boolean isAttachmentFound = false;
    currentAM = am;
    for(int i = 0; i < nestedAMArray.length; i++)
    amName = nestedAMArray;
    oapagecontext.writeDiagnostics(this,"Nested AM Name=>"+amName + "and amName.indexOf(objectivesAMName) "+amName.indexOf(objectivesAMName),1);
    currentAM = (OAApplicationModule)am.findApplicationModule(amName);
    //Get the view names
    oapagecontext.writeDiagnostics(this,"Nested AM Value "+currentAM.getName(),1);
    if(!(amName.indexOf(objectivesAMName)==-1))
    String[] viewNames = currentAM.getViewObjectNames();
    for (int j =0 ;j<viewNames.length ;j++ )
    if(viewNames[j].indexOf(objectiveVOName) > 0){
    vo = (OAViewObject)currentAM.findViewObject(viewNames[j]);
    if(vo!=null && vo.getFetchedRowCount() > 0){
    oapagecontext.writeDiagnostics(this,"View object name "+viewNames[j]+" Row Count"+vo.getFetchedRowCount(),1);
    isAttachmentFound = true;
    break;
    oapagecontext.writeDiagnostics(this,"Found Handle to My Nested AM " + amName ,1);
    return isAttachmentFound;
    2) Check the attachment count when the auto commit is false:
    public boolean checkAttachment(OAPageContext oapagecontext,OAWebBean oawebbean){
    OAApplicationModule am = oapagecontext.getApplicationModule(oawebbean);
    String amName = "";
    String objectivesAMName = "OAAttachmentsAM";
    String objectiveVOName = "FndAttachedDocumentsDomExtensionVO";
    String nestedAMArray[] = am.getApplicationModuleNames();
    oapagecontext.writeDiagnostics(this,"Root AM=>"+am.getName() + " Child AMs=>"+ nestedAMArray.length,1);
    OAApplicationModule currentAM = null;
    OAViewObject vo = null;
    boolean isAttachmentFound = false;
    currentAM = am;
    for(int i = 0; i < nestedAMArray.length; i++)
    amName = nestedAMArray[i];
    oapagecontext.writeDiagnostics(this,"Nested AM Name=>"+amName + "and amName.indexOf(objectivesAMName) "+amName.indexOf(objectivesAMName),1);
    currentAM = (OAApplicationModule)am.findApplicationModule(amName);
    //Get the view names
    oapagecontext.writeDiagnostics(this,"Nested AM Value "+currentAM.getName(),1);
    if(!(amName.indexOf(objectivesAMName)==-1))
    String[] viewNames = currentAM.getViewObjectNames();
    for (int j =0 ;j<viewNames.length ;j++ )
    if(viewNames[j].indexOf(objectiveVOName) > 0){
    vo = (OAViewObject)currentAM.findViewObject(viewNames[j]);
    if(vo!=null && vo.getFetchedRowCount() > 0){
    oapagecontext.writeDiagnostics(this,"View object name "+viewNames[j]+" Row ount"+vo.getFetchedRowCount(),1);
    isAttachmentFound = true;
    break;
    oapagecontext.writeDiagnostics(this,"Found Handle to My Nested AM " + amName ,1);
    return isAttachmentFound;
    With regards,
    Kali.
    OSSi.

  • Integratio of OPM with Flex

    How can I integrate My oracle policy modelling project or rules with Flex Application.We r Trying to make similar type of project which has been given under OPM Example (Social Sevices) but in Adobe Flex.
    Till now i have written rules in oracle policy modelling then through policy modellinhg only i generated web services and trying to call in flex.
    But still i am not clear with how this can be achieved,which operation can be usefull for me for sending response from flex to oracle rule engine.
    Can you explain me the process step by step nd guide me for this project.
    Is my Approach is correct?
    It would be great Help if you clear my doubts regarding integration of OPM with Flex.

    There are two ways of accessing the engine.
    The first way is accessing the engine through the Java or .NET API. In order to do this Flex will need to be able to make direct calls to Java or .NET.
    The second way is through the Determinations Server Web Service. The Determinations Server is specifically designed to provide a coarse grained access to the Rule engine, through SOAP/XML over HTTP. The Assess service provide a stateless way of making determinations (ie - data in --> answer out). The Interview service provides a way of creating a more stateful experience (ie, create a session, add/modify data, get screens to answer questions)
    If Flex can call Java or .NET APIs directly then, you can use the engine API, otherwise you will have to run the determinations server as a remote web application and access, the engine through the Assess or Interview service.
    It looks like Flex definitely has support for calling web services, which would suggest that the Determiantions Server approach would work. A quick google for Flex, Java and .NET looks like access to Java and .NET is always done through web services.

  • Handle SOAP req within JAVA APP.

    Hi expert,
    My self Preet, I have to built JAVA Application to handling charging over SOAP protocol.
    I have XML format, where 4-5 parameters and dynamically change and some are static.
    As now, I am using JAVA API, which calls URL (made in DOT net) with dynamic parameters code of DOT net made XML format and post this to operator and respond that status to my JAVA API.
    But I want to remove the dependency of that DOT NET's code so pls help me to making JAVA API to handle SOAP req and there response too.
    Regards,
    Preet
    91-98033-33356

    Unless you work for a Big company no one will know and
    Sun definitely will not care. I've spoken will reps at Sun about this. Gulp!
    White collar crime, including time theft, probably exceeds all other crime, at least in the US. And at least in some circumstances some employees are lead to believe by other individuals that such practices are SOP. However, even if directly order to take such action by a boss it certainly doesn't free you from criminal prosecution and at best only allows for a defense in a civil proceding.
    Professionally I won't allow nor condone practices that break criminal or civil precendents.
    Personally I refuse to follow orders or suggestions that break criminal or civil precendents. Nor will I allows others to do so in my presence. Doing so opens me up to prosecution. I certainly would never do that for a job.
    Delivering the jdk to a customer is simply a matter of convenience. At the very least doing that exposes one personally to firing for cause. After all if your boss doesn't specifically order you (in writing) to do this who do you think will get the blame? In addition all parties involved, your current employer, the customer and Sun could potentially try to sue you. Even if you win, the legal costs would be staggering. How much money are you willing to spend for convenience?
    If you are so sure about the word of the 'reps' then I would suggest that you get one of them to put it in writing (not email.) Even better get more than one.
    If you want a customer to use this then simply have the customer download the jdk. And actually I expect that the legalities would probably be fulfilled if you were acting as an agent for the customer (but that status depends on the contract with the customer.) You do have to download it for them though (not as yourself.)

  • How can I create an executable with Flex Builder 3?

    I'm working with Flex Builder 3 right now and I've run my
    head into a brick wall. Here's the situation:
    I'm creating a standalone application (runs in its own
    window, not in a web page) and I want to run it on a computer that
    does not have Flex Builder 3 installed. Help files and web searches
    haven't directed me to the right answer, so I was hoping that
    someone on this forum could help. Anyone know how to create a .exe
    file or something else that can be run outside of Flex Builder?
    Thanks a lot for any help!

    quote:
    Originally posted by:
    rob_parkhill
    Convert it to an AIR Application?
    Thanks Rob,
    This may be what I'm looking for, but I don't know enough
    about the difference. I guess I should have pointed out that I'm a
    complete Flex Novice!
    Anyway, with Flex Builder, I created an MXML Application. I
    went through all my various options again in Flex Builder and found
    that under the project menu, I could export a release build in what
    appears to be the format you mentioned. I managed to create a .air
    file, but it is not a recognized file type on my computer. I tried
    double clicking it and the built-in windows services couldn't even
    find a possible way to run it. Am I missing some important step?
    Thanks again.

  • Animated GIF with Flex

    Hi all,
         I designed a animated GIF image by Photoshop. And now, I want to add it into my web application. I referenced from
    http://www.bytearray.org/?p=95
    http://iamjosh.wordpress.com/2009/02/03/animated-gifs-in-flex/
         Have I must to download the AS3 GIF Player Class to use my animated gif with flex ?? Has Flex 3.0 support animated gif that I not need download that libriary ?
    Thanks !

    Anybody help !!

Maybe you are looking for