Using NormalizedMessage api

Hi
Can someone explain how to use the NormalizedMessage.setPayload(Map payload) method Vs NormalizedMessage.addPart(String partName, String xml), assuming my Message is defines as follows
<message name="MyRequestMessage">
<part name="payload" element="tns:MyRequest"/>
</message>
if using the 'addPart' my code will be
String inputDataXml = myObject.toXML();
NormalizedMessage nm = new NormalizedMessage();
nm.addPart( "payload", inputDataXml );
if using the 'setPayload' my code is
NormalizedMessage nm = new NormalizedMessage();
Map payLoad = new HashMap();
payLoad.put( myObject.getClass().getName(), myObject);
nm.setPayload( payLoad );
Is this right? the 'addPart' works fine for me, but when i try the 'setPayload' it throws the following exception
java.rmi.RemoteException: error unmarshalling arguments; nested exception is:
     java.io.InvalidClassException: failed to read class descriptor
     at com.oracle.bpel.client.dispatch.BaseDispatcherService.initialPostAnyType(BaseDispatcherService.java:628)
     at com.oracle.bpel.client.dispatch.BaseDispatcherService.initialPost(BaseDispatcherService.java:501)
     at com.oracle.bpel.client.dispatch.BaseDispatcherService.post(BaseDispatcherService.java:228)
     at com.oracle.bpel.client.dispatch.DispatcherService.post(DispatcherService.java:66)
     at com.oracle.bpel.client.dispatch.DeliveryService.post(DeliveryService.java:173)
     at com.oracle.bpel.client.dispatch.DeliveryService.post(DeliveryService.java:132)
     at com.ema.appfw.biz.servicerequest.ServiceRequestManager.initiateServiceRequest(ServiceRequestManager.java:91)
     at com.ema.appfw.biz.servicerequest.ServiceRequestManagerTest.main(ServiceRequestManagerTest.java:24)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Do i need to register my class or something?
Thanks
Sam

Hi Sam,
Basically here is what addPart does:
addPart(string partName, String xml)
{ payLoadMap.put(partName, xml); }
When you use setPayload(Map payload), it is your responisblity to construct the correct payload using correct part name.
NormalizedMessage nm = new NormalizedMessage();
Map payLoad = new HashMap();
payLoad.put( "payload", myObject);
nm.setPayload( payLoad );
the value of the payload map (myObject) should be either serializable w3c dom element or xml string.
i will file a doc bug for this..the API doc should clearly say what is the key and value for this Map.
-muruga

