Creating a new request in a servlet and proxy it to the next service

Hello all.
My scenario is the following:
- I have a service that when I receive a message request from a user it creates another request and then I want to proxy this new request to the next service.
- Is this possible to do? I'm not talking about using the request.send() method since it tries to send the new request outside the OCMS, I was thinking more of the proxy.proxyTo() method...

Hi Lucas and thanks for the reply.
I think my problem is DNS related. I don't know why but the following code stop to work properly when I installed a new OCMS instance with a diferent realm (I was using example.com and now I'm using the same domain as my company, novabase.pt). I put "172.18.88.21 novabase.pt" in the hosts.config file and the only thing that stopped working is the creation of new requests within the SipServlet.
The code:
SipApplicationSession applicationSession =
req.getApplicationSession();
Address to = req.getTo();
Address from =
getSipFactory().createAddress(convertMobile2Address(req.getFrom()));
SipServletRequest request =
getSipFactory().createRequest(applicationSession, "MESSAGE",
from, to);
Object content = req.getContent();
String contentType = req.getContentType();
request.setContent(content, contentType);
from.setDisplayName(req.getFrom().getDisplayName());
request.setHeader("P-Asserted-Identity",
req.getTo().getURI().toString());
System.out.println(request);
request.send();
SipServletResponse response =
req.createResponse(200, "Enderecos trocados!");
response.send();

