How to send response message from Java mapping class? Please help!

Hi Experts,
  I have a sync scenario
          -Req-->  -
>
SOAP           XI       RFC
          <Res--     <-----
  The Req message contains:
  <Order>
       <Orderid>100</Orderid>
       <Desc>Extrenal Order</Desc>
       <Qty>2500</Qty>
  </Order>
  Response message is:
  <Log>
     <LogTxt>Qty value cannot be more than 3 chars</LogTxt>
  </Log>
  In the XI I have to validate the input request message using a schema. For this I am writing a java mapping program using aii_map_api.jar.
My requirement is that If the input message schema validation fails then I want to send a response message back to sender.
  How can I send a response message back to the sender in java mapping program?
Kindly help with sample code example.
Thanks
Gopal

Hi,
First, I think PI 7.1 has this functionality and perhaps it comes in a SP for PI 7.0 and XI 3.0.  So first have a look at that before creating custom development.
Second, if you use the java mapping, you will only have access to a request or response message.  I would advise using a custom java module in the module processor and insert this message in the sender communication channel.  This will allow you to validate request and send a response.
Regards,
Yaghya

Similar Messages

  • Send short message from Java application on mobile phone to server; http

    Hello!
    My question is: can I send short message from Java application on mobile phone to server - with the use of SMS (WMA) or http connection?
    I found this topic http://forums.sun.com/thread.jspa?threadID=5405431 about: "how to send data from midlet to servlet using doPost method".
    There is also such topic http://forums.sun.com/thread.jspa?threadID=5408046&tstart=0 about: "CLDC and MIDP - sending SMS to server -> Wireless Messaging API (WMA)".
    Please, kindly help me.
    Code from the topic mentioned above, edited by me so that it can be read easily:
    //http://forums.sun.com/thread.jspa?threadID=5405431
    //CLDC and MIDP - Re: how to send data from midlet to servlet using doPost method
    I want to know how to pass the values .
    for examples : this is what i wrote for doGet
    String url = setting.getUrl().toString()"/testProServlet/servlet/UpdateCompanyProfile?userId="+loggedInUserId"&svComp="saveCompHex;
    userId and svComp has the data which is very long so i wanted to use doPost.
    Now i dont know how to do it.
    This is what i have done in doGet (midlet)
    public void saveCompanyProfile(String saveComp,int flag,String blankFieldNm)
         System.out.println("flag===" flag);
         if (flag==1)
              displayAlert("Company Profile Edit",blankFieldNm+" field cannot be blank.",AlertType.ERROR, edCmpRecForm, true);
         else
              String saveCompHex = helper.encodeHexString(saveComp);
              // String saveCompHex =saveComp;
              HttpConnection httpConn = null;
              serverSettings setting = new serverSettings();
              System.out.println("saveCompHex===" saveCompHex);
              String url = setting.getUrl().toString()"/testProServlet/servlet/UpdateCompanyProfile?userId="loggedInUserId"&svComp="saveCompHex;
              System.out.println("url of save company profile:: "+url);
              InputStream is = null;
              OutputStream os = null;
              try {
                   // Open an HTTP Connection object
                   httpConn = (HttpConnection) Connector.open(url);
                   System.out.println("urlMidlet1 save edited company data===::" url.length());
                   // Setup HTTP Request
                   httpConn.setRequestMethod(HttpConnection.POST);
                   httpConn.setRequestProperty("User-Agent","Profile/MIDP-1.0 Confirguration/CLDC-1.0");
                   System.out.println("urlMidlet2===" url);
                   int respCode = httpConn.getResponseCode();
                   System.out.println("respCode edit company profile=====" respCode);
                   if (respCode == httpConn.HTTP_OK)
                        StringBuffer sb = new StringBuffer();
                        os = httpConn.openOutputStream();
                        is = httpConn.openDataInputStream();
                        int chr;
                        while ((chr = is.read()) != -1)
                             sb.append((char) chr);
                        String sResultSvCompanyProfile= sb.toString();
                        System.out.println("+++++++++++++Company sResult+++++++++++++==="sResultSvCompanyProfile);
                        if (resultViewCompanyProfile.trim().equals(""))
                             System.out.println("++++++++++++++If++++++++++++++SaveCompanyProfile===");
                             displayAlert("Login Incorrect","Username and Password incorrect", AlertType.ERROR, mainForm, true);
                        else
                             System.out.println("++++++++++++++Else++++++++++++++SaveCompanyProfile===");
                             //companyProfile();
                             displayAlert1("Information","Company Profile edited successfully", AlertType.INFO, profileMenuScreen, true);
                   else
                        System.out.println("Error in opening HTTP Connection. Error#" respCode);
                        //the line below divided into two lines because it was too long
                        displayAlert("Connection Failed","Cannot connect to server, please contact the Administrator.",
                        AlertType.ERROR, mainForm, false);
              catch(IOException e)
                   e.getMessage();
              finally {
                   if(is!= null)
                        try
                             is.close();
                        catch (IOException e)
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                             displayAlert("Connection Failed","Cannot connect to server, please contact the Administrator.",
                             AlertType.ERROR, mainForm, false);
                   if(os != null)
                        try
                             os.close();
                        catch (IOException e)
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                             displayAlert("Connection Failed","Cannot connect to server, please contact the Administrator.",
                             AlertType.ERROR, mainForm, false);
                   if(httpConn != null)
                        try
                             httpConn.close();
                        catch (IOException e)
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                             displayAlert("Connection Failed","Cannot connect to server, please contact the Administrator.",
                             AlertType.ERROR, mainForm, false);
              } //end finally
         } //end else (?)
    } //end savecompany

    hi,
    SMS API(WMA) is an optional package. It is not a MIDP1.0 or MIDP2.0 api's.
    There are phones which has WMA api with MIDP1.0 support .... Nokia 3650
    Seimens has some phone with their own api's to send sms.Check out seimens site for more info
    BTW, What do you mean buy sending SMS to Server????
    If you want to send message to server you can do it with Http.
    HTH
    phani

  • Unable to update software or upload pics from SD card-how do I remove files from startup disk? Please help!

    Unable to update software or upload pics from SD card-how do I remove files from startup disk? Please help!

    Hello Smile_333
    The article below will assist with finding things and help increase the hard drive space for your computer. The best way is to have an external hard drive to copy things to if you do not want to delete and loose things.
    OS X Mountain Lion: Increase disk space
    http://support.apple.com/kb/PH10677
    Thanks for using Apple Support Communities.
    Regards,
    -Norm G.

  • How to send a message from server to a particular client

    Hi all,
    I need to send a message from one host to another host which are connected in local domain. Now I'm able to send a message from client to server and vice versa but what I need is the server should route that message which I send through one client to another host(client) .
    How can I do that ?
    Please give me some ideas how to do that .
    Thanks in advance
    Edited by: m.parthiban on Mar 5, 2008 1:20 PM

    ejp, thanks for your reply . can you please explain me bit more by providing code snippet ?
    This is what I have done till now :
    MyServer:
    package connection;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.ServerSocket;
    import java.net.Socket;
    public class MyServer {
          * @param args
         public static void main(String[] args) {
              String ss ="",temp ="";
              Socket clientLink=null;
              try {
                        ServerSocket sockServer = new ServerSocket(6000);
                        while(true) {
                             clientLink = sockServer.accept();
                             System.out.println("Connection Established");
                             InputStreamReader isr = new InputStreamReader(clientLink.getInputStream());
                             BufferedReader bufReader = new BufferedReader(isr);
    //                         System.out.println("buf "+bufReader.readLine());
                             try {
                                  while ((temp=bufReader.readLine())!=null) {
                                       ss+=temp;
                                       System.out.println("ss   "+ss+"Temp "+temp );
                                  System.out.println("Client > "+ss);
                             } catch (IOException e) {
                                  System.out.println("while reading");
                                  e.printStackTrace();
                             OutputStreamWriter osw = new OutputStreamWriter(clientLink.getOutputStream());
                             PrintWriter pw = new PrintWriter(osw,true);
                             pw.write("Welcome -by Server !!!");
                             pw.flush();
                             clientLink.shutdownOutput();
                             clientLink.close();
              } catch (IOException e) {
                   System.out.println("Can't able to connect");
                   e.printStackTrace();
    }MyClient:
    package connection;
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    import java.io.OutputStreamWriter;
    import java.io.PrintWriter;
    import java.net.Socket;
    import javax.swing.JOptionPane;
    public class MyClient {
          * @param args
         public static void main(String[] args) {
              try {
                   String serverMsg="",temp="";
                   Socket client = new Socket("127.0.0.1",6000);
                   PrintWriter pw = new PrintWriter(client.getOutputStream(),true);
                   pw.write("Hi ,Accecpt me");
                   pw.flush();
    //               pw.close();
                   client.shutdownOutput();
                   InputStreamReader isr  = new InputStreamReader(client.getInputStream());
                   BufferedReader bufRead = new BufferedReader(isr);
                   while ((temp=bufRead.readLine())!=null) {
                        serverMsg +=temp;
                   System.out.println("Server > "+serverMsg);
                   JOptionPane.showMessageDialog(null, serverMsg);
                   client.shutdownInput();
                   client.close();
              } catch (IOException e) {
                   System.out.println("Failed to connect");
                   e.printStackTrace();
    }Once again thanks for the time you spend to reply me.

  • How to send JMS Message from a BPM Process

    Hi All
    I have small query regarding sending JMS Message from a bpm process. Is it possible to send JMS message from one bpm process to another bpm process.
    I have a scenario in which I need to send a JMS message to a queue where another process is listening on that queue and as soon as the message is received on the queue the process instance is created.
    I know how to listen for the JMS message on the queue, but I don't how to send a JMS message from a process.
    Also Can I create process by sending the Notification to the process instead of a JMS message. But the process to be created is not a subprocess i.e. Can notification be send accross different processes.
    Any information or example in this regard would be helpful.
    Thanks in advance
    Edited by: user9945154 on Apr 22, 2009 7:46 PM

    Hi,
    Here's one approach to sending JMS messages from an Oracle BPM process. If you're doing this just to send a message into another process, do not take this approach. It's far easier and quicker if you do this using the OOTB "send notification" logic.
    These steps describe how to do this using WebLogic. The steps would be different if you're using another ap server / JMS provider.
    1. Guessing you've already done this, but first expose the two required WebLogic jar files for JMS messaging as Java components in the External Resources. The two files for WebLogic are weblogic.jar and wljmsclient.jar” (located in the < WebLogic home directory > /weblogic/server/lib” directory).
    AquaLogic BPM JMS Queue Listener for WebLogic 8.1
    2. You've probably already done this, but add an External Resource to represent the J2EE container:
    • Name: “weblogicJ2EE” - this is important and will be used in the next step
    • Supported Type: “GENERIC_J2EE”
    • Initial Context Factory: “weblogic.jndi.WLInitialContextFactory”
    • URL: “t3://localhost:7001”
    • Principal: and Credentials: whatever userid and password you defined to access theWebLogic administrative console.
    3. Create the External Resource that represents the send queue configuration. In this example, I'm calling it “WebLogic Send Queue”. This is important - remember what you named it because you will use this name in the logic that sends the JMS message. This new External Resource is configured as:
    • J2EE: “weblogicJ2EE” (same name as the second External Resource you created)
    • Destination Type: “QUEUE”
    • Lookup Name: “weblogic.examples.jms.exampleQueue”
    • Connection Factory Lookup Name: “weblogic.examples.jms.QueueConnectionFactory”
    4. Here's the logic to send a Message to the Queue
    <pre class="jive-pre"><p />msg as String = "Hello World"
    jmsMsg as Fuego.Msg.JmsMessage
    msg = "<?xml version=\"1.0\"?><Msg>" + msg + "</Msg></xml>"
    jmsMsg = JmsMessage(type : JmsMessageType.TEXT)
    jmsMsg.textValue = msg
    sendMessage DynamicJMS
    using configuration = "WebLogic Send Queue",
    message = jmsMsg</pre>
    Note that the “sendMessage” method uses the configuration parameter “WebLogic Send Queue”. You previously created a JMS messaging service External Resource with this name in the third step.
    Again, please don't go this route if you're just using it to send notifications between processes,
    Dan

  • How to send JMS message from oracle to weblogic

    Hello,
    I am facing with a problem of sending jms message from oracle to weblogic. I am using oracle 10g and weblogic server 9.1. Here is the problem. I would like to create a trigger to send JMS message to weblogic server whenever there is an update in oracle database. So I created a java class that will send a jms message to weblogic server. But in that class I use the jndi from weblogic: weblogic.jndi.WLInitialContextFactory
    when I use the loadjava utility to load that class into oracle, the status of that class is invalid though this class is working fine in eclipse with the weblogic.jar included. I was thinking because the jndi from weblogic needs the weblogic.jar in order to work, then I loaded that jar file into oracle (it took about 20 minute to load everything) and everything loaded into oracle from that jar file is invalid and missing some reference.
    So my question is: how do I send a jms message from oracle to weblogic using a java class with the right jndi?
    Any help will be appreciated.
    Thanks
    TL

    It should be quite straightforward to do this. As stated you need weblogic.jar in your classpath, then use 100% standard JMS calls to publish.
    Ensure that you set the following properties before getting your initial context:
    java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory
    java.naming.provider.url=t3://node:7001 (or whatever)
    this will ensure that the correct JMS implementation classes are invoked.
    You can't easily (without some mucking around) build a test implementation in an AQ environment and then deploy to WebLogic because in AQ you don't tend to use JNDI lookups (unless you've implemented oracle JNDI etc) but rather use non standard factory class to create connections etc.

  • How to send the message from front end to XI in sender webservice

    Hi All,
    I am doing webservice to proxy scenario, we want to send the message from front end to XI, front end is java application. can any one please guide me the steps need to done for front end to XI.
    1) we wrote a webservice
    2) i have created data type message type and message interface in IR
    3) i have created sender soap adapter with interface name and namespace.
    4) i have generated webservice in ID
    but how can we send the message from front end to XI sender soap adapter.
    Kind Regards,
    Kiran

    Hi,
    Before going with the SOAP Adapter i suggest you to go through this Disscussion
    Re: about http and soap
    If you are going with the SOAP Adapter means
    >>but how can we send the message from front end to XI sender soap adapter.
    you have to use the XI  Server URL( http://host name:j2ee port/
    Use this as Refference
    http://help.sap.com/saphelp_nw70/helpdata/EN/ae/d03341771b4c0de10000000a1550b0/frameset.htm
    Regards
    Seshagiri

  • How to send communication message from application server to load balancer

    Hi,
    Environment: 8 application servers are clustered behind a load balancer. Java/J2EE based client-server application
    When any one of the servers is supposed to go down, I want to send a message from that server, programmatically, to load balancer something which signifies "server is down or going down, do not forward any client connections to me". This is to avoid any CLOSE_WAITs.
    How do I achieve this? How can I send message programmatically from app server to load balancer? From very basic knowledge, SNMP can be used for this. But do not know how to start of. Any other means is also OK. Need details.
    Thanks
    Sunil

    At the same time we stop accepting any new connections [ServerSocket.accept() will be escaped during server shutdown].Just close the ServerSocket.
    Both these are working fine. But during the 25 seconds, still the client connections gets queued up trying to find that serverNot if you close the ServerSocket.
    reason being the load balancer is still forwarding requests to this server whose shutdown has started but not completed. So CLOSE_WAITS happen.Not if you close the ServerSocket. Not that the CLOSE_WAITS are the actual problem, as they will all disappear when the server exits. It's more that the clients shouldn't have been able to create the connection in the first place. Which wouldn't have happened if you had closed the ServerSocket.
    If we tell load balancer not to send any more client socket connections, then we completely avoid getting CLOSE_WAITS.If you close the ServerSocket ditto.

  • How to send JMS message from pl/SQL to jBoss

    Hi all,
    I need a helping. This is my problem:
    There's a queue which is definitied under the Jboss. I would like send a message from pl/SQL to jBoss.
    Why is't working??
    http://www.oracle.com/technology/sample_code/tech/java/jsp/samples/jms/Readme.html
    thnk's,
    fgy,,

    You can defince a queue in Oracle, then access this queue from your Jboss application. Not sure if you need JMS, but there are some Oracle OCI functions that are certainly helpful for such a task.
    You might look into further details be reading the manual on Oracle Advanced Queuing or Oracle Streams.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14257/part4.htm#i436427

  • Sending ADT message from java

    Hello,
    I'm trying to send an ADT message from Java using the JMS API.
    However, when compiling the java program it complains on the
    following statement :
    adt_msg.setAdtPayload(empmsg) ;
    because it is expecting empmsg to implement the deprecated
    CustomDatum interface instead of the ORAData interface.
    I suspect the problem is linked with the version of the
    AQAPI.jar file I'm using. I tried already the file that comes
    with the Linux version and the one with the W2000 version but
    both give the same problem.
    Any suggestions ????
    tx,
    Roger.

    Hi,
    The AQ JMS api in 9.0.1 still expects CustomDatum payloads. When
    you generate the java class using Jpublisher, use the following
    flag:
    -compatible=customdatum
    In 9.0.2 and iASv2, the AQ JMS api will support the OraData
    interface as well. I think if you can get the 9.0.1.2 patch,
    that also might work
    Bhagat

  • How to pass dynamic values to value mapping? please help!

    Hi Experts,
           I have requirement where I am using email adapter to send emails. Now the "To" email address is different for different environment. In other words:
    DEV - [email protected]
    TEST - [email protected]
    PROD - [email protected]
    When the XI code is migrated to TEST environment the email address will be [email protected] and in production it will be [email protected]
    Similarly, there are many more environments.
    Now to handle this I have decided to use value mapping where Agency refers to the type of environment.
    Now my problem is how do I use it in message mapping.
    I have wriiten a java function that returns me the type of environment. But now how to use this value for value mapping. I mean when using value mapping in message mapping we hardcode the agency (environment type).
    Is it possibel to specify a variable in value mapping for agency. The variable will be populated by java function before connecting to value mapping?
    Please help!
    Thanks
    Gopal

    Hi Gopal,
    why don't you use a "if" after your UDF. Depending on the return parameter of the UDF you call different value mappings?
    Regards Mario

  • Hello there. i lost my Ipad and i need to log out all email and facebook. Also is there any chance get my diary somehow. how can i log out from my Ipad? please help, i have very important information and other stuff in my Ipad?

    I need help to log out from my stolen Ipad. please help.

    If you had installed iOS 7 it would be Activation locked, but I see you only have iOS 5. You do have a backup of you iPad files on your computer or iCloud, don't you?
    If the iPad was running iOS 7, the thief/finder will not ever be able to use it.
    iCloud: Find My iPhone Activation Lock in iOS 7
    http://support.apple.com/kb/HT5818
    Apple (and no one else) can not assist (with serial number or iCloud) in finding a lost or stolen iPad.
    Report to police along with serial number. Change all your passwords.
    These links may be helpful.
    How to Track and Report Stolen iPad
    http://www.ipadastic.com/tutorials/how-to-track-and-report-stolen-ipad
    Reporting a lost or stolen Apple product
    http://support.apple.com/kb/ht2526
    What to do if your iOS device is lost or stolen
    http://support.apple.com/kb/HT5668
    How to Find a Missing iPad with FindMyiPad
    http://www.dummies.com/how-to/content/how-to-find-a-missing-ipad-with-findmyipad .html
    iCloud: Locate your device on a map
    http://support.apple.com/kb/PH2698
    iCloud: Lost Mode - Lock and Trace
    http://support.apple.com/kb/PH2700
    iCloud: Remotely Erase your device
    http://support.apple.com/kb/PH2701
    Report Stolen iPad Tips and iPad Theft Prevention
    http://www.stolen-property.com/report-stolen-ipad.php
    General steps to follow for a Stolen iPad
    http://stolen-ipad.com/
    How to recover a lost or stolen iPad
    http://ipadhelp.com/ipad-help/how-to-recover-a-lost-or-stolen-ipad/
    How to Find a Stolen iPad
    http://www.ehow.com/how_7586429_stolen-ipad.html
    What NOT to do if your iPhone or iPad is lost or stolen
    http://www.tomahaiku.com/what-not-to-do-if-your-iphone-or-ipad-lost-or-stolen/
    Apple Product Lost or Stolen
    http://sites.google.com/site/appleclubfhs/support/advice-and-articles/lost-or-st Len
    Oops! iForgot My New iPad On the Plane; Now What?
    http://online.wsj.com/article/SB10001424052702303459004577362194012634000.html
    If you don't know your lost/stolen iPad's serial number, use the instructions below. The S/N is also on the iPad's box.
    How to Find Your iPad Serial Number
    http://www.ipadastic.com/tutorials/how-to-find-your-ipad-serial-number
    iOS: How to find the serial number, IMEI, MEID, CDN, and ICCID number
    http://support.apple.com/kb/HT4061
    Check the serial number (located on back/bottom) in this lost/stolen iPad database. However, most owners are not aware of this database and don’t enter the serial number.
    Stolen iPad Database
    http://www.stolenlostfound.org/online-stolen-ipad-database
    Also do a search, using the serial number, on your local Craig’s List. Some users list the serial number of a stolen iPad to thwart the sale of a stolen device.
     Cheers, Tom

  • How to send a message from Servlet to JSP

    Dear all,
    I have JSP, with JavaScript (AJAX). If the user click on the button, the text will be sent to a Servlet parsed by doGet() and the user get a response to his input, without reloading a page.
    How can I send a message to the users (JSP) from Servlet, if he didn't clicked any button and to other visitor of the page also? Is it possible? I think like a chat, the server sends a message to all users who are subscribed.
    I don't know, what should I get from user, maybe session, that I could send him personal or common messages in his textarea. I should also invoke some JavaScript function to update his page. I have met some chats, you don't do nothing and get messages. It is also without a JavaScript timer, which invokes doGet() method. Asynchronous, only when there is a message.
    Please help me with a problem.
    Thanks in advance.

    Hai ,
    You can send any message through response.sendRedirect();
    here is the coding try it
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class SimpleCounter extends HttpServlet {
    public void doGet(HttpServletRequest req, HttpServletResponse res)
    throws ServletException, IOException {
    res.setContentType("text/plain");
    PrintWriter out = res.getWriter();
    String username="java";
    res.sendRedirect("http://localhost:8080/yourprojectname/jspfile.jsp?username="+username);
    }

  • How to send Subtopic Message From Server-Side to Client ?

    I’m new at flex and i have a new question about Flex
    Message Service.
    How to send messages from Server-Side Java Code with
    Subtopic?
    For example.
    I customed a Flex Message Adapter in Tomcat Server , with
    this Adapter , i can send message to Client with following code .
    ---------------------Send message to Client------------
    MessageBroker msgBroker =
    MessageBroker.getMessageBroker(null);
    String clientID = UUIDUtils.createUUID(false);
    AsyncMessage msg = new AsyncMessage();
    msg.setDestination("CustomMsgServiceDes");
    msg.setClientId(clientID);
    msg.setMessageId(UUIDUtils.createUUID(false));
    msg.setTimestamp(System.currentTimeMillis());
    msg.setBody(clientID + "this is my message from server! \n");
    msgBroker.routeMessageToService(msg, null);
    ---------------------Send message to Client------------
    But i want send a message that have Subtopic to the Client ,
    How to do ?
    Thank you for reply.

    There's a white paper that talks about this subject -
    http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=8f1eb6ea

  • How to send sms message from webdynpro to mobile

    Hi
    i am working on QA project.when system QA parameters are above standard values ,then i need to send SMS  message to Mobile of supervisor.Can anybody suggest how to implement this?
    Thanks
    Prasad

    Hai,
    Create a web service model for this web servicehttp://www.webservicex.net/SendSMS.asmx?WSDL
    this web service provides sms service through india.
    But it can only work :If your mobile number is 098XXXXXXXX ,Please enter as 98XXXXXXXX
    Create a view with two input fields (ToMobilenumber, from mail Addrees)
    Create a textedit Elemnt (Message).
    Create a button set the parameters to your web service and execute it.
    regards,
    Naga Raju

Maybe you are looking for