Similar Messages

  • Unable to display double values in Excel sheet using JExcel API

    Hi
    I am writing code to generate report in the form of Excel Sheet using JExcel API.
    Everything is going fine but whenever I want to put some double values in a cell it is only showing 2 decimal places. My problem is "I want to show upto five decimal places".
    Any kind of reply might help me lot.
    Thank U.

    If you enable the submit zero option, it still happens? This is a new feature on the display tabl
    #NumericZero Enhancements
    To display a numeric zero in place of an error message, you can enter #NumericZero in any of the three Replacement text fields. When you use the #NumericZero option:
    · Excel formatting for the cell is retained.
    · All calculations with dependency on the cell will compute correctly and will take the value of this cell as zero.
    · This numeric zero is for display only. When you submit, the zero value is NOT submitted back to the data source.
    You cannot set display strings for cells that contain an invalid member or dimension name (metadata error). Metadata errors produce standard descriptive error messages.
    Errors are prioritized in the following order from highest to lowest. The error message for a higher-priority error takes precedence over that for a lower-priority error.
    1. (Highest) Metadata errors
    2. #No access
    3. #Invalid/Meaningless
    4. #No data\Missing

  • How Do I Use the API to Abbreviate?

    How do I use the ACE API to limit the output field length and properly abbreviate the output field?
    Using the pwace command-line application, I get abbreviated output that looks like this for a 30 byte field:
    nnnnn GEORGE WASHNGTN MMRL HWY
    However, when using the API, I end up with a truncated field:
    nnnnn GEORGE WASHINGTON MEMORI
    This is from the PRIM_ADDR field.
    How do I use the API to get the same field value as the command-line application?
    Thanks,
    Rob
    Edited by: rriggs on Jun 30, 2010 11:36 PM

    Rob,
    The jobfile product has intelligent truncation built into the product.  However, with the API this would be up for the user to code around. 
    Thanks,
    Brandon

  • Cross Reference within external Database using XREF API

    Hi Experts,
       Can we do Cross Reference within external Database using  XREF API uses JDBC to access the Oracle Database Stored Procedures in SAP PI? How to use a JNDI Data source to access the DB and how to do the Connection Pooling will be done by the SAP J2EE server? Kindly let me know step by step proceedings.
    Regards
    Archana

    Hello Archana,
    It can be done with a Lookup call in a mapping.
    Here's a little article about the topic in the SAP wiki:
    http://wiki.sdn.sap.com/wiki/display/XI/HowtouseCrossReferencewithinexternal+Database
    With kind regards
                     Sebastian

  • Problem Sending mails in a loop using JavaMail API

    Hello All,
    I am sending emails in a loop(one after the other) using JavaMail API,but the problem is, if the first two,three email addresses in the loop are Valid it sends the Email Properly, but if the Fourth or so is Invalid Address it throws an Exception....
    "javax.mail.SendFailedException: Sending failed;"
    nested exception is:
    javax.mail.SendFailedException: Invalid Addresses;
    nested exception is:
    javax.mail.SendFailedException: 450 <[email protected]>:Recipient address rejected: Domain not found......
    So if i want to send hundereds of emails and if one of the Emails inbetween is Invalid the process Stops at that point and i could not send the other emails in the Loop......
    How Could i Trap the exception thrown and handle it in such a way, so that the loops continues ..
    Is there something with the SMTP Server....?
    The code which i am using is as follows....
    <Code>...
    try {
    InitialContext ic = new InitialContext();
    Session session = (Session) ic.lookup(JNDINames.MAIL_SESSION);
    if (Debug.debuggingOn)
    session.setDebug(true);
    // construct the message
    MimeMessage msg = new MimeMessage(session);
    msg.setFrom(new InternetAddress(eMess.getEmailSender()));
    String to = "";
    msg.setRecipients(Message.RecipientType.TO,
    InternetAddress.parse(to, false));
    msg.setRecipients(Message.RecipientType.BCC,
    InternetAddress.parse(eMess.getEmailReceiver(), false));
    msg.setSubject(eMess.getSubject());
    msg.setContent(eMess.getHtmlContents(),"text/plain");
    msg.saveChanges();                
    Transport.send(msg);
    } catch (Exception e) {
    Debug.print("createAndSendMail exception : " + e);
    throw new MailerAppException("Failure while sending mail");
    </Code>....
    Please give me any suggestions regarding it....and guide me accordingly..
    Thanks a million in advance...
    Regards
    Sam

    How about something like the code attached here. Be aware it is lifted and edited out of an app we have here so it may require changing to get it to work. If it don't work - don't come asking for help as this is only a rough example of one way of doing it. RTFM - that's how we worked it out!
    SH
    try {
    Transport.send(msg);
    // If we get to here then the mail went OK so update all the records in the email as sent
    System.out.println("Email sent OK");
    catch (MessagingException mex) {
    System.out.println("Message error");
    Exception ex = mex;
    do {
    if (ex instanceof SendFailedException) {
    if (ex.getMessage().startsWith("Sending failed")) {
    // Ignore this message as we want to know the real reason for failure
    // If we get an Invalid Address error or a Message partially delivered message process the message
    if (ex.getMessage().startsWith("Message partially delivered")
    || ex.getMessage().startsWith("Invalid Addresses")) {
    // This message is of interest as we need to process the actual individual addresses
    System.out.println(ex.getMessage().substring(0, ex.getMessage().indexOf(";")));
    // Now get the addresses from the SendFailedException
    SendFailedException sfex = (SendFailedException) ex;
    Address[] invalid = sfex.getInvalidAddresses();
    if (invalid != null) {
    System.out.println("Invalid Addresse(s) found -");
    if (invalid.length > 0) {
    for (int x = 0; x < invalid.length; x++) {
    System.out.println(invalid[x].toString().trim());
    Address[] validUnsent = sfex.getValidUnsentAddresses();
    if (validUnsent != null) {
    System.out.println("Valid Unsent Addresses found -");
    if (validUnsent.length > 0) {
    for (int x = 0; x < validUnsent.length; x++) {
    System.out.println(validUnsent[x].toString().trim());
    Address[] validSent = sfex.getValidSentAddresses();
    if (validSent != null) {
    System.out.println("Valid Sent Addresses found -");
    if (validSent.length > 0) {
    for (int x = 0; x < validSent.length; x++) {
    System.out.println(validSent[x].toString().trim());
    if (ex instanceof MessagingException)
    ex = ((MessagingException) ex).getNextException();
    else {
    // This is a general catch all and we should assume that no messages went and should stop
    System.out.println(ex.toString());
    throw ex;
    } while (ex != null);

  • How to use excel api in java?

    I need to use excel api in Java to generate data in excel format. Can any one tell any of the use ful Excel api that we can down load from net? i have read about Apache's POi-hssf-Java api. But the jar i downloaaded from Apache site is not working ? Can anybody please send me the jar for taht Api ?

    Hi,
    In fact i was not clear about whcih jar file to download from the apache site. i found one folder structure like this
    -parent
    -bin
    -src
    All these folders contained some zip files. i took the zip files and extracted them. And i set teh class path also . But when i tried to import in java programs ,these jar files are giving compilation errors

  • Get all the field's value of addressbook entry using c++ api

    How can i get all the field values of address book entry in groupwise using c++ api.

    You should be able to do that via the Token API. There is an AddressBookGetEntry method. You could createsome sort of AddressbookEntry class that fetches (via iteration over the defined ABFields) all the innformation.

  • Can I use external APIs to authenticate users?

    I have been asked to develop a lightswitch application either as desktop client or HTML client. Now I am confused about the authentication
    mechanism in LightSwitch, and it leads a question: Can I authenticate my users from an external website or application?  
    For the HTML client, I have been thinking that whether I could use external APIs like Facebook Login API to authenticate my users? If I could, the code should be JavaScript, then where should I put it, and how can I configure my LS application?
    For the desktop client, same question, if I could identify my users by pulling some user information from an external website, what kind of code/Programming Language shall I use? 

    Hey ConnorTx!
    This is not supported out of the box.
    For in-browser desktop applications, you can hack around this by setting up the social media credentials, then redirecting to your desktop application while passing the self-encrypted credentials.  I explained this workaround in
    this article.
    I don't have enough production experience with HTML apps yet.  However when you use Forms authentication, I suspect you can simply fill in the IPrincipal on the HttpContext.Current, then redirect to your HTML app, and the LightSwitch Forms Auth mechanism
    would pick up your principal as valid credentials.  I wish I had time to show you some code for this, would make a great blog post :/
    Keep rocking LS!
    Jan
    It's your story - time to switch on the innovation.||About me||LightSwitch blog

  • font color=red Create/Modify forms and triggers through C++ using OPEN API

    <font color=red>
    Dear brothers/sisters<font color=darkblue>
    <br><br>
    Please help us to find the linking problem.
    <br>
    We have to add PRE-FORM trigger to many FMBies. We have thousants of FMBies. So opening one by one is difficult. For this we are using OPEN API and BORLAND C++. We have coppied all header files from D:\orant\FORMS60\API.
    But there is a link error. Here is the snippet.
    <br>
    <font color=red>
    <br>#include <stdio.h>
    <br>#include <stdlib.h>
    <br>#include <malloc.h>
    <br>#include <d2fctx.h> /* Forms API context */
    <br>#include <d2ffmd.h> /* Form module header file */
    <br>int main (int argc, char *argv[])
    <br>{
    <br>d2fctxa ctx_attr;
    <br>d2fctx *ctx;
    <br>d2ffmd *form;
    <br>text *form_name;
    <br>/* Check arguments */
    <br>if ( argc != 2 )
    <br>{
    <br>fprintf(stderr, "USAGE: %s <filename>\n", argv[0]);
    <br>exit(1);
    <br>}
    <br>/* Create Forms API context */
    <br>ctx_attr.mask_d2fctxa = (ub4)0;
    <br>if ( d2fctxcr_Create(&ctx, &ctx_attr) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error creating Forms API context\n");
    <br>exit(1);
    <br>}
    <br>/* Load the form module into memory */
    <br>if ( d2ffmdld_Load(ctx, &form, argv[1], FALSE) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Failed to load form module: %s\n", argv[1]);
    <br>exit(1);
    <br>}
    <br>/* Get the name of the form module */
    <br>if ( d2ffmdg_name(ctx, form, &form_name) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error getting the name of the form module\n");
    <br>}
    <br>else
    <br>{
    <br>/* Print the name of the form, then free it */
    <br>printf ("The name of the form is %s\n", form_name);
    <br>free(form_name);
    <br>}
    <br>/* Destroy the in-memory form */
    <br>if ( d2ffmdde_Destroy(ctx, form) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error destroying form module\n");
    <br>}
    <br>/* Close the API and destroy context */
    <br>d2fctxde_Destroy(ctx);
    <br>return 0;
    <br>}
    <br>
    <font color=darkblue>
    <br>
    The compilation is success. But there is a link error. Please help us to find the problem.
    <br><br>
    Here is the error Message.
    <br>
    <font color=red>
    <br>Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    <br>FIRST.CPP:
    <br>Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    <br>Error: Unresolved external '_d2fctxcr_Create' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2ffmdld_Load' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2ffmdgt_GetTextProp' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2fctxde_Destroy' referenced from D:\API\FIRST.OBJ
    <br><br>
    <font color=darkblue size=4>Could you please help us.......<br>

    <font color=red>
    Dear brothers/sisters<font color=darkblue>
    <br><br>
    Please help us to find the linking problem.
    <br>
    We have to add PRE-FORM trigger to many FMBies. We have thousants of FMBies. So opening one by one is difficult. For this we are using OPEN API and BORLAND C++. We have coppied all header files from D:\orant\FORMS60\API.
    But there is a link error. Here is the snippet.
    <br>
    <font color=red>
    <br>#include <stdio.h>
    <br>#include <stdlib.h>
    <br>#include <malloc.h>
    <br>#include <d2fctx.h> /* Forms API context */
    <br>#include <d2ffmd.h> /* Form module header file */
    <br>int main (int argc, char *argv[])
    <br>{
    <br>d2fctxa ctx_attr;
    <br>d2fctx *ctx;
    <br>d2ffmd *form;
    <br>text *form_name;
    <br>/* Check arguments */
    <br>if ( argc != 2 )
    <br>{
    <br>fprintf(stderr, "USAGE: %s <filename>\n", argv[0]);
    <br>exit(1);
    <br>}
    <br>/* Create Forms API context */
    <br>ctx_attr.mask_d2fctxa = (ub4)0;
    <br>if ( d2fctxcr_Create(&ctx, &ctx_attr) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error creating Forms API context\n");
    <br>exit(1);
    <br>}
    <br>/* Load the form module into memory */
    <br>if ( d2ffmdld_Load(ctx, &form, argv[1], FALSE) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Failed to load form module: %s\n", argv[1]);
    <br>exit(1);
    <br>}
    <br>/* Get the name of the form module */
    <br>if ( d2ffmdg_name(ctx, form, &form_name) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error getting the name of the form module\n");
    <br>}
    <br>else
    <br>{
    <br>/* Print the name of the form, then free it */
    <br>printf ("The name of the form is %s\n", form_name);
    <br>free(form_name);
    <br>}
    <br>/* Destroy the in-memory form */
    <br>if ( d2ffmdde_Destroy(ctx, form) != D2FS_SUCCESS )
    <br>{
    <br>fprintf(stderr, "Error destroying form module\n");
    <br>}
    <br>/* Close the API and destroy context */
    <br>d2fctxde_Destroy(ctx);
    <br>return 0;
    <br>}
    <br>
    <font color=darkblue>
    <br>
    The compilation is success. But there is a link error. Please help us to find the problem.
    <br><br>
    Here is the error Message.
    <br>
    <font color=red>
    <br>Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    <br>FIRST.CPP:
    <br>Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
    <br>Error: Unresolved external '_d2fctxcr_Create' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2ffmdld_Load' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2ffmdgt_GetTextProp' referenced from D:\API\FIRST.OBJ
    <br>Error: Unresolved external '_d2fctxde_Destroy' referenced from D:\API\FIRST.OBJ
    <br><br>
    <font color=darkblue size=4>Could you please help us.......<br>

  • Need help in developing a webdynpro application using UWL API

    Hi developers,
    Iam developing a new WebDynpro application for UWL using UWL API.the functionality is to dispaly the summary of UWL like number of unread items, total items.
    Iam getting the problem while deploying the application, iam getting warning while deployed the application.
    I have given all possible ways mentioned in the below forum link
    Re: Accessing PortalRuntime at runtime?
    The exact problem is coming at reference file.
    Please giude me how to move forward.
    1. Below is the error when given "tckmcbc.uwl~api" in the service entry
    deployed with warning :
    Finished with warnings: development
    Caught exception during application startup from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Error occurred while starting application local/UWLCountDemo and wait. Reason: Clusterwide exception: server ID 21763550:com.sap.engine.services.deploy.container.DeploymentException: Clusterwide exception: Failed to prepare application local/UWLCountDemo for startup. Reason=Clusterwide exception: Failed to start dependent service ''tckmcbc.uwl~api'' of application ''local/UWLCountDemo''. Status of dependent component: STATUS_MISSING. Hint: Is the component deployed correctly on the engine?
    2.Below is the error  when i gave PORTAL:sap.com/tckmcbc.uwl~api in the sharing refernce entry
    Finished with warnings: development
    Caught exception during application startup from SAP J2EE Engine's deploy service:
    java.rmi.RemoteException: Error occurred while starting application local/UWLCountDemo and wait. Reason: Clusterwide exception: server ID 21763550:com.sap.engine.services.deploy.exceptions.ServerDeploymentException: Application local/UWLCountDemo cannot be started. Reason: it has hard reference to resource tckmcbc.uwl~api with type application, which is not active on the server.
    Thanks in Advance
    Sekhar.
    Edited by: sekhar c on Mar 21, 2009 11:24 AM

    Please see Kenichi Unnai in his blog "How to use UWL API for NetWeaver BPM Tasks"
    How to use UWL API for NetWeaver BPM Tasks
    The .sca-file can be found on the sap service marketplace, afterwards you need to import the .sca-file, add the SC to your "MyComponents" and then you can select your necessary DC's.

  • Need help in using a API

    I am new to flash . And my doubt may seem very trivial. I hae
    a problem using the Flash administation API "getLiveStreams()" . I
    am supposed to get the list of all live streams. However in the
    client when i do
    nc.call("getLivestreams",responder); i don't get any return
    value . Do i need to set any variables before calling this ? or how
    should i parse the output after calling the function. Any inputs
    would be highly appreciated

    Please see Kenichi Unnai in his blog "How to use UWL API for NetWeaver BPM Tasks"
    How to use UWL API for NetWeaver BPM Tasks
    The .sca-file can be found on the sap service marketplace, afterwards you need to import the .sca-file, add the SC to your "MyComponents" and then you can select your necessary DC's.

  • Print HTML using JPS API.. How to configure printer MIME-TYPE as text/html

    Hi All,
    I have to print the HTML pages.. for this i have used JPS API , but i found that my printer doesnt supoort Mime-type(Flavour) text/html.
    Can someone help me in this ...
    i) Can i configure my printer for this Mime-type , if yes then HOW?
    ii) Is there any work around ?
    Thank you all in advance :)

    I reposted this question in the Database forum. Admin can feel free to delete this thread.
    The answer is to add this at the top: htp.addDefaultHTMLHdr(false);
    Thanks,
    T.
    Edited by: 855677 on May 3, 2011 9:35 AM

  • Custom report  using KM API Error

    Hi All,
    I have to create a report using KM API. i got the custom report using KM API from sdn and I imported into my NWDS. While i compile it, it is giving me this error.
    "The project cannot be build because the classpath for com.sap.netweaver.bc.rf.common.exception.ResourceException is not found."
    I have imported all the required jar files.
    How can i rectify this error?  Could anyone help me out in this issue?
    Regards,
    Divya

    Hi Divya,
    > I have imported all the required jar files
    First, I don't know what you mean with "imported" - in any case, you should <i>not</i> put the JARs into your project but just reference these.
    Also, obviously you have <i>not</i> referenced <i>all the required jar files</i>; ResourceException is part of bc.rf.common_api.jar, which is part of portal application com.sap.netweaver.bc.rf, at least for NW2004s.
    Please use the ClassLocator tool (search the WebLogs for this term to get some initial instruction) to avoid such questions in the future. It will make your life much easier.
    Hope it helps
    Detlev

  • Creating Excise Invoice from Sales Delivery using DI API.

    Hi Experts,
    I have been searching a lot for any Business Object for creating Excise Invoice base on Sales Delivery using DI API.. But have not yet found any one.
    I want to create Invoice for excisable items from Sales Delivery using DI API.,for Excisable items we cannot create standalone A/R Invoice . We need to create Excise Invoice also . But How to create Excise Invoice based on Sales Delivery using DI API. Is there any Business Object for that.
    Please suggest me.
    Thanks and Regards,
    Pooja Singh.

    Hi all,
    I have not received any reply for this thread. Does this mean that there is no provision for creating Excise Invoice from Sales Delivery ? Actually I was asked to create sales delivery and then Outgoing Excise Invoice and then Sales Invoice using DI API.
    But I don't find any Business Object for this in SDK ? Is it really not possible to create Outgoing Excise Invoice from Sales Delivery using DI API.? If possible then how?
    Please reply me if anyone has got any idea in this regard.
    Thanks and Regards,
    Pooja Singh.

  • Creating Job material using public API from WIP

    Take the entered component part number and search in the WIP job material requirements. This should use a WIP API. If the material is found, increment the quantity. If material is not found, create the job material using public API. (Provide WIP API details)
    The java object, oracle.apps.csd.schema.server .CsdHvWipJobPvtEO is a wrapper to call WIP API. This should be used to create material requirements is this the procedure to create job material Req.
    from OAF how we have to create Job material transaction

    Hi Pat,
    What is your SBO version? I've seen several cases in which the login/connection procedure (both in the client and via DI API) has become much slower after upgrading to SBO 2005.
    Do you experience the same slowness when connecting via DI API in a non-WebService setting?
    I would not recommend using DI API in a web service context in the first place. DI Server would give you a much more robust, stable and scalable infrastructure to build upon.
    Henry

Maybe you are looking for