How can I get the original xml code to a webservice called...

I use WL 10.3.

I created a WebService using WSDL as a starting point. The Web service is running as it should, but now I want to go back to the original XML that was passed in.

I tried to collect the data to a string using JAXB, but he complains that there is no notation for @XmlRootElement - so, who does not work.

I also tried to access the original data by injecting the WebServiceContext, but this value is always zero (not sure why that doesn't work)...


Is someone can you PLEASE tell me how can I get the original XML code?
Advertisement

You can use managers to this end, for example,

package server.handlers;

import javax.xml.transform.Source;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.stream.StreamResult;
import javax.xml.ws.LogicalMessage;
import javax.xml.ws.handler.LogicalHandler;
import javax.xml.ws.handler.LogicalMessageContext;
import javax.xml.ws.handler.MessageContext;

public class ServiceLogicalHandler implements LogicalHandler {

    public boolean handleMessage(LogicalMessageContext context) {
        Boolean direction = (Boolean) context.get(LogicalMessageContext.MESSAGE_OUTBOUND_PROPERTY);
        if (direction) {
            System.out.println("LOGICAL - DIRECTION IS OUTBOUND");
        } else {
            System.out.println("LOGICAL - DIRECTION IS INBOUND");
        }
        return true;
    }

    public boolean handleFault(LogicalMessageContext context) {
        Boolean direction = (Boolean) context.get(LogicalMessageContext.MESSAGE_OUTBOUND_PROPERTY);
        if (direction) {
            System.out.println("LOGICALFAULT - DIRECTION IS OUTBOUND");

            LogicalMessage message = context.getMessage();
            Source payload = message.getPayload();
            try {
                Transformer transformer = TransformerFactory.newInstance().newTransformer();
                transformer.transform(payload, new StreamResult(System.out));
            } catch (TransformerException ex) {
                ex.printStackTrace();
            }
        } else {
            System.out.println("LOGICALFAULT - DIRECTION IS INBOUND");
        }
        return true;
    }

    public void close(MessageContext context) {
    }
}

More information on managers can be found here: http://www.javaworld.com/javaworld/jw-02-2007/jw-02-handler.html

Tags: Oracle

Similar Questions

  • How can I get the six digit code for my iPad Pro? I have two other iPads and an iPod but I enter the codes I get and the Pro is just off!

    How can I get the six digit code for my iPad Pro? I have two other iPads and an iPod but I get the codes I get and the Pro is just disabled for longer and longer whenever he rejects these codes!

    If you have forgotten the password for your iPhone, iPad or iPod touch, or your device is disabled - Apple supports

  • In windows movie maker, I'm trying to open an old project. It opens, but there is no video clips - only x or empty clips. How can I get the original film clips show?

    In windows movie maker, I'm trying to open an old project. It opens, but there is no video clips - only x or empty clips. How can I get the original film clips show?

    I did a movie and released a dvd. Then, I moved my files from movie on an external hard drive to store files and free up space on my computer. So I went back to try a pull up the project and got every X / white clips. So now, I rebooted my computer with the video files I removed on the external hard drive and it still shows empty clips.
    Help.

    The red Xs indicate that Movie Maker cannot find the original source files.
    If the files are still available... just right click on the red Xs and go to the
    current location of the files source and you may be able to restore the
    path.

  • How can I get the original software after I reinstalled the window

    I want to reinstall windows on my laptop, I just want to know how can I get the software provided with this laptop.

    What happened to reinstall window8

    Your laptops support page will be a few, but before installing Windows 8 you did a set of recovery discs so you can return to Windows 7?

    We can get the HP for a set of recovery discs and Once you're back, there is a file on the 'C' drive named SwSetup

    has little almost all software pre-installed that comes with the machine when you were at 7 W.

    Your statement is not clear enough, I hope that I understood it.

  • How can I get the original Yosemite Setup program to reinstall?

    I need to install Yosemite on my Mac and have not been able to get the original installation file. How can I get?

    If you have previously from the Mac App Store, sign in with the same Apple ID and click the purchases tab. If this is not the case, go to a physical store of Apple and ask.

    (142534)

  • How can I get the original icon HP Quick Launch (NOT the shortcut!) on my DESKTOP?

    I have a HP 2000 t - 2d 00 Notebook PC with operating system Windows 8.1.  The computer was recently repaired, but when I bought it, it had initially provided with HP Quick Start icon (square blue tile - like appearance with the rocket / is NOT a shortcut with an arrow inside!)

    Once it has been repaired, the original official HP QuickStart icon was on the desk.

    However, something happened, I have no idea what (!), and the original official HP QuickStart icon disappeared from the desktop!

    I would be very happy if someone could tell me how to get the original icon HP Quick Start (blue tile in appearance as square with the rocket) on my desk.

    I don't want a shortcut; I know how to create a shortcut!  I am certainly difficult and would like to have some things on the desktop exactly the way they were when I came to the computer.

    Thank you very much to all those who can help me.

    You missed my questions in my first reply to your message!  The link you provided for the program that can get rid of the arrows on the desktop shortcut icons does not have audio, or am I missing something?

    And since you said I could try a system restore before that the icon has been "modified" - does this mean that the original icon, when I got the computer brand new, * has * indeed an icon for HP Quick Launch / is NOT a shortcut?

    Thank you.

    Great-tree Deku wrote:

    Hey @BJ22 ,

    Welcome to the HP Forums!

    I understand you are trying to add the quick launch of HP on the desktop of your laptop.

    The icons on the desktop for programs preinstalled by HP are actually shortcuts. The executable file can be moved from its installed location without breaking the connection to the .dll for the software files.

    If the arrow bothers you, you can use this light application to remove the arrows from shortcut icons: Windows shortcut arrow editor.

    You can also try to restore until the icon has been changed. Using Microsoft System Restore (Windows 8).

    I hope that it is a viable solution for you.

  • How can I get the html source code of beeing displayed page?

    In the previous version of Firefox (4) the view menu contained option 'page source '. In the current version (6) this option disapired.

    Oops! I have it! Been moved from Tools/Web Developer / Source Page.

    See you soon,.

    Peterat

  • How can I get the color codes for the notebook

    How can I get the color codes for the notebook?

    Hello

    What is the color codes for the notebook?

    Perhaps you need a 3rd party utility like GetDiz - Free and others to be
    found using BING or Google.

    GetDiz Notepad - free - replacement
    http://www.Outertech.com/en/Notepad-replacement

    I hope this helps.

  • How can I get the lone original on my XP

    Original title: How can I get the lone original on my XP, I tried the suggestions, do not work I have 9 recovery disks

    I want just a copy of the card game solitaire original supplied with my XP.  It has completely disappeared from my computer.  I don't have a recovery disk.  However, I copy the files loaded from the purchase, there are 9 CD with this recovery info.  I don't know how to find the program.

    How do you have

    Copy the files loaded from the purchase

    The file you're looking for is sol.exe and it should be in C:\Windows\system32 and C:\Windows\system32\dllcache (because it is one of the files monitored by the Windows File Protection).

    If you have a C:\i386 folder, you can develop C:\i386\sol.ex_ sol.exe using the EXPAND command in a command prompt window.

    It's

    (Start > run > cmd > OK)
    expand C:\i386\sol.ex_ c:\windows\system32\\dllcache\sol.exe
    expand C:\i386\sol.ex_ c:\windows\system32\sol.exe

  • How can I get the activation code for PC Defender?

    I have a dell netbook.  It has viruses on it.  PC Defender is constantly on it saying that if I put in the activation code sent to my e-mail address, it will remove the virus.  The code was never sent.  I can't access it from my netbook, but I can check my email from my other laptop.  How can I get the activation code so can clean my netbook?

    PC Defender is a rogue security application.  It is also a malware!  You can remove it by following these instructions:
    http://www.bleepingcomputer.com/virus-removal/remove-Windows-PC-Defender
    Trader2100

  • I have a hp laptop and the original key of windows behind the laptop which is glued is half damaged then, how can we get that original key again?

    I have a hp laptop and the original key of windows behind the laptop which is glued is half damaged then, how can we get that original key again?

    Hi yayatisharma,

    Product key Finder programs are USELESS for Vista computers preinstalled, as they find the product key of plant manufacturers, which is used for installations of mutiple during Assembly of the computer.

    This key will not help you reinstall Vista!

    If you communicate with HP they will post you Recovery DVD for a low price to reinstall Vista and they do NOT require a product key

    Or ask the use of the recovery Partition, which must be copied to the hard drive HP

  • deleted reception for windows buy but not print product code. How can I get the product code of return

    I bought a code produced, printed at the front desk but the product code does not print.  How can I get the product code of return?  I have the order #.

    Please see: key product & downloads

  • I have lost the key code for my Adobe Acrobat Standard for Windows (CD) XI.  I had at my office and need to reinstall.  How can I get the key code?

    I have lost the key code for my Adobe Acrobat Standard for Windows (CD) XI.  I had at my office and need to reinstall.  How can I get the key code?

    There is a number on the CD.  Is it possible to contact Adobe and get the key code for this product?

    Hello

    Please check the help below document:

    Quickly find your serial number

    In the case of the volume license product, please visit: site Web of Adobe License | Serial numbers | Orders | Accounts

    Kind regards

    Sheena

  • I put Windows 7 on Windows 10 and Photoshop CS wants to turn back me and get and the Adobe authorization code.  The online server does not work and the provided phone number is out of service.  How can I get this Adobe authorization code?

    How can I get the authorization code of Adobe for re - activate Photoshop CS?  It worked fine until I updated Windows 7 Windows 10.

    The activation for Cs2 servers and more have been disabled by Adobe, and they offer a free download of CS2, which comes with a new serial number and doesn't require activation.

    There is no need to register your old software, follow the instructions in the link I gave you and download CS2. The series number is next to the download.

  • When I try to log in to Photoshop it keeps asking me for a 'unlock code' so I can't get into my pictures. How can I get the unlock code

    When I try to log in to Photoshop, it keeps asking me for a 'unlock code' so I'm unable to access my photos how can I get the unlock code

    Thank you for your response to my query. I have the Album Starter Edition 3.2. It's a box of product registration keeps coming back when I try to log in. This starter edition has been downloaded as a trial as I have used for some years now without difficulty until I have to register and pay for the privilege of using it. I tried to register, but registration box disappears. I'm sorry to be vague, but I'm not as into it as you and still trying to familiarize themselves with computer terminology and everything very confusing sometimes. Even the delay in responding to your response to my query is due to not being able to navigate the Web site to know how to respond.

    SORRY, but I hope you can help

Maybe you are looking for

  • Trails of the icon when switching between desktops in the Sierra

    I noticed some display problems since the update for Sierra. I see some trails icon when switching between desktop computers as well as a line of 1px of random colors on the right side of the screen seems to be leftover pixels for the desktop switch

  • Contacts from a Mac

    Any way to transfer contact to open Mac ZTE data? TIA

  • DVD SuperMulti drive on laptop Satellite Pro

    I am looking to buy a Toshiba Satellite Pro PSCMMA001001 Notebook 15.6 ".Is the optical drive: SuperMulti DVD drive provided appropriate to save backups of large databases (genealogical)? IE is it fully recordable for data, photographs, etc. ?Thank y

  • Quitar publicidad

  • Various Newby Questions on get Podcasts on iTunes

    I want to download podcasts (.mp3 files) to iTunes 2 Web sites that I administer - one is a WordPress ( http://www.hopeandpassion.org/?page_id=232 ) site and one is a non-WordPress ( http://www.norwinalliance.org/audio-links.php ) site. There are abo