How to add exactly 2 NON XML caracters at the end of a SOAP body

Hello all I am trying to add two (and only two) extra non xml caracters "AA" at the END of a SOAP body using the JAXWS handlers as so:
HTTP/1.1 200 OK
Content-Type: text/xml;charset=UTF-8
Content-Length: 131
Content-Length: 131
Server: Jetty(7.x.y-SNAPSHOT)
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body></SOAP-ENV:Body></SOAP-ENV:Envelope>
AA
The problem is that if you try to add them to the SOAP body (see code below) you get a XML Unmarshalling exception. If I add "AA" as a soap attachment I get MORE than 2 caracters after the SOAP body (which I don't want)
Here is the my SOAPHandler code :
@Override
public boolean handleMessage(SOAPMessageContext mc) {
if (Boolean.TRUE.equals(mc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY))) {
try {
SOAPMessage message = context.getMessage()
String stringSoapMessage= getMsgAsString(message);
stringSoapMessage += "ss";
message.getSOAPPart().setContent((Source) new StreamSource(new ByteArrayInputStream(msg.getBytes())));
message.saveChanges();
context.setMessage(message);
} catch (Exception e1) {
return true;
public String getMsgAsString(SOAPMessage message) throws SOAPException {
String msg = null;
try {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
message.writeTo(baos);
msg = baos.toString();
} catch (Exception e) {
e.printStackTrace();
return msg;
so my question is this: is there any way to add exactly 2 non xml caracters at the end of the soap body using jaxws handlers ? I have spent several weeks on this so it is not an easy question...
Thanks,
Fred.

Yes I have done it using CFX interceptors. But the runtime dependencies needed were too big for this particular use. I mean having to use these:
apache/cxf/cxf-bundle/2.6.0/cxf-bundle-2.6.0.jar
org/apache/neethi/neethi/3.0.2/neethi-3.0.2.jar                    
wsdl4j/wsdl4j/1.6.2/wsdl4j-1.6.2.jar
/org/codehaus/woodstox/wstx-asl/3.2.4/wstx-asl-3.2.4.jar
org/apache/ws/xmlschema/xmlschema-core/2.0.2/xmlschema-core-2.0.2.jar
org/mortbay/jetty/jetty-util/6.0.2/jetty-util-6.0.2.jar
org/eclipse/jetty/jetty-util/7.5.4.v20111024/jetty-util-7.5.4.v20111024.jar
org/apache/geronimo/specs/geronimo-servlet_2.5_spec/1.1.2/geronimo-servlet_2.5_spec-1.1.2.jar
org/apache/geronimo/specs/geronimo-javamail_1.4_spec/1.7.1/geronimo-javamail_1.4_spec-1.7.1.jar
org/apache/geronimo/specs/geronimo-servlet_3.0_spec/1.0/geronimo-servlet_3.0_spec-1.0.jar
org/eclipse/jetty/jetty-http/7.5.4.v20111024/jetty-http-7.5.4.v20111024.jar
org/eclipse/jetty/jetty-server/7.5.4.v20111024/jetty-server-7.5.4.v20111024.jar
org/eclipse/jetty/jetty-io/7.5.4.v20111024/jetty-io-7.5.4.v20111024.jar
org/eclipse/jetty/jetty-continuation/7.5.4.v20111024/jetty-continuation-7.5.4.v20111024.jar
to add two caracters at the end of a soap message seems like over kill. If this is the only way to do this then i'll do it this way but it just seems like the implementation of the JAXWS API in JDK 6 seems inches away from being able to do this no ?
Thanks for the replies,
Fred

Similar Messages

  • Help:  How to add a library item to hide the default Window menu

    Hi,
    In this post: Help: How to add a library item to hide the default Window menu, it described how to create an menu that will hide the default window menu.
    I'd like to know if there a way to put this component into library so that others can directly inherit this menu in other FORMS and how to implement it.
    Jimmy

    Hi,
    I found the solution and the post was not properly phrased. There is no need to add menu into library. All we need is to put the compiled menu into Oracle AS and add the menu name the menu module of the given form.
    Thanks.
    Jimmy

  • How to add a code TestIfElse(10) to the Main method of the Program.cs class?

    How to add a code  TestIfElse(10) to the Main method of the Program.cs class?
    Here is my code and I have copied from the Wiley book for Microsoft certification page 14,
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    namespace ifelse_Statement
        class Program
            static void Main(string[] args);
            TestIfElse(10);
            public static void TestIfElse(int n);
            if(n < 10)
                     Console.WriteLine("n is less than 10");
             else if(n < 20)
                    Console.WriteLine("n is less than 20");
             else if(n < 30)
                Console. WriteLine("n is greater than or equal to 30");
    Here is the error list I am getting,
    Error 1      Method must have a return type        C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 13
    switch_Statement
    Error 2
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\switch_Statement\Program.cs
    12 24
    switch_Statement
    Error 3
    Method must have a return type C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 9
    ifelse_Statement
    Error 4
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    12 20
    ifelse_Statement
    Error 5
    Invalid token 'if' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 9
    ifelse_Statement
    Error 6
    Invalid token '10' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 7
    Type expected C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    16 16
    ifelse_Statement
    Error 8
    Invalid token '(' in class, struct, or interface member declaration
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    18 35
    ifelse_Statement
    Error 9
    A namespace cannot directly contain members such as fields or methods
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    20 10
    ifelse_Statement
    Error 10
    Type or namespace definition, or end-of-file expected
    C:\Users\PVS\documents\visual studio 2013\Projects\Lesson01\ifelse_Statement\Program.cs
    30 1
    ifelse_Statement
    Error 11
    The type or namespace name 'n' could not be found (are you missing a using directive or an assembly reference?)
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    16 12
    ifelse_Statement
    Error 12
    'System.Console.WriteLine(string, params object[])' is a 'method' but is used like a 'type'
    c:\users\pvs\documents\visual studio 2013\projects\lesson01\ifelse_statement\program.cs
    18 26
    ifelse_Statement

    static void Main(string[] args){
    TestIfElse(10);
    public static void TestIfElse(int n)
    if (n < 10)
    Console.WriteLine("n is less than 10");
    else if (n < 20)
    Console.WriteLine("n is less than 20");
    else if (n < 30)
    Console.WriteLine("n is greater than or equal to 30");
    Fouad Roumieh

  • How to add a SPACE as suffix to the last field in the downloaded text file?

    Hi Experts,
    By using GUI_DOWNLOAD am saving the data(only 3 fields) in a text file on my desk top.
    fine.
    example current record1 : 010001                      354.999            26.000
    here, after 3rd field 26.000, immediately the cursor is jumping to next line in text file.
    but, wanna a SINGLE SPACE after 26.000, say 26.000+space.
    tried with CONCATENATE, OFFSETTING, but no use(may b am using incorrectly)
    so, pls. suggect me, How to add a SPACE as suffix to the last field in the downloaded text file?
    thanq

    Sorry...Typo error...Too many in the last few days -:(
    Wanted to say AFTER -:)
    Do it like this...
    FIELD1 TYPE XXX,
    FIELD2 TYPE XXX,
    FIELD3 TYPE XXX,
    SPACE(1) TYPE C,
    That way you should end with...
    26.000+SPACE
    Greetings,
    Blag.

  • How to add a location of face in the new Photo App?

    How to add a location of face in the new Photo App?

    You have to open a photo, right klick it and click "add a new face" or something like that.

  • How to add byte[] array based Image to the SQL Server without using parameter

    how to add byte[] array based Image to the SQL Server without using parameter.I have a column in table with the type image in sql and i want to add image array to the sql image column like below:
    I want to add image (RESIM) to the procedur like shown above but sql accepts byte[] RESIMI like System.Drowing. I whant that  sql accepts byte [] array like sql  image type
    not using cmd.ParametersAdd() method
    here is Isle() method content

    SQL Server binary constants use a hexadecimal format:
    https://msdn.microsoft.com/en-us/library/ms179899.aspx
    You'll have to build that string from a byte array yourself:
    byte[] bytes = ...
    StringBuilder builder = new StringBuilder("0x", 2 + bytes.Length * 2);
    foreach (var b in bytes)
    builder.Append(b.ToString("X2"));
    string binhex = builder.ToString();
    That said, what you're trying to do - not using parameters - is the wrong thing to do. Not only it is insecure due to the risk of SQL injection but in the case of binary data is also inefficient since these hex strings are larger than the original byte[]
    data.

  • How to add a Quick Search Region of the shuttle

    JHeadstart 10.1.3.1.26
    Help me! Help me! Help me!
    How does add a Quick Search Region of the shuttle
    http://cid-857a1e2135747b0c.spaces.live.com/?_c11_PhotoAlbum_spaHandler=TWljcm9zb2Z0LlNwYWNlcy5XZWIuUGFydHMuUGhvdG9BbGJ1bS5GdWxsTW9kZUNvbnRyb2xsZXI%24&_c11_PhotoAlbum_spaFolderID=cns!857A1E2135747B0C!112&_c11_PhotoAlbum_startingImageIndex=&_c11_PhotoAlbum_commentsExpand=&_c11_PhotoAlbum_addCommentExpand=&_c11_PhotoAlbum_addCommentFocus=&_c=PhotoAlbum
    Message was edited by:
    user589457

    JHeadstart 10.1.3.1.26
    Help me! Help me! Help me!
    How does add a Quick Search Region of the shuttle
    http://cid-857a1e2135747b0c.spaces.live.com/?_c11_PhotoAlbum_spaHandler=TWljcm9zb2Z0LlNwYWNlcy5XZWIuUGFydHMuUGhvdG9BbGJ1bS5GdWxsTW9kZUNvbnRyb2xsZXI%24&_c11_PhotoAlbum_spaFolderID=cns!857A1E2135747B0C!112&_c11_PhotoAlbum_startingImageIndex=&_c11_PhotoAlbum_commentsExpand=&_c11_PhotoAlbum_addCommentExpand=&_c11_PhotoAlbum_addCommentFocus=&_c=PhotoAlbum
    Message was edited by:
    user589457

  • How can I send an XML request to the server using servlets

    How can I send an XML request to the server using servlets

    http://forum.java.sun.com/thread.jspa?threadID=5158333
    http://forum.java.sun.com/thread.jspa?threadID=5158705
    Crossposting is lame.

  • HT4356 My printer, Epson Stylus Office TX600FW, is not listed on the AirPrint. How to add it? Would Apple expand the list?

    My printer, Epson Stylus Office TX600FW, is not listed on the AirPrint. I can't find it on my iPad or iPhone. How to add it? Would Apple expand the list?

    Only the printer manufacturer can make it compatible with AirPrint, it's not up to Apple. You could try Epson's iPrint app, that claims to support that model :
    http://itunes.apple.com/us/app/epson-iprint/id326876192?mt=8

  • How to add DRAM FIFO-128bi​t to the FPGA project?

    How do I add the DRAM FIFO - 128 Bit Memory Interface to a PXIe-796XR RIO module?
    Above project is from one of the example projects. I know how to add DRAM but not how to configure it as FIFO 128bit as above.
    Any guidance is appreciated.
    Solved!
    Go to Solution.

    I really have not found a way to add the DRAM 128bit fifo to the design. Adding normal DRAM and target specific FIFO's and host-target FIFO's is easy, but the special DRAM implemented as a giant FIFO I could not find how to add. And I have searched the documentation - but obviously missed the key point. I use labVIEW 2013. Any hints are appreciated.

  • How to Add a correspondence type and tick the parameter(FI Down Payment)

    Hi All,
    To use the Down-Payments functionality of SAP for customer payments. Part of the process will be to print off a request for the customer to pay based on data that is entered into transaction F-37 (Down-Payment Request).
    I have created a new sapscripts for the Down-Payment Request. We will need a new correspondence type creating for this print. For ZFI006 to show anything the u201CNoted Itemsu201D must be ticked when printed in ZFI006 using correspondence ZAP11.
    Kindly advice me how to add a new correspondence type and the u201CNoted Itemsu201D must be ticked?
    Thanks.

    Hi,
    You cannot define a payment type as that is based on a lookup defined under the navigation Setup>lookup>Payables.
    This look up access level is System whihc implies it does not allow user level values to be defined.
    So you have to use the available payment types,
    Thanks
    Manish Jain.

  • How to find out which objects are at the end of the datafiles

    My Scenario is having a tablespace of 65G but the data is 5G and that is at the end of datafile for that we are not able to resize the datafile our though is to find out what are the objects at that end of datafiles and will either alter move <owner.tablename> move or alter index <owner.index> rebuld online.
    For that how to find out which objects are at the end of the datafiles.

    >
    My Scenario is having a tablespace of 65G but the data is 5G and that is at the end of datafile for that we are not able to resize the datafile our though is to find out what are the objects at that end of datafiles and will either alter move <owner.tablename> move or alter index <owner.index> rebuld online.
    For that how to find out which objects are at the end of the datafiles.
    >
    You may want to copy this and add it to your toolkit
    See 'What's at the End of the File?' in this Tom Kyte article from the Sept 2004 Oracle Magazine
    http://www.oracle.com/technetwork/issue-archive/o54asktom-086284.html
    And this AskTom blog shows you how to generate a script containing ALTER statements toresize your datafiles to the smallest possible. You can 'pick and choose' from the ALTER statements to do what you want.
    Then of course, you can use techniques from this article by Oracle ACE, and noted author, Jonathan Lewis
    http://jonathanlewis.wordpress.com/2010/02/06/shrink-tablespace/

  • [JSF 2.0] How to add a non-displayed comment in JSF xhtml files?

    Hello!
    I would like to know how to put a non-displayed comment in a JSF xhtml file.
    Currently, a *<!-- My comment -->* will be sent in the HTML output.
    I've tried also:
    *// My comment*
    *<%-- My comment --%>*
    and other ideas, but they are failing.
    On the web, I red an ugly solution, implying to add one parameter in each faces-config.xml files our project could have, and asking JSF not to parse some statements (if I remember well).
    Whatever, I am quite sure it was a solution for JSF 1.0 or 0.9...
    There must be a clean way to write a comment, but I just can't find it.
    How do I write a comment that is not displayed on HTML output, in a JSF xhtml file?
    Regards,
    Grunt.
    Edited by: Grunt2000 on May 10, 2010 9:23 AM

    Grunt2000 wrote:
    Hello!
    I would like to know how to put a non-displayed comment in a JSF xhtml file.
    Currently, a *<!-- My comment -->* will be sent in the HTML output.
    I've tried also:
    *// My comment*
    *<%-- My comment --%>*
    and other ideas, but they are failing.
    On the web, I red an ugly solution, implying to add one parameter in each faces-config.xml files our project could have, and asking JSF not to parse some statements (if I remember well).
    Whatever, I am quite sure it was a solution for JSF 1.0 or 0.9...
    There must be a clean way to write a comment, but I just can't find it.
    How do I write a comment that is not displayed on HTML output, in a JSF xhtml file?Does this help?
    <context-param>
        <param-name>facelets.SKIP_COMMENTS</param-name>
        <param-value>true</param-value>
    </context-param>I'm not sure if that works under JSF 2. If not, you can always use <ui:remove/>.

  • How to add prefixes to xml output?

    Does anyone know a quick and easy way to add a namespace prefix to an xml document when you output it as a string?
    i'm looking for somethinglike this.
    <Order xmlns="http://www.something.com/name">
       <item>sink</item>
    <Order>
    converted into
    <dof:Order xmlns:dof="http://www.something.com/name">
       <dof:item>sink</dof:item>
    <dof:Order>
    I have attempted to use the xmlText method on the XmlObject class passing in an XmlOptions object with setSaveSuggestedPrefixes() set to my hsahmap with the namespace and prefix, however nothing happens. Well, sometimes it works and other times it does not.
    It seems that it works when i programatically build my xml using XmlObject methods, but it fails when i parse an existing xml string into the XmlObject using parse(String).
    Any help would be appreciated. I can't find any detailed help anywhere.
    Thanks
    Jeremy

    You can achieve your requirement using XSLT maaping on XML. Read more about XSLT mapping. Also read more about WordML processing tool by Microsoft.

  • How to add parameters to xml report header

    All,
    I've added two new parameters to my UUT information dialog (I made my own UUT information dialog) and I'd like to pass them to the header of my xml report.  The style sheet I've chosen to use is "report.xsl" and I've already added the two rows to my header; so what I'd like to do is pass these 2 parameters from the PreUUT callback to my report.
    First question: Is this possible?
    Seconds question: I've struggled finding "reading material" on this topic and am looking for some helpful hints on where to start.  To me this doesnt seem like something that should be that difficult, but maybe I'm mistaken?
    Any help is appreciated.
    Thanks,
    Bill
    John 3:16

    Hi Bill,
    In addition to making changes to the style sheet, we must also include the parameters you want to dispaly in the XML file using the ModifyReportHeader Callback. Please refer to this KnowledgeBase article for more information.
    http://digital.ni.com/public.nsf/allkb/17ABBD0BF2A60D908625774200798869?OpenDocument
    Hope this helps!
    Regards,
    Anjelica W.
    National Instruments
    Applications Engineer

Maybe you are looking for

  • Creating a 2nd account with a different iTunes collection

    I managed to erase 70 gigs of iTunes from my last computer.   However, I think I saved it on a backup drive. I now have a new computer with Snow Leopard,  and have started over with iTunes.   I would like to start a new account area and put the old i

  • How to show real file name on file download box when the file is downloaded

    Here is my procedure for downloading from Oracle database to the client, the file is stored in a Blob field, a DAD was defined with no errors, in fact the upload works with no errors. The files are in text format, the field MIME_TYPE has the value 't

  • Can't adjust curves in file opened from pdf

    I need to include several pages of pdfs in a book. The pdfs are scanned text documents, image only, with no security applied. When I open the pdf on my mac pro with photoshop cs6, I can make adjustments in the curves dialog, but when I close the dial

  • Spotlight comments are missing?

    I added Spotlight comments to most of my documents to make them easier to locate. Easy enough, although it took some time. This morning I've found that those comments are missing. Of the several documents I checked, none had comments. The only thing

  • How do you convert DV to AppleTV

    I am interested in converting my Home made DV into H264 to play on AppleTV using QTimePro. I would also like to both crop and stretch (so I do not loose too much picture on top and bottom and yet do not fully stretch so it does not look too distorted