How to reterive payload of a process when instance is created using soa....

Hi gurus,
I've raised couple of SRs with Oracle and did not got appropriate response. So I think there are a lot of g8 minds also working here.
Requirement:
I need to reterive the payload in the xml format and store in a db table for certain process.
Steps followed:
Created a soa process which accepts the InstanceId and ECID as input and provides them to a java class using Java embed activity. The class that accepts that input and connect to getCompositeInstances() using a locator class. In this process it will make use of another two classes to convert the instance payload to dom and then to display. The mainclass uses the XMLUtil and XPathUtils classes for this requirement.
When I ran the three classes then I'm able to get the payload, but when called using the Javaembed I'm running into trouble. I'm getting a null value, not even any exception. I tried removing the catch in all the classes but no luck. Please find the below code in the Java embed and the java classes also.
Code in Java Embed:
try
setCompositeInstanceTitle("Composite HelloWorld123");
String ecid =(String) getVariableData("Input_java_ecid");
String compInstanceId =(String) getVariableData("Input_Java_instanceid");
addAuditTrailEntry("Payload_ecid is: " + ecid);
addAuditTrailEntry("Payload_insta is: " + compInstanceId);
Blob2String.MainClass mc = new Blob2String.MainClass();
String inputPayload = mc.getCompositeInstancePayload(compInstanceId, ecid);
if(inputPayload == null)
addAuditTrailEntry("inputPayload is*********"inputPayload".........");
InsertIntoDB ir = new InsertIntoDB();
ir.InsertMethod1(inputPayload,compInstanceId,ecid) ;
/*//addAuditTrailEntry("Payload is: " + inputPayload);
String StringPayload =(String)inputPayload;
addAuditTrailEntry("StringPayload is: " + StringPayload);
setVariableData("Java_Payload", StringPayload); */
catch(Exception e)
addAuditTrailEntry("Exception is: " + e);
e.printStackTrace();
Code in MainClass:
package Blob2String;
import java.util.*;
import javax.naming.Context;
import oracle.soa.management.facade.ComponentInstance;
import oracle.soa.management.facade.CompositeInstance;
import oracle.soa.management.facade.Locator;
import oracle.soa.management.facade.LocatorFactory;
import org.w3c.dom.*;
import oracle.soa.management.util.*;
import oracle.fabric.common.*;
import oracle.fabric.logging.*;
import oracle.fabric.logging.BaseMessageBundle;
public class MainClass {
/* public MainClass() {
super();
public String getCompositeInstancePayload(String compInstanceId,String ecid)
String compositeName="GetOpenCompositeInstances";
Hashtable jndiProps = new Hashtable();
String inputPayload="";
try
jndiProps.put(Context.PROVIDER_URL,"t3://abc.xyz.com:9102/soa-infra");
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
jndiProps.put(Context.SECURITY_PRINCIPAL,"weblogic");
jndiProps.put(Context.SECURITY_CREDENTIALS,"welcome123");
jndiProps.put("dedicated.connection","true");
Locator locator = LocatorFactory.createLocator(jndiProps);
CompositeInstanceFilter filter = new CompositeInstanceFilter();
filter.setECID(ecid);//Set the composite ECID
filter.setId(compInstanceId);//Set the composite instance id
List<CompositeInstance> compositeInstance = locator.getCompositeInstances(filter);
ComponentInstanceFilter instanceFilter = new ComponentInstanceFilter();
instanceFilter.setCompositeInstanceId (compInstanceId); //Set the composite instance id
List<ComponentInstance> componentInstance = compositeInstance.get(0).getChildComponentInstances(instanceFilter);
if (compositeInstance.size() > 0) {
Document docAudit = XMLUtil.convertToDOM(componentInstance.get(0).getAuditTrail().toString());
String payloadAudit = XPathUtils.executeXPath(docAudit, "//details").toString();
Document docPayload = XMLUtil.convertToDOM(payloadAudit);
Node payloadNode = XPathUtils.executeXPath(docPayload, "//part//*", "NODE");
inputPayload = XMLUtil.nodeToString(payloadNode);
//System.out.println(inputPayload);
catch(Exception e){
// e.printStackTrace();
System.out.println(e);
return inputPayload;
public static void main(String[] args){
MainClass Obj = new MainClass();
String result=Obj.getCompositeInstancePayload("60004" , "d90df5a0fd2bc5c7:4d37316b:13da0ebcf67:-8000-00000000000003ca") ;
//String result=Obj.getCompositeInstancePayload("16952862" , "ef14bd96767c0e08:-152cfeeb:13d2379cff3:-8000-000000000008c968") ;
// System.out.println(result);
Code in XMLUtil:
package Blob2String;
import org.xml.sax.InputSource;
import java.io.*;
import javax.xml.parsers.*;
import javax.xml.transform.*;
import javax.xml.transform.*;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.*;
import org.xml.sax.InputSource;
import oracle.fabric.logging.*;
public class XMLUtil {
* @param inputXML
* @return
* @throws Exception
public static Document convertToDOM(String inputXML) throws Exception {
Document dom = null;
try {
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
//DocumentBuilder builder = new org.apache.xerces.jaxp.DocumentBuilderFactoryImpl().newDocumentBuilder();
InputSource is = new InputSource(new StringReader(inputXML));
dom = builder.parse(is);
} catch (Exception ex) {
throw ex;
return dom;
public static String nodeToString(Node node) throws Exception{
StringWriter sw = new StringWriter();
try {
Transformer t = new org.apache.xalan.processor.TransformerFactoryImpl().newTransformer();
t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
t.setOutputProperty(OutputKeys.INDENT, "yes");
t.transform(new DOMSource(node), new StreamResult(sw));
} catch (TransformerException te) {
System.out.println("nodeToString Transformer Exception");
throw te;
return sw.toString();
Code in XPathUtils :
package Blob2String;
import javax.xml.xpath.*;
import org.w3c.dom.*;
import oracle.fabric.logging.*;
public class XPathUtils {
public static Object executeXPath(Document doc, String xpathStr) throws Exception{
XPath xpath = null;
String value = null;
try {
XPathFactory factory = XPathFactory.newInstance();
XPath xpath1= factory.newXPath();
//xpath = new org.apache.xpath.jaxp.XPathFactoryImpl().newXPath();
XPathExpression expr = xpath1.compile(xpathStr);
value = (String)expr.evaluate(doc, XPathConstants.STRING);
return value;
} catch (Exception e) {
throw e;
public static Node executeXPath(Document doc, String xpathStr,String type) throws Exception{
XPath xpath = null;
Node value = null;
try {
xpath = new org.apache.xpath.jaxp.XPathFactoryImpl().newXPath();
XPathExpression expr = xpath.compile(xpathStr);
value = (Node)expr.evaluate(doc, XPathConstants.NODE);
return value;
} catch (Exception e) {
throw e;
Its an urgent issue and I have the deadline to get on with. I've raised SR with oracle but there was no use. Kindly help me. Help will be greatly appreciated.
Thanks,
Venkatesh.

Hi Venkatesh,
Just a way to debug.....can you use soa logger to debug your java MainClass() flow..
You can view log messages in
$ORACLE_HOME\user_projects\domains\soa_domain\servers\$soa_server\logs\$soa_server-diagnostic.log
Update your MainClass(to include log messages) as below..i believe it's going to exception block.
package Blob2String;
import java.util.*;
import javax.naming.Context;
import oracle.soa.management.facade.ComponentInstance;
import oracle.soa.management.facade.CompositeInstance;
import oracle.soa.management.facade.Locator;
import oracle.soa.management.facade.LocatorFactory;
import org.w3c.dom.*;
import oracle.soa.management.util.*;
import oracle.fabric.common.*;
import oracle.fabric.logging.*;
import oracle.fabric.logging.BaseMessageBundle;
import java.util.logging.Level;
import java.util.logging.Logger;
import oracle.fabric.logging.LogFormatter;
public class MainClass {
/* public MainClass() {
super();
public String getCompositeInstancePayload(String compInstanceId,String ecid)
Logger logger = Logger.getLogger("oracle.soa.Logger");
LogFormatter.configFormatter(logger);
logger.log(Level.INFO, "Testing... getComposite log message");
String compositeName="GetOpenCompositeInstances";
Hashtable jndiProps = new Hashtable();
String inputPayload="";
try
logger.log(Level.INFO,"Inside Try block");
jndiProps.put(Context.PROVIDER_URL,"t3://abc.xyz.com:9102/soa-infra");
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
jndiProps.put(Context.SECURITY_PRINCIPAL,"weblogic");
jndiProps.put(Context.SECURITY_CREDENTIALS,"welcome123");
jndiProps.put("dedicated.connection","true");
logger.log(Level.INFO,"Initializing locator");
Locator locator = LocatorFactory.createLocator(jndiProps);
logger.log(Level.INFO,"Locator Initailized");
CompositeInstanceFilter filter = new CompositeInstanceFilter();
filter.setECID(ecid);//Set the composite ECID
filter.setId(compInstanceId);//Set the composite instance id
logger.log(Level.INFO,"CompositeInstanceFilter initialized");
List<CompositeInstance> compositeInstance = locator.getCompositeInstances(filter);
ComponentInstanceFilter instanceFilter = new ComponentInstanceFilter();
instanceFilter.setCompositeInstanceId (compInstanceId); //Set the composite instance id
List<ComponentInstance> componentInstance = compositeInstance.get(0).getChildComponentInstances(instanceFilter);
logger.log(Level.INFO,"compositeInstance.size");
logger.log(Level.INFO,Integer.toString(compositeInstance.size()) );
if (compositeInstance.size() > 0) {
Document docAudit = XMLUtil.convertToDOM(componentInstance.get(0).getAuditTrail().toString());
String payloadAudit = XPathUtils.executeXPath(docAudit, "//details").toString();
Document docPayload = XMLUtil.convertToDOM(payloadAudit);
Node payloadNode = XPathUtils.executeXPath(docPayload, "//part//*", "NODE");
inputPayload = XMLUtil.nodeToString(payloadNode);
//System.out.println(inputPayload);
logger.log(Level.INFO,"Displaying payload");
logger.log(Level.INFO,inputPayload);
catch(Exception e){
// e.printStackTrace();
System.out.println(e);
logger.log(Level.INFO,"Inside Exception");
logger.log(Level.INFO,e.toString());
logger.log(Level.INFO,"Returniing payload");
logger.log(Level.INFO,inputPayload);
return inputPayload;
Thanks,
Faiz

Similar Messages

  • How do I stop the login process when I open iTunes?

    How do I stop the login process when I open iTunes? It often request I login sometimes twice.

    I amhaving the same issue of having to log into  my apple account wheever I open I-Tunes. In my iTunes sharing my password requirment is unchecked and in filevault it is unchecked also. I have just upgraded to the newest version of iTunes and I still get the pop-up window asking me to login.
    Any other thoughts?
    thank you

  • I have the new 2011 macbook pro, with lion preinstalled. I want to change the harddrive. I have backed up everything on time machine. when i put my new blank hard drive in will the lion screen startup.How do i get the lion dmg when i am already using lion

    I have the new 2011 macbook pro, with lion preinstalled. I want to change the harddrive. I have backed up everything on time machine. when i put my new blank hard drive in will the lion screen startup.How do i get the lion dmg when i am already using lion

    NicholasLiban -
       When you use the Lion restore as described, it does a fresh install on the hard drive that you can select at the beginning of the process.  This provides a complete install of the very latest version of Lion, including the recovery partition.  The drive that you choose for the installation destination winds up like what you would have on a brand new computer from Apple. 
       - Randy

  • Batch Processing when Integration script is used

    Can we set up batch processing when we are using integration scripts to connect to source tables? If yes, then what are the settings required ?
    Thanks

    You need to create an empty flat file in the Openbatch folder (assuming you are using the single period load). the format for the file name is in the admin guide. I generally add this to the batch script before the batch process section.

  • How do I close out old apps when I'm done using them

    How divi close out apps when I'm done using them. Usually if I hold them an x would appear so I could close them out BUT ITS NOT WORKING!

    Double tap the home button and all applications running in the backround will show, the ones at the bottom you press the x to close them from the menu.

  • How do I remove the Stroke lines when I'm creating a blog section?

    How do I remove those stupid Stroke lines when I'm creating a blog section?
    I would show you but i cant post pics here.
    http://www.greenpointcity.com

    See my javascript widget here: http://discussions.apple.com/thread.jspa?messageID=8573276&#8573276

  • How can we remove an unwanted # in sales order texts created using a bapiFM

    Hi,
    i've written the following code which splits the record fetched from apllication server and moves it into a workarea.
    CONSTANTS:c_sep VALUE cl_abap_char_utilities=>horizontal_tab, "for separation
    SPLIT wa_tab1-rec1 AT c_sep INTO wa_inf_itm-inf_vbeln
                                           wa_inf_itm-itm_number
                                           wa_inf_itm-material
                                           wa_inf_itm-req_qty
                                           wa_inf_itm-uom
                                           wa_inf_itm-amount_pr00
                                           wa_inf_itm-amount_pi02
                                           wa_inf_itm-amount_mwst
                                           wa_inf_itm-amount_vprs
                                           wa_inf_itm-currency
                                           wa_inf_itm-text.
    Here c_sep will have a value '#' instead of 'space' in Flatfile from application server.
    The field 'wa_inf_itm-text' though it doesnot contain any value in debugging, when the sales order is created using FM 'BAPI_SALESORDER_CREATE_FROM_DAT2' the item texts are having a # character at the end of the text if it has any text(when checked in va03--sales order item text) or if it doesnot contain any text ,then also # character is seen in texts.
    Thanks & Regards,
    Prasad Reddy.

    hi
    use
    Replace all occurrence of '#' with space from .......
    I think it will solve ur problem.
    Rewards with point if helpful.
    Regards
    Santosh.

  • How to include a .lvlib in a build that was created using a custom .dll

    I am trying to build an executable in LV2010 that uses a .lvlib that was created using a .dll from Keyence. I have added the .lvlib to the source files as "Always Included" and I have also added all of the .vi files of the library to "Always Included." I still get the error saying "Missing External Function" when running the program. The executable seems to open fine on the development computer but not on a secondary computer. Any ideas?
    Solved!
    Go to Solution.

    ...I assumed too quickly that the problem was resolved. By specifying the path I was actually able to open the executable after installing but none of the .dll functions worked. I noticed that when I specified a path on the diagram, the .dll was no longer included in the dependencies and was no longer included in the build. I guess this would explain why none of the functions were working. I copied the .dll over to the path specified on the diagram and it still did not function.
    This brings me back to the original problem I was facing. I actually removed the .lvlib. I replaced all of the library vi references with the Call Library Function and deselected the "Specify path on diagram" Boolean. When I do this, the build includes the .dll in the dependencies list and it includes the .dll file in the destination folder of the install. However, when running the executable I get a list of errors that read, "Missing external function …” I have attached an image of this error. This is the same error that occurred when I was using the library, but I thought maybe the library was the cause of the problem, which is why I used the Call Library Function instead.
    *I have tried adding the .dll to the support files and I receive the same error when trying to run the executable.
    *I have tried adding the .dll to the support files and making it an “always include” in the installer properties under source files. This returns the same error.
    I’m really not sure where to go from here. Any help is greatly appreciated!
    Attachments:
    Call Library Function.jpg ‏56 KB
    Error.JPG ‏23 KB

  • How the system automatically kills the process when I close the browser?

    Hi everybody,
    I have the following problem: I run a report on the web browser. Suppose the user want to detail on one of the characteristics of report. If this takes long time (there are many records in report) and the user closes the web browser, the SAP system still run the proccess (in SM50 I see the dialog process still working, althrough the user closes the browser). This didn't happen in Excel, means, if the user press the 'Cancel' button when he/she tried to detail on one characteristic, the corresponding process is killed too (I see in SM50 how the corresponding dialog process is removed).
    How can I solve this ? Any idea about this?
    Thanks in advance.
    Florina

    Florina,
    there is a timeout set for the web session and the session would get automatically terminated after some time ..
    Some options are :
    1. Use Stateless Templates
    2. There is a Web Template setting called "Automatic Session Management" which uses a page wrapper cookie and kills the session when the person navigates from the page.. - <b>have changed it from previous answer after seeing Anil's post - apologies</b>
    3. If you are using EP  , you could implement DSM Terminator for the same.
    All the above( except 3) will not be suitable for stateful templates , if you want export to excel capability , or printing capability or the capability to save the pages as HTML for local use , you have to use stateful templates.
    First you would have to decide whether to use statefull or stateless templates and then depending on the choice made , go for any of the above. In case non of them work out for you , there is another option , but that would include a lot of javascript and using some command line parameters , update this post and I can tel you about the other if required..
    Hope it helps..
    Arun
    Assign points if useful
    Message was edited by: Arun Varadarajan

  • How to speed up PDF batch processing when creating searchable image PDF's?

    When using the batch processing tool in adobe to create multiple searchable image files into PDF, the process is considerably slower compared to scanning straight from the adobe window and importing scan back into adobe. Is there a way to get around this?

    The flaw is here:
    This is a Windows Server 2012 box
    Adobe desktop programs are generally not officially supported on server operating systems. Whatever issues you have are probably due to things like local users vs. network users, disk quota, specific group policies or plain and simple another process occupying or blocking the same port that the QT server is using. In any case, this is nothing we can figure out for you. You have to sit down and work your way through the server's administration tools, turn off stuff, change user permissions. Check the event logs for conflicting processes or use tools like Sysinternals' Process Monitor or Wireshark to track down port collisions and otehr problems.
    Mylenium

  • How to stop a production order processing when a delivey block is placed

    Hi,
    Mine is a MTO scenario. I am using planning strategy 50. So a planned order ---> production order will be created against MRP run  against each sales order.
    When i am placing a delivery block at the header the system is working fine. Its deleting the planned order(converted production order).
    when I am placing a delivery block at the schedulle line its not working fine. its not deleting the underlined planned order or production order.
    what configuration should I do to make this work.......

    Deepu,
    Unfortunately as per SAP documentation below you cannot have this function at schedule line level.
    "If you enter the delivery block at header level, the system transfers the desired delivery quantity for all schedule lines in the requirement. The confirmed quantity is deleted. This function is not available when you enter the delivery block at schedule line level."
    I have tried in my system & it works the same way. Hope this helps.
    Thanks,
    Ram

  • How to save a "new" master record when pressing the "create" in the detail

    I have a simple Master - Detail form for a Customer - Activity case, where the update of Activity table happens through an additional form.
    When users press the create a new user on the top report (Customer Report) they enter the Master detail form, fill in all the Customer fields and instead of saving the customer (master) record and then come back to create a new activity (detail), they press right away the "create new activity" button, causing all customer data (master) to get lost.
    Is there a way to trigger the parent record to be saved when a user presses the create activity (detail) button?
    Thank you
    Yannis

    In order to show you better the idea, I created a demo application that you can see at: http://apex.oracle.com/pls/otn/f?p=45792:2:1386218200737406::NO:::
    When you create a new order (page 3) you can see that instead of inline editing for the detail, there is a report that will drive to another form (page 4) to edit the data for order detail.
    So just to clarify, I am interested to find out in page 3, how to cause a master record to save (when on insert) when a user press the Create button to add a new order detail.
    Thank you
    Yannis

  • How to recover Mail and Mail Downloads when you can't use Migration Assistant

    I have a MacBook 2.4gHz that had a 750GB HD that crashed yesterday. Disk Utility said "This Hard Drive has failed, recover or backup what you can, then reformat." So, I removed the 750GB HD and replaced the original 160GB HD and reinstalled OS 10.7 on that Drive. I put the 750GB HD in an external case and hooked it up by USB (only available hookup with my external case). I can see all my content and tried to use Migration Assistant, but it hangs up at "preparing content to transfer." So, I decided I would have to drag all the old content onto my new user on the internal HD. I moved Movies, Pictures, Desktop, Documents, Music, and Downloads. However, I can't move any of the parts of the hidden User Library, primarily because I can't find or see it.
    My question is how to access the User Library in a non-bootable (although having OS 10.7 installed) External HD. I've tried the ~/Library/ in Go>Go to Folder, but it goes to the running HD User folder, not the external. Can anyone tell me how to crack into this folder? I'd like to retrieve preferences, mailboxes, address book, etc.
    I realize it could be lost, but literally everything else is still present. FYI: I plan to hang onto the 750 until the replacement HD arrives, so I can be reminded what Applications I had installed. There isn't room for all of those on the smaller HD.
    Thanks,
    Ronda

    Update: I managed to get Migration Assistant to move something, but it didn't work out as I expected. Because I've already installed the OS and some applications that I need, as well as copying over most of the user files except the library, there wasn't much room left on the smaller disk. I purchased the firewire 9pin to 6pin cable that would allow me to use the firewire port on the external drive and selected the main user. There wasn't enough room to move all of the user, so I selected only the "Other Files" folder (about 2 GB), not all the items I had already copied. I set that to install last night at 9:32pm. At 4:00am it said there was still 10 hrs and 29 minutes to go. My husband checked it at 6:45am and it said 19 more minutes. When he arrived home at 4:30pm, it was finished. When I arrived home and logged out of the administrator and in to the main user, immediately it showed my desktop with all the folders that I had placed in the sidebar of the Finder window and everything looked exactly like it had on Monday before the crash, then the beachball started spinning and when it finally came up for air, all those folders were gone, my dock appearance was gone and everything was back to the bland new user settings that Mac OS starts with.
    My mail file did get moved over with its thousands of messages, but not mail uploads nor the desktop appearance settings and it doesn't appear that any other settings have migrated either. It's difficult to tell, since I can't install my applications on the smaller drive.
    The replacement drive from WD arrived, but it is a 2TB "upgrade" and it doesn't even fit in my MacBook, so I have to send that back and wait longer.
    I'm still trying to recover my appearance, and combine the various users into one. If anyone has suggestions on how to get the mail uploads folder, preferences, etc. I'd love to hear them.

  • How do I deauthorize a lost computer when I've already used my 'Deauthorize All' for the year?

    Hi there.
    I have been working for months now trying to find a solution on how to deauthorize every computer I have used for my Ipod touch (every computer I have used has been mine, of course). But I've run into an issue: every computer I've authorized (5 total) have been either killed (hard drive died), or reformatted. Thus, now I can no longer go into the computer and 'deauthorize' the computer manually.
    As I mentioned above, I've already used my deauthorize all for the year and will not be able to use it again until Febuary 23, 2013.
    I cannot wait this long to reaccess my account just so I can save my files & back them up! Please, someone, I need some advice!
    What can I do to reaccess my account and deathorize them all again? Is there any process? I do it!
    I just want to be able to use my accounts again and back up my Ipod whenever I want!
    Sincerely,
    Adam

    Open iTunes, select iTunes Store from the sidebar, click on the Support link under Quick Links. Post an email explaining the situation to seek assistance.

  • How do I resolve Licensing Error 6 when I try to use CS4 with new OS 10.8.4 system

    I recently purchased a Mac Mini which uses OS X Mountain (10.8.4). (My old G5 with OS 10.5 had died.) When I purchased the Mac Mini I was told that my old Adobe Creative Suite 4 would still work. However, when I try to start up any application, but Photoshop for example, I am told that Licensing has stopped working and that I have Error 6. Does any one know how I can resolve this?

    You need to contact Adobe about that. You will need CS6 or above.

Maybe you are looking for