Similar Messages

  • How to create a new document type for PO and Requisition

    Hi All
    Can you please help me with the steps of creating a new document type for PO and PR. Also the steps that need to be update for the procure pay cycle to work properly. 
    Once the document type is been created. I want to create the PO referecing the new PR and PO document type.I am new in MM.
    Thanks, Ros

    Hi,
    1. You can create new PR and PO docu types at the following path:
    For PR docu type:
    First you need to create number range for docu type or you can use existing number range also. The path for creation of no. range is
    SPRO>Materials Management->Purchasing->Purchase Requisition->Define Number Ranges
    Then create PR docu type at below path and assign no. range to PR docu type here only
    SPRO>Materials Management->Purchasing->Purchase Requisition->Define Document Types
    For PO docu type:
    Follow same procedure as mentioned for PR docu type. Path is
    SPRO>Materials Management->Purchasing->Purchase Order->Define Number Ranges
    SPRO>Materials Management>Purchasing->Purchase Order->Define Document Types
    If you want to create PO referencing new PR docu type, link the PR docu type to PO docu type at below path:
    SPRO>Materials Management->Purchasing->Purchase Requisition->Define Document Types--> Link purchase requisition - document type
    Regards
    Chetan

  • To create a new file in application server and transfer data to ti

    i am doing the following where i have to create a new file in application server and transfer data to tht file from an internal table.but its saying file cant be opened.the path i am giving to parameter p_prefil is /tmp/prachi.txt.
    wats the prob..can anyone help.
    DATA:L_WA_FINAL TYPE TY_FINAL,
         l_wa_string type string.
    OPEN DATASET P_PREFIL FOR OUTPUT IN text mode encoding default.
    if sy-subrc <> 0.
    write: ' file cannot be opened'.
    stop.
    endif.
    LOOP AT P_I_FINAL INTO L_WA_FINAL.
    move l_wa_final to l_wa_string.
    TRANSFER l_wa_string TO P_PREFIL.
    if sy-subrc <> 0.
    write: 'file can not be written'.
    stop.
    endif.
    clear l_wa_final.
    ENDLOOP.
    CLOSE DATASET P_PREFIL.
    if sy-subrc <> 0.
    write: ' file cannot be closed'.
    stop.
    endif.

    DATA:L_WA_FINAL TYPE TY_FINAL,
    l_wa_string type string.
    OPEN DATASET P_PREFIL FOR OUTPUT IN text mode encoding default.
    if sy-subrc ne 0.
    write: ' file cannot be opened'.
    stop.
    endif.
    LOOP AT P_I_FINAL INTO L_WA_FINAL.
    move l_wa_final to l_wa_string.
    TRANSFER l_wa_string TO P_PREFIL.
    write: 'file can not be written'.
    clear l_wa_final.
    ENDLOOP.
    CLOSE DATASET P_PREFIL.
    if sy-subrc ne  0.
    write: ' file cannot be closed'.
    stop.
    endif.

  • How do I create a new document in Photoshop CC and have it 300 dpi?

    How do I create a new document in Photoshop CC and have it 300 dpi? I am doing digital scrapbooking and need to have my layout in Photoshop 12 x 12 so it is a scrapbook page and 300 dpi and I hope this doesn't sound stupid but I don't even know what dpi means.
    Thank you

    File>New
    Set preset to print or US Paper
    (typing width and height values will change the preset to custom)
    Set width to 12 inches
    set height to 12 inches
    set ppi to 300 (should already be this if you used the print preset)
    Click OK

  • How to create a new request for function group?

    Hi Friends,
    My client has changed their development server. Now all the objects in old DEV server are transfered to new one. Except for function group objects, we have created new change request number for all others. Now I need to create a new request for function group objects. Can anyone suggest which transaction code I have to use for this purpose?
    Thanks,
    Kaarthick.V

    Hi Karthick,
    If you want to Change the request for your FG means,
    1. Go to SE80 ->  work bench ->  Edit object.
    Here you have the option two change the request.
    or If you want to create the Function Group means,
    Go to SE80 -> Select Function Group -> Enter name -> press Enter
    Thanks,
    Reward If Helpful.

  • How to create a new Structure of Data screen and screen sequence

    Hi,
    Can you give any link or explain all the steps required to create a new structure of data screen and how to assign it to our comapnay code or plant etc.  also when i check the screen ref. which is assign to material type in OUR system i ROH but i have not found this ref. in OMT3B where i can see the screen ref. ROH as this the the standard.
    regards,
    zafar

    Hi
    Download the pdf's from the below link
    http://www.pdf-search-engine.com/sap-mm-configuration-pdf.html
    It will help
    Thanks,
    Raman

  • Created three new users without Apple IDs and they can't log into either of my Macbook Pro or Mac Mini running Mountain Lion.

    I have created three new users without Apple IDs and they can't log into either of my Macbook Pro or Mac Mini running Mountain Lion.  These accounts are for my kids and originally were setup with parental controls and time constraints.  Thinking this was the problem I removed the time constraints, removed the parental controls, deleted and re-added them, and made them standard users.  I have reinstalled, used disk utility to repair permissions, and made them admins.   Any help is appreciated.

    Users don't need Apple ID's. That's not the issue. Have you tried repairing permissions their accounts?
    http://osxdaily.com/2011/11/15/repair-user-permissions-in-mac-os-x-lion/
    Repairing User Permissions in OS X Lion
    You’ll need to reboot to perform this, and then use the same resetpassword utility that is used to change passwords in Lion, but instead choosing a hidden option.
    When you use the Disk Utility app and Repair Permissions — it doesn’t actually repair the permission settings on folders and files in your Home folder where your documents and personal applications reside.
    In Lion, there is an additional Repair Permissions application utility hidden away. This tool is located inside boot Repair Utilities. Here’s how to access it.
    Restart Lion and hold down the Command and R keys.    You will boot into the Repair Utilities screen. On top, in the Menu Bar click the Utilities item then select Terminal.
    In the Terminal window, type resetpassword and hit Return.
    The Password reset utility launches, but you’re not going to reset the password. Instead, click on the icon for your Mac’s hard drive at the top. From the drop-down below it, select the user account where you are having issues.
    At the bottom of the window, you’ll see an area labeled ‘Reset Home Directory Permissions and ACLs’. Click the Reset button there.
    The reset process takes a couple of minutes. When it’s done, quit the programs you’ve opened and restart your Mac. Notice that ‘Spotlight’ starts re-indexing immediately.

  • HT1918 why do i have to create a new itunes account because I moved to Canada from the U.S.?

    why do i have to create a new itunes account because I moved to Canada from the U.S.?( My current account won't let me change my address to canada so my billing address for account is incorrect, making it impossible for me to buy anything). Will it affect what I am able to put on my device i.e. already downloaded apps, music, etc?

    fayry wrote:
    ... how do I move over my purchases from my current account to my new account?
    This is not possible...
    Anything Downloaded with a Particular Apple ID is tied to that Apple ID and Cannot be Merged or Transferred to a Different Apple ID.
    Apple ID FAQs  >  http://support.apple.com/kb/HE37

  • I have a created a directory structure ias\ias-samples\myapps\src\docroot.In docroot folder i have a single jsp.i created a war file having that jsp,and ear file having the war file

    I deployed the ear file.Now i try calling http://localhost/myapps/test.jsp ??
    i'm i doing the right thing ?

    Hi,
    This is right provided you have installed the webserver & app server
    on the same machine and the port number for the web server is 80 by
    default.
    Regards
    Raj
    Arif Khan wrote:
    I have a created a directory structure
    ias\ias-samples\myapps\src\docroot.In docroot folder i have a single
    jsp.i created a war file having that jsp,and ear file having the war
    file
    I deployed the ear file.Now i try calling
    http://localhost/myapps/test.jsp ??
    i'm i doing the right thing ?
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

  • Can I create a JAR that is an Applet and Desktop app at the same time?

    Hi mates.
    Can I create a JAR that is an Applet and Desktop app at the same time?
    Thanks.

    Ricardo_Ruiz_Lopez wrote:
    ..I have one problem, I want a JMenuBar but I can't add it inside a jPanel.
    Any idea?
    SSCCE
    It can be compiled/run as an applet or application something like this (e.g. for a Win command prompt).
    C:\Users\Andrew\Hybrid> javac Hybrid.java
    C:\Users\Andrew\Hybrid> java Hybrid
    C:\Users\Andrew\Hybrid> appletviewer Hybrid.java
    C:\Users\Andrew\Hybrid> // YES the previous line requires a '.java'  suffix - trust me.  ;-)Code
    // <applet code='Hybrid' width='600' height='400'></applet>
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class Hybrid extends JApplet {
        public void init() {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    GUI gui = new GUI();
                    getContentPane().add( gui.getMainPanel() );
                    setJMenuBar( gui.getMenuBar(false) );
                    validate();
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    JFrame f = new JFrame("Test Hybrid");
                    f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
                    GUI gui = new GUI();
                    f.setContentPane(gui.getMainPanel());
                    f.setJMenuBar(gui.getMenuBar(true));
                    f.pack();
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    class GUI {
        private JPanel mainGui = null;
        private JMenuBar menuBar = null;
        public JPanel getMainPanel(){
            if (mainGui==null) {
                mainGui = new JPanel( new BorderLayout(3,3) );
                mainGui.setBorder( new EmptyBorder(5,5,5,5) );
                JToolBar tb = new JToolBar();
                for (int ii=1; ii<6; ii++) {
                    tb.add( new JButton( "Btn " + ii) );
                    if (ii%2==0) {
                        tb.addSeparator();
                mainGui.add(tb, BorderLayout.NORTH);
                mainGui.add( new JSplitPane(
                    JSplitPane.HORIZONTAL_SPLIT,
                    new JScrollPane(new JTree()),
                    new JTextArea(20,20)
                    ), BorderLayout.CENTER );
                mainGui.add(new JLabel("Main user interface.."), BorderLayout.SOUTH);
            return mainGui;
        public JMenuBar getMenuBar(boolean isFloating) {
            if (menuBar == null) {
                menuBar = new JMenuBar();
                if (isFloating) {
                    JMenu fileMenu = new JMenu("File");
                    fileMenu.add( new JMenuItem("Exit") );
                    menuBar.add( fileMenu );
                JMenu helpMenu = new JMenu("Help");
                helpMenu.add( new JMenuItem("About") );
                helpMenu.add( new JMenuItem("Help") );
                menuBar.add( helpMenu );
            return menuBar;
    The code is not intended to be well designed. It is just written to be brief and demonstrate a few points.
    Edit 1:
    Added some access keywords in a passing gesture that the sample aimed at encapsulation.
    Edited by: AndrewThompson64 on Sep 2, 2010 1:34 PM

  • I downloaded the new 6 software. Me and my boyfriend share the same iTunes account and now every time I text him I also get a copy of the text sent to my from my number. How do I get that to stop?

    I downloaded the new 6 software. Me and my boyfriend share the same iTunes account and now every time I text him I also get a copy of the text sent to my from my number. How do I get that to stop?

    Go to settings > messages > send & receive
    check or uncheck the correct phones numbers and/or email addresses

  • I used to share one apple ID/account with my ex but made a new one for myself recently and logged out of the old one but when I try to update my iBooks it asks for the old account's password(which my ex changed by now)

    I used to share one apple ID/account with my ex but made a new one for myself recently and logged out of the old one but when I try to update my iBooks (only happens with this app)it asks for the other account's password(which my ex changed by now). I don't understand why this happens when I'm logged into my account and it only happens with that app. Please help, I need to update. :/

    Content (apps, music, ibooks, films etc) is tied to the account that originally downloaded it, so if the iBooks app was downloaded using the account that you used to share with your ex then only that account can download updates to it. As it's a free app you could delete it and re-download it under your own account - and then re-download your ibooks into it (or copy the books to your computer's iTunes first via File > Transfer Purchases and then sync them back to the app).

  • Since latest ios update, my iphone 6 loses my ringtones. I download new and that's gone the next day too

    Since latest ios update, my iphone 6 loses my ringtones. I download new and that's gone the next day too. How can I get my phone to keep my ringtones?

    Most USB port do not supply enough current to charge the iPad.

  • Good night recently my iphone 4s was exchanged for a new one because was defective and was in warranty. the problem is that now I try to use the same apple id on itunes and applications while had bought the old iphone does not appear and I think should ap

    good night recently my iphone 4s was exchanged for a new one because was defective and was in warranty. the problem is that now I try to use the same apple id on itunes and applications while had bought the old iphone does not appear and I think should appear. Can someone help?

    ?

  • I just got a new iphone 4 for att and my friend installed the sim card in it for me. the imessage function isnt connecting with the my cell number. a while back i had logged into my apple account on someone elses cell phone and their number keeps showing.

    i just got a new iphone 4 for att and my friend installed the sim card in it for me. the imessage function isnt connecting with the my cell number. a while back i had logged into my apple account on someone elses cell phone and their number keeps showing. when i try to just select my number to send and recieve imessages from it will not show up. i can send and recieve regular text but not pictures or imessage. i have tried logging off and restarting and nothing has worked.help please!!

    Did you remove your account information from the other person's iPhone?

Maybe you are looking for

  • Additional copies of deleted iPhoto Photo Books

    Can I somehow get an additional copy of a Photo Book that I composed and had printed and mailed within the last month? I didn't make a copy for myself. My hard drive just went down a couple of days ago and I lost these most recent photos (my iDisk wa

  • End users not able to export a report to a spreadsheet

    Hi Gurus, My end users not able to export a report to a spreadsheet.. version     : ECC 6.0 Release    : 7.10 support Package 14 Currently the end user has 6 choices for creating spreadsheets if the selecte the "All Available Formats" option when gen

  • SAP BW-BPS

    Hi all, Am very new to BW-BPS. i know how to create transactional infocubes and bit abt BPS. I had searched the topics related to BPS in forums but didnt get ant step by step method. Plz let me know 1. How to get in to BPS in BW 2. How to create plan

  • How i can print the Stacktrace

    hii.. i want to print the stacktrace for my program below.. package Langpack; import java.io.*; import java.sql.*; import java.util.*; public class LanguageFunctions extends Databaseclass      public LanguageFunctions()      super();      LanguageDet

  • Transitions flicker and flash when exported

    Most of my clips have movement to them. The dissolve transitions have the green bar above them. After rendering these simple dissolve transitions in Final Cut, everything looks great. Playing within the program works perfectly. After "Export Movie" t