Getting two differents UrlConnection.inputStream() over the same Session

I need to access two diferents webservices by GET method but to access the second one the session created by the first must be alive. Till now, I got something like the following code but this code doesn�t let session keep alive. I would like to advise that I cannot use web tools like servlets to manage this =/
DocumentBuilderFactory dbf;  
   DocumentBuilder docBuilder;  
   public ClasseXML(){  
      dbf = DocumentBuilderFactory.newInstance();  
      try {  
         docBuilder = dbf.newDocumentBuilder();  
      } catch (ParserConfigurationException e) {  
         alerta("Parsing error: "+e.getMessage());  
   public void request1(String params) {  
      try{     
         String url = myHost+"/"+params;  
         Document doc = docBuilder.parse( new URL(url).openStream() );  
   public void request2(String params) {  
      try{  
         String url = myHost+"/"+params;  
         System.out.println( url );  
         Document doc = docBuilder.parse( new URL(url).openStream() );  
...  

So you are connecting to Server X, and you want to send two web service requests to that server? And you want the server to process both requests in the same session?
If that's what you mean, then you have to do whatever the server wants you to do to maintain the session. Often servers send a cookie to the client and require it to be sent back to maintain a session, but that's not the only way. Your first step is to find out how the server is maintaining the session. If there's no published information about that, and you have nobody to ask, then you would have to reverse engineer the requests and responses in a normal session.
Then you would have to write your code to send the same requests and handle the responses accordingly.

Similar Messages

  • Two components do PublishedStaticFiles over the same file, who wins?

    Hi,
    I use UCM 11G PS4.
    Does anyone knows how PublishedStaticFiles is working, I know it publish
    resources into the weblayout/resources/wcm/custom.
    But does anyone knows what happens if two components try to publish same file?
    I will expect that Content Server to merge the 2 published files into one
    depending by loadOrder.
    Can anyone tell me what is the difference between PublishedStaticFiles and PublishedWeblayoutFiles?
    Regards,
    Cipi

    The PublishedStaticFiles and PublishedWeblayoutFiles tables are essentially the same thing, in that they both define where to publish in the Weblayout folder/directory. However, PublishedStaticFiles is used to publish static items like images, while PublishedWeblayoutFiles is generally used to publish dynamic items like layouts. When you're in the config manager, the "Publish static layout files" and "Publish dynamic layout files" publish those tables, respectively. A brief overview can be read on Kyle's post.
    As far as merging published files, no, that is not possible. The Content Server publishes all component files, but if any have the same file name, the component with the bigger (higher) loadOrder will "win" and its file will override the other.
    For instance, in the .hda file of the component you want to be loaded, you'll have:
    @ResultSet MergeRules
    4
    fromTable
    toTable
    column
    loadOrder
    SSOPublishedStaticFiles <-- your table that defines where in the weblayout directory you want to publish your files to
    PublishedStaticFiles
    null
    500 <--loadOrder (set the value to something big like 500)

  • How can I get two cameras to aquire at the same time rather than one after the other

    I've got (2) PCI-1428 cards, Two Uniq Vision cameras with power supplies, cameralink cables, and IMAQ-D6804 cables. Both cameras are being triggered by the same switch, but they are not grabbing images at the same time. Right now it is triggering one camera as desired, but the other doesn't aquire until after the time-sensitive event. On the next test, the two camera will trade these roles. I am using 2 cards, so they should acquire at the same time. How do I change it so that they grab images at the same time? Thank you for your help.
                                                      ​            Deater

    Hi Deater,
    Thank  you for your post.  Triggering from two cameras at the same time may be a little trickey, but it can be done.  There are multiple ways to tackle this problem.  If you have a RTSI cable, you can RTSI the two PCI boards together internally to lock them in HW.  You should also be able to use the triggering line on each board.
    One of the best methods for triggering multiple boards is called GenLocking.  The following Developer Zone page describes GenLocking more fully and has several examples to help you out: http://zone.ni.com/devzone/conceptd.nsf/webmain/a3​87b5c0ac6f6f4e86256c87005fcddf.
    The "HL Grab with two boards.vi" shipping example is also a good example of the code needed to trigger two individual boards in LV.  I found a similar post that may be of some help as well: http://forums.ni.com/ni/board/message?board.id=230​&message.id=2691&requireLogin=False
    Hope this helps!
    Thanks,
    Scott Savage
    National Instruments
    Applications Engineering
    www.ni.com/support

  • How can i get two or more people on the same call on iPhone 5

    On my blackberry I can make a call, and then call other people and add them to the call so we have several people on the same line. Is it possible to do this with an
    iphone 5?

    See page 51 of the iPhone User Manual.
    You can add folks to a call only if you use a GSM carrier.
    iPhone User Guide for iOS 8.1

  • I am still trying to get two funtions to run AT THE SAME TIME within my vi, but to no avail.

    I am trying to capture a signal with a daq card (PCI-MIO-16E-4) WHILE I have a picture box switch back and forth between grey levels. It is absolutely necessary that they both happen simultaneously, but what is happening is that the picture box stops switching while the DAQ is capturing the signal. Can someone take a look at this and offer some suggestions, or just see if you can get this thing to work. The vi is simple and should be straight forward, right? I have had some suggestions on a previous fishing expedition, but none worked. If you try this vi, set the scan rate to 5000, and the # of scans to 15,000. P.S. I am running labview 6.1 if that makes any differenc
    e. Thanks for your attention.
    Attachments:
    Acq_N_Scans_to_File_(wdt)_with_flicker_2while.vi ‏135 KB

    Hi Planar,
    You have been trying hard!
    I am not sure the following will help, but I would like you to try it out.
    I have restructured your code to help reduce the work that is done while data is acquired.
    1) I "pre-compute" the pictures at app start-up. This way only the pictures need updated and the pictures are rendered repeatedly.
    2) I moved your config up front so it does not run while the flickering is going on.
    3) I add a check of the backlog from the DAQ that looks at the number of scans waiting in the buffer WITHOUT reading the data. Only when the requested # of scan are ready is the data read.
    4) While waiting for the buffer to fill, the daq loop will execute a wait, thereby freeing CPU for the flicker tasks.
    Your code, w
    ith my changes is attached (in LV 7.0).
    A jpg is included for non-LV-7.0 readers.
    Yes, the code is sloppy! I am woring fast and for free!
    No, I do not have DAQ hardware to test so it may NOT work right out of the box.
    I hope this helps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    Flicker.vi ‏152 KB
    Flicker.JPG ‏157 KB

  • Can I get Two numbers for iMessage in the same Apple ID?

    I have an iPhone and an iPad and I would like to be reached with different numbers. But when I log to my Apple ID, I just have one Number! In iPhone I have one number to voice call or face time and in my iPad I have another number for wifi+cell!

    Creating a new iTunes account does not remove any purchases made on a different account.
    If you want to create a new account : iTunes: How to set up an Apple ID within iTunes
    Or if you will want to use it in the stores and don't want to give credit card details : Create an iTunes Store, App Store, or iBooks Store account without a credit card or other payment method
    Or if you are not currently logged into an account in game centre then you should have a 'create a new Apple id' link at the bottom of the login screen in it.

  • Getting two computers to run on the same internet line but to far to use wireless router.

    i have my main computer in the house using westell 6100 and linksys wireless, but it will not reach, (distance wise) to the garage, where I have a phone line and want to use my laptop.  Can i hook up another router to that phone line?

    In order to avoid board clutter, we ask that you post your topic on one board only.
    Please look ---> HERE for replies to your topic. Thank you.
    If a forum member gives an answer you like, give them the Kudos they deserve. If a member gives you the answer to your question, mark the answer that solved your issue as the accepted solution.

  • Is it possible that Exchange UM could be configure with two call managers over the same sip?

    Hi,
    I have Cisco call manager 8.2 integrated with Microsoft Exchange Server 2010 Unified Messaging.
    Call manager has primary and secondary server. I created a sip trunk and linked primary CUCM with Exchange. Users can leave and get voice mails.
    Problem: In case that primary server is down (WAN is down) the users registered on secondary server but they cannot contact to Exchange Unified Messaging.
    I added  new UM Dial Plan with the same pilot and associated it to the secondary CUCM server. UM answered but do not recognize the extension number "is not a valid mailbox extension".
    Is it possible that Exchange UM could be configure with two call managers over the same sip, the same pilot number, different associated UM servers and get access to the same voice mail boxes?
    If not:
    Does exist a way to configure Exchange UM that will work if one CUCM server is down?
    Thank you,
    Peter

    Hi,
    I have Cisco call manager 8.2 integrated with Microsoft Exchange Server 2010 Unified Messaging.
    Call manager has primary and secondary server. I created a sip trunk and linked primary CUCM with Exchange. Users can leave and get voice mails.
    Problem: In case that primary server is down (WAN is down) the users registered on secondary server but they cannot contact to Exchange Unified Messaging.
    I added  new UM Dial Plan with the same pilot and associated it to the secondary CUCM server. UM answered but do not recognize the extension number "is not a valid mailbox extension".
    Is it possible that Exchange UM could be configure with two call managers over the same sip, the same pilot number, different associated UM servers and get access to the same voice mail boxes?
    If not:
    Does exist a way to configure Exchange UM that will work if one CUCM server is down?
    Thank you,
    Peter

  • When our iPad is in use on the internet, my iMac internet connection goes off. I can't get the two devices to work at the same time with the AirPort Express. Is there a setting somewhere I may have missed?

    When our iPad is in use on the internet, my iMac internet connection goes off. I can't get the two devices to work at the same time with the AirPort Express. Is there a setting somewhere I may have missed?

    When two or more devices conflict it typically means that the DHCP service is either misconfigured or is not running at all. DHCP provides IP addresses to local network clients.
    Is your AirPort Express base station the only router in your current network configuration? That is, is it connected directly to an Internet modem and not to another router upstream of it?

  • How do i get my team to all see the same say, ID, document using the cloud?

    how do i get my team to all see the same say, ID, document using the cloud?

    Adobe Max was a smoke and mirror show and they demonstrated "Folder Sharing" so we bought into it. Myself and 7 of my clients. After the Max show they turned it off like nobody would notice. Two weeks after they stopped the folder sharing feature they put a little notice that they had did this. Nice how they treat their loyal customers. Every month they charged us an extra $20 over a single account without the folder sharing. What good is "team work" if you can't share a folder of files. Sharing a single file at a time is a waste of time.
    After a year still no folder sharing but the same old story of "soon". Adobe is using the extra money they are "stealing" from paying clients to pay for this development. We are being forced to pay the extra money again for another year as there is no way to downgrade to a single user account. Adobe likes to use this as an excuse to continue to rob and steal from loyal user that have no choice but to deal with these crooks.
    My only suggestion is for new users not to buy the team account package. There marketing material is filled with misleading statements that gives the potential new customer the impression that they can work in teams, as if a team can  work sharing single files. This is a sign that Adobe is about the cash grab and not about the quality of software and the end user experience.

  • Is there any way to judge whether two streamings are casted by the same client?

    Hello,
    My app use two different streams to send video and audio from flash clients to the server.
    So another client need to judge whether two streamings are casted by the same client or not.
    Is there any way to do this?
    For example, if it is possible to get ip address from netStream instance, it will be a solution.
    Could anyone teach me this?
    Thanks in advance!

    From the FCP 7 User Manual. You can access your copy of the Manual through the HELP menu on the menu bar at the top of your main screen.
    x
    Subtract Composite Mode
    Subtract darkens all overlapping colors. Whites in the foreground image go black, while whites in the background image invert overlapping color values in the foreground image, creating a negative effect.
    Blacks in the foreground image become transparent, while blacks in the background image are preserved.
    Overlapping midrange color values are darkened based on the color of the background image. In areas where the background is lighter than the foreground, the background image is darkened. In areas where the background is darker than the foreground, the colors are inverted.
    The order of two clips affected by the Subtract composite mode is important.
    Difference Composite Mode
    The Difference composite mode is similar to the Subtract composite mode, except that areas of the image that would be severely darkened by the Subtract composite mode are colored differently.
    The order of two clips affected by the Difference composite mode does not matter.

  • Is there a way to work with two or more app at the same time on iPhone or iPad

    Is there a way to work with two or more app at the same time on iPhone or iPad?

    What i am attempting to achieve is to work with at least two app at the same time. For example: select any picture from my albums to attach them in an email. Another example is get data from an app to use it with the calc app. And there are more exaples for it. And for sure I need support for an iPad air. I mencioned the other tablet just to try to be a bit clearer.

  • Can two apple TV's in the same house share one itunes library?

    Can two apple TV's in the same house share one itunes library and play different movies at the same time?

    I have two ATV G2 and one ATV G1 at home with the same iTunes library. I have played two different movies in the ATVs. One interesting thing you get is that you can start one movie and pause it and then you can continue playing it in the other ATV. The iTunes controls where you pause or stop the movie.
    Agree that bandwidth is the limit here and probably the server throughput. But, so far I haven't experienced any problem.

  • How to avoid that two or more people altering the same Sales Order

    I'm looking for a way to avoid that two or more people altering the same Sales Order at the same time.
    If someone has entered a Sales Order in the system and something needs to be adjust it can be done by two or more people at the same time. The problem is that when someone is saving these changes, the changes of another person, who is still working on the same order, get lost.
    So what we need is an alert that someone is already using this order and that no other person can make any changes at that time. So the order needs to be blocked for altering for any other person at that time.
    To avoid this I think you have to do something with the Stored Procedure. Or has someone a more simple and better solution. So far I didn't find a standard option in Business One neither a solution in this forum.
    Best regards,
    Tim

    Tim,
    There is nothing in the application settings in Business One that could be used to prevent this.  You may post this to the SDK forum as well and perhaps there is a way to achieve this through SDK.

  • How to avoid that two or more people alter the same Sales Order same time

    I'm looking for a way to avoid that two or more people altering the same Sales Order at the same time.
    If someone has entered a Sales Order in the system and something needs to be adjust it can be done by two or more people at the same time. The problem is that when someone is saving these changes, the changes of another person, who is still working on the same order, get lost.
    So what we need is an alert that someone is already using this order and that no other person can make any changes at that time. So the order needs to be blocked for altering for any other person at that time.
    To avoid this I think you have to do something with the Stored Procedure. Or has someone a more simple and better solution.
    I've already put this thread in the Business One forum and someone suggested to put it in the Business One SDK forum, as there isn't a solution in Business One itself.
    So if someone can give me a direction for a solution I would be very pleased.
    Best regards,
    Tim

    Hi Tim,
    The only thing that comes close to what you want in standard SBO is Data Ownership. However, this can't stop someone editing a document that is already being edited.
    You can't use stored procedures to track which document is open because the SBO_SP_TransactionNotification proc (which is the only one that you are able to customise) is triggered when a document is updated or added (or cancelled or closed) and not when the document is actually being edited in the user-interface.
    You could do this by writing an addon that uses the UI API to trap events in the sales order form. In theory, a sales order is being edited if the sales order form is in Update mode (ie in order for the form to be in Update mode, the user must have selected an existing document and changed the value of at least one field). You can trap the event of the user changing a value and then log the user and document in a table. When other users try to edit the same document, you could check the table and then prevent them changing values. When the first user clicks on the update button (or cancels the update or closes the form etc etc) you can remove the lock on the document. However, I have doubts as to how robust it would be. The problem with this kind of locking solution is that you sometimes get 'stranded' locks (eg user was editing a document when their workstation crashed) and the solution can end up being more troublesome than it is worth.
    Kind Regards,
    Owen

Maybe you are looking for