Adding a header to a printout

Hi,
I've a wee problem that I dont know how to solve.
I am printing out a swing component and scaling it to fit on the page. heres what ive done and it works fine:-
     if(e.getActionCommand().equals("print")){
          System.out.println("print pressed " + title);
PrinterJob printJob = PrinterJob.getPrinterJob();          
printJob.setPrintable(this);
if(printJob.printDialog()){
try {
          printJob.print();
catch (Exception PrinterExeption) { PrinterExeption.printStackTrace();}
public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
if (pi >= 1) {
System.out.println("print failed");
return Printable.NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D) g;
g2.translate(pf.getImageableX(), pf.getImageableY());
g2.setColor(Color.black);
disableDoubleBuffering(this);
// find the scale factor and choose the smaller one
float scaleX = getScaleX(pf);
float scaleY = getScaleY(pf);
if(scaleX > scaleY){
scaleX = scaleY;} else {
scaleY = scaleX;}
g2.scale(scaleX,scaleY);
this.paintAll(g2);
enableDoubleBuffering(this);
g2.scale((1/scaleX),(1/scaleY));
System.out.println("print successful");
return Printable.PAGE_EXISTS;
What I want to do is print a title onto the top of the page like a header. I cant just put this on the graphics object though because it would be scaled too.
So what would be really great is that is there a way to add a header to the printed page?!?!
cheers
pmiggy

nah I didnt want to annoy him anymore than usual!....
Um I've tried a few things and it hasnae worked.
I've used drawString() but its not printed it.. and doesn't the scaling scale the whole graphics which will include the text?!?!?
I dunno.
heres where i tried..
public int print(Graphics g, PageFormat pf, int pi) throws PrinterException {
    if (pi >= 1) {
          System.out.println("print failed");
      return Printable.NO_SUCH_PAGE;
    Graphics2D g2 = (Graphics2D) g;
    g2.translate(pf.getImageableX(), pf.getImageableY());
    g2.setColor(Color.black);
    disableDoubleBuffering(this);
1    g2.drawString("Model "+title,getSmallestX(),getSmallestY());   
    // find the scale factor and choose the smaller one
    float scaleX = getScaleX(pf);
    float scaleY = getScaleY(pf);
    if(scaleX > scaleY){
       scaleX = scaleY;} else {
          scaleY = scaleX;}
    g2.scale(scaleX,scaleY);
2    g2.drawString("Model "+title,getSmallestX(),getSmallestY());
    this.paintAll(g2);
    enableDoubleBuffering(this);
3    g2.drawString("Model "+title,getSmallestX(),getSmallestY());
    g2.scale((1/scaleX),(1/scaleY));
    System.out.println("print successful");
    return Printable.PAGE_EXISTS;
  }Hope you could give mea hint on where to put it..
Much thanks
pmiggy

Similar Messages

  • Adding new header in doFilter()

    Hi all..
    I'm having problem.. with adding customized header in my application...
    Here's a sample of my code....
              try {
    HttpServletResponse httpRES = (HttpServletResponse) res;
              if (!httpRES.containsHeader("cpa_cp_id"))
    httpRES.addHeader("cpa_cp_id","hi");
                        chain.doFilter(req, res);
              } catch (Exception ex) {
    Is there something else I had left out??
    Thanks..

    That page (inside another server) which I'm calling
    requires me to add new header information (once
    again, not session nor request.getParameter()).
    Hope you'll understand my situation...Your original code does that. So no, I don't understand your situation. Unless it's this:
    I'm unable to retrieve the new header valueSo what? You can't retrieve a header from the servlet response in any case. Using a HttpServletResponseWrapper doesn't change that fact. If you've got a design that wants to retrieve headers from the servlet response then you've got a design that wants to be changed.
    Note that you DO have a "containsHeader(String)" method to see if the response contains a certain header.

  • Adding HTTP Header Attribute

    Hi all,
    in order to get our Load Balancer to work correctly, we need to add an attribute to every HTTP Request that comes from the portal. In 4.5 we have added it in the common/include.asp file.
    Call Response.AddHeader ("MyAttribute", "MyAttributeValue")
    Do you know where is the right place to put the code in 5.0.2. Have you any examples of Java code to do this?
    Thank you very much.
    Alberto

    I'm going to take a wild guess at this -- on line 463 of com.plumtree.portaluiinfrastructure.activityspace.Interpreter, you might try adding the header you need to the response (IXPResponse) object somewhere inside of HandleGatewayRequest.
    A word of caution: I think Plumtree would frown upon this customization, and here's why.
    My guess was based on 5.0.1 as I haven't seen the source code provided to customers for 5.0.2 yet, but I suspect that they've refactored Interpreter into uiinfrastructure so that it's compiled instead of distributed to customers (based on this comment in the source):
    /* Note: There should be no portaluiinfrastructure code in this file. This * will no longer be an issue when this file, along with AppWarmUp, are * moved to the uiinfrastructure jar. */
    So if this is even possible in 5.0.2 (and I suspect it's not), it probably won't be possible to maintain this customization in future releases of Plumtree.
    I'm interested to hear the official response from Plumtree because one of our customers is considering making a change to Interpreter and I've been cautioning them against it because it might not be supported in future releases.
    Hope this helps,
    Chris Bucchere | bdg | [email protected]| www.bucchere.com

  • [AI CS3]: How to prevent Illustrator from adding a header while saving a PDF

    Hi All.
    I am using Illustrator CS3 (Win XP SP II) and am having a problem while processing PDF files with Javascript. Specifically, I create a PowerPoint presentation and save as a PDF, one slide per page. Then, using an Acrobat javascript, I split this PDF into individual pages. Those individual pages- representing an entire PowerPoint presentation- are then imported into Illustrator, scaled, and placed (duplicated) 3 per page onto a new document (created on the fly). Now here's the problem. When I save this new document (with its three PowerPoint slides) Illustrator expands the landscape page height from 8.5 to 8.8 inches, and then adds a header containing document name and date info.
    I don't want this header, but I can't seem to find how to turn it off. There's probably a simple toggle somewhere, an "addHeaderInfo" sort of boolean, but where? Can anyone help me?
    To see an example, go to:
    http://www.garywed.com/AcroProblem.jpg
    Many Thanks!

    Hi Larry.
    Good point. Here's the workflow:
    1) Save PowerPoint (PP) presentation as single PDF file. [No marks]
    2) Use Acrobat JS to break single PDF into individual PDFs
    containing one slide per page.
    3) Use Illustrator JS to import three PDF pages, suplicate and scale
    them onto a new Illustrator PDF document, and then save that PDF
    document.
    4) At this point the marks appear (outside the crop line, I might
    add) when I open them in Acrobat 8.0 but are not visible when I
    re-open the files in Illustrator. So either Illustrator is
    suppressing the marks, or Acrobat is adding them. The image at
    the URL in my original post is the upper left corner of such
    an Acrobat-opened file.
    A) When printed, Illustrator does not print the marks nor the extra
    page space, but Acrobat does. However...
    B) Acrobat's Document-->Header & Footer-->Remove... comes back with,
    "No headers found"
    So while I haven't ruled out Illustrator, perhaps the problem is in Acrobat. Either way, tho, the questions remain...
    What are these marks?
    Who put them in?
    How do I suppress them?
    Thanks in advance to anyone who can help.

  • Enhancement details required...adding order header material as component in Process Order

    Hi,
    I am creating a process order for a qty of 10. Now when I go to components list header material with order qty (means 10) is added in the components list by the system through some enhancement...how to check which BAPI or BADI is doing this.....can somebody guide me....
    Thanks
    Kumar

    Dear Kumar,
    Find BAPI:
    Get the package of the transaction and in SE84 choose the required hierarchy and input the package and execute you will get list of BAPIs. and see given threads: LIST OF BAPI FOR PRODUCTION PLANNING MODULE and BAPI to change production order components
    Find BADI: Using Repository Information System (TCODE- SE84)
    Go to “Maintain Transaction” (TCODE- SE93).
    Enter the Transaction code( which you want to find BADI) and Click on the Display push buttons.
    Get the Package Name.
    Go to TCode: SE84->Enhancements->Business Add-inns->Definition
    Enter the Package Name and Execute.
    Best of luck
    Regards,
    Abbas.

  • CSS help? Adding a heading banner, how?

    Hi folks, I was wondering if anyone here on this forum would both have the skill, the time and the kindness to offer help with a CSS tweak? I am using the LR HTML standard output. I want to place in a heading image I already use on my site. I was trying changes in the CSS files that LR gernerated last night. Took a copy of my sites CSS off the site and was doing my best to compare, trial and error tests.
    I Was able to see how to change cell background colors and even page background colors. Of course I can figure out eventually how to shift from LRs 3 column minimum to my own 2 column design - or not fight that battle at all. But I am not sure how to tell the LR CSS to put the same image as heading background in the LR web page, as I have in my own.
    Can anyone who actually knows how to do this, do this for me? I ask only to get a start. IF you generate a 3 x 3 table and then edit your content/custom.css page, that should be where you find the data to change. That is where I have been testing and it seems to work there.
    But what I wold appreciate would be to see an example of just replacing ... However far you have to go down from the top to replace ... With a banner of some kind placed so that your banner would be background at the top of the page when done. If I had that I could see how it works and substitute my sites current header background.
    The spacing on my pages come down just past the top line where the menus cross the page, about an inch. The best of all worlds would be to take out everything above where the LR output table starts and put in my own site title and banner. But I am really not good at tweaks in CSS yet. So a starting reference point would be sooo helpful. You know, When you are not sure what section to rip apart and what damage you are doing to some other place that needed that bit of coding?
    ANyway, thanks very much if anyone can help. Appreciate it.
    Levelbest

    Not sure why your posts are coming in multiple lots - your last message came in three times.
    Onto your colour problem.  this is a personal opinion of course, but currently, the burgandy text behind the green in your header is very difficult to read.  The added white dropshadow doesn't enhance the text, only makes it hard to read.
    I would possibly make the header box white so that your logo and tagline stand out a lot more than they do.  I would use the green/burgandy combination only as accents in your layout.  Maybe a burgandy navigation bar, and use a solid green for the footer with which text.  I would likely thrown in some blue or grey, both mix well with burgandy  :-)
    You may get more ideas for colourschemes from this site:  http://www.colourlovers.com/palettes/top
    Nadia
    Adobe® Community Expert : Dreamweaver
    Unique CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    Book: Ultimate CSS Reference
    http://www.sitepoint.com/launch/005dfd4/3/133
    http://twitter.com/nadiap

  • Adding custome header : response.setHeader()

    HI
    I have an application where in authorization is done from a different server. When we hit our app's URL proxy redirects to that othorizing server and that server adds a header named sn_userdn in the header and we read that header and accordingly we do the further processing based on that.
    But now I need to bypass this thing. I need to develop a login page which gets the user information and sets same header this is because we are going to not use the third party authorization any more.
    I am useing response.addHeader("sn_userdn","binoyb9");but while trying to read it as we were doing it previously it gives null.
    can you tell me why?
    How do i set custom headers in jsp?

    response.addHeader() will add a header that goes back to the response, usually to the browser. If something isn't intercepting that after that, it's not going to be there. I think it seems you are adding something to the wrong place. Perhaps a servlet filter could be used to add the header before the servlet/jsp page gets it.

  • Adding a heading to the steps element in a DITA topic

    Hello Framers,
    I've been using unstructured FM for years, but I've only just started looking into structured FM. I am currently trying to adjust the sample DITA application that comes with FM 9 to our requirements. In the DITA task topic, the sample application adds frames from a reference page above and below the steps element. Both frames contain a line to visually separate the steps element from other elements in the topic. The upper frame also contains a heading for that element.
    I don't like this approach at all. First of all, I don't want translatable text on the reference page. In addition, the heading should go to the side-head area. The EDD contains the following rules for the steps element:
    Automatic insertions
      Automatically insert child: step
        and nested child: cmd
    Format rules for first paragraph in element
      In all contexts.
        Use paragraph format: step.begin
    Format rules for last paragraph in element
      In all contexts.
        Basic properties
          Paragraph spacing
            Change space below by: +6pt
          Pagination properties
            Keep with previous: Yes
          Advanced properties
            Frame below element: StepsEnd
    I was thinking about adding a prefix to the steps element, but in this case, the prefix is formatted as the first step with the step.begin paragraph style. Is it possible to define a formatting rule for the second paragraph in an element?
    Thank you for any help
    Susanne

    Maybe it is time to rethink what you need to do.
    Just because FrameMaker ships DITA with styles that put a frame above and below the steps element, does not mean that you have to do it also. You can delete it from the EDD.
    If you need your steps to have a heading, then use the heading (or title) element in one of the containing elements higher up the hierarchy, such as the taskbody. I do not use DITA but my structure has a procedure element that is something like:
    Procedure
       Title
       Intro
       Step
       Step
    The Title element contains the title or heading or the procedure. The Intro element contains introductory material for the procedure. Typically, the title is in the side head, which aligns with the first paragraph in the Intro. If there is no Intro element, then the title aligns with first Step element. This structure is simpler than the standard DITA structure, but my point is that the title of your procedure (or steps) need not be part of the steps element itself; my guess is that the DITA structure has a place for it higher up the hierarchy.

  • Adding automatic header using OC4J

    Hi,
    I have a web application coded in pure java and deployed to an OC4J container. In that application, I used iFrame to open a new session in another server in the frame. The new frame shows Oracle BI reports, as if it is a part of the developed application. However, as the security settings of Internet Explorer, the session is lost in the frame, and the frame forwards itself to the logon screen of the BI application. This can be solved by lowering security settings of IE, however, as there is hundreds of users and we don't want to change the IE security settings.
    Searching through web, I have found that, adding header information to the target application solves the problem, too. This can be done by the following (I am not sure whether this is Java or C# code, bu I am sure, this can be done in each):
    HttpContext.Current.Response.AddHeader("p3p", "CP=\IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\");
    However, as the target application to be opened is a packaged application by Oracle (oracle BI), we cannot add this header information to the application.
    Finally, my question is: Is there a way to add this header information directly into OC4J so this is added to BI pages and I can restore my session?
    I hope I made myself clear enough :)
    Thanks a lot
    Özgür

    Hey Zvika,
    Chek out this website:  http://zone.ni.com/devzone/cda/epd/p/id/4759
    NI doesn't support any changes in the xsl however so if you change it you are on your own.  You can look to this website for help with that: http://www.w3.org/XML/
    Regards,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Versamail adding message header to emails

    When I send an email from my versamail account it adds on additional header information to the email body and puts my original message at the bottom of the email.  Does this happen to everyone else and can I somehow stop this from happening?
    Here is an example of the info added on every email:
    Date: Mon, 8 Dec 2008 18:47:00 -0500
    Mime-Version: 1.0
    X-Mailer: VersaMail(R) v. 3.5.5, Copyright (c) 2001-2006 Palm, Inc.
    X-Sender: [email protected]
    X-Priority: 3
    Importance: Normal
    Content-Type: text/plain; charset="ISO-8859-1"
    Content-Transfer-Encoding: 8bit
    Post relates to: Treo 755p (Verizon)

    Hi Brada22,
    I'm not really sure whether it is the e-mail client (Versamail) itself or the smtp server which adds this part of information to the mails. Maybe someone in the forum has profound knowledge about this. Fact is that every mail server on the road to the recipient is adding a bit of information, to track the way the mail took.
    It is however not normal that this information is added to the body of the mail. It has to appear in the header part. In my Versamail, this information is not shown at all. On workstation email clients (like Thunderbird, Outlook ...), you normally can choose to display the full headers, or just a reduced set of header info (Subject, Date, From, To, Cc ...).
    The mails I send from my Versamail on Treo 680 look absolutely normal on the receiver's side. If in your mails these infos are really appearing in the body section,  I guess that it's the smtp server which is adding this information, and maybe there is something badly configured on this server. Perhaps you can ask the technical support of your provider !?
    Post relates to: Treo 680 (Unlocked GSM)

  • Pages Deleted Half My Work When Adding a Header

    So im wiriting my big assignement. So far im, or was on, 5,600 words. Then I tried to add a 3rd header, at this point it deltes a whole section of my work. I revert and try again, it does it again and again then.... so I close it and reopen it and try again. So I close it again, however, this times it opens and has saved it when a whole secion on my work is gone!
    So I go to File>revert and no last saves are there. It appears it has deleted 1,000 words and theres nothing I can do about it.
    Now I have Omnisweep and such like, is there anyway that it has saved any previous versions which I can find through something like omnisweep?

    You have not said but it sounds like you are not on OSX 10.8.5 but on OSX 10.9 and are using Pages 5, but haven't said.
    Apple has removed almost 100 features from Pages 5  and added many bugs.
    The syncing with iCloud means that errors propegate beyond your control.
    http://www.freeforum101.com/iworktipsntrick/viewforum.php?f=22&sid=3527487677f0c 6fa05b6297cd00f8eb9&mforum=iworktipsntrick
    Pages '09 should still be in your Applications/iWork folder.
    Archive/trash Pages 5, after Exporting your files to Pages '09, and rate/review it in the App Store, then get back to work.
    Peter

  • Footer is adding in header of pages

    Hi folks,
             I have a smart form with footer.For displaying footer information first and last page footer is displaying in footer area but in middle pages footer is collapsed with first lines of pages.What is reason for this.
    Pls help me to resolve it.
    Thanks in advance

    Hi Srinivas,
    Chek Below:
    1. Whether you have created a separate window for 'Footer' or you are using footer section of table ( Header , Main Area, Footer ).
    1.a) If you are using separate window for displaying footer values put is as last window and chek the page format width and height.
    1.b) If you are printing it using Footer section of table( Header , Main Area, Footer ). Print time 'At Page Break' and 'At End of Table' should be checked and here if you are using events you have print using 'command' this line to be inserted above 'Footer'.
    2. See to that the main window and footer window( if you use one ) should not overlap.
    3. If you only one page then the next page should be the same page( for your scenario).
    4. If you use two pages or more next page should be the last page( for your scenario).
    Regards,
    Dep

  • Adding a "header" (or skin?) to files

    Hello,
    I would like to have a common header on all of my slides- a
    company logo. Can anyone help me learn how to do this?
    Lindsay

    I can think of two (2) ways off-hand. One is to insert a
    colored, closed, "highlight" at the top, on which the logo could be
    placed. The second is to use the "Project > Resize" dialog.
    The first would simply entail inserting a "highlight" box
    with the same interior and exterior colors so it appears as a solid
    box. This could then be copied to all slides at the top of your
    existing movie - in the case of an application, it might be placed
    on top of the application's "title bar", to avoid intruding on
    "clickable" areas.
    The second is probably better, but as I mentioned earlier,
    involves using the "Resize" which will always make your project
    size larger. Sometimes that is not a problem, sometimes it is. To
    go this way:
    1) Open the dialog (Project > Resize Project).
    2) Deselect the box "Maintain Aspect Ratio"
    3) If you want to place the logo at the top ...
    4) Increase ONLY the Vertical size by an amount sufficient to
    fit your logo
    5) Select "Keep Project Same Size and Fill Background with
    Color"
    6) Select a background color from the color-picker below
    that.
    7) From the "Position Project" drop-list, select any of the
    "Top-" selections
    8) Click "Finish" - you will be warned this cannot be undone
    - click "OK".
    And there you have it. Be sure, if you choose option #2, to
    use "File -Save As" to create a copy of your project - to protect
    the original if you make a mistake.
    Good luck!!
    .

  • Acrobat 8: How to prevent "Combine Files" from adding a header?

    Hi All.
    I am using Acrobat 8 (Win XP SP II) and am having a problem with the "Combine Files" feature. In the past, I've used this function to create hundreds of PDF files from thousands of individiual PDF's. It worked great. But now, suddenly, Acrobat increases the landscape page height from 8.5 to 8.8 inches, and then adds a header containing document name and date info.
    I don't want this header. I've looked all over Acrobat and Distiller and converter preferences but can't seem to find how to shut this feature off. Can anyone help me?
    To see an example, go to:
    http://www.garywed.com/AcroProblem.jpg
    Many Thanks!
    Gary Wedemayer

    I have multiple single-page PDF files lying in a folder; I hit Files-->Combine Files, select the relevant PDF files, and let it rip using any of the quality settings (low, medium, high- makes no difference).
    But I see nothing in the Combine Files dialog box that is relevant to this kind of header, so it must be hidden somewhere else. Can't find it for the life of me, tho!
    If I have to I'll revert back to Acrobat 6.0 or write a Javascript to combine the files for me, but I know I can do it straight up in Acrobat 8 'cos I've done it many times before.
    Thanx.
    ---Gary Wedemayer

  • Adding soap header in MX6.1

    I have a code working on MX7, it first adds soap
    header(username and password) then gets the response, but similar
    code didn't work on MX6.1. Please help.
    MX7 code:
    <cfscript>
    ru = XmlNew();
    ru.AuthenticationHeader = XmlElemNew(ru, "
    http://www.mytesting.com/Webservices/ProductInfo","AuthenticationHeader");
    ru.AuthenticationHeader.UserName = mlElemNew(ru,"
    http://www.mytesting.com/Webservices/ProductInfo","UserName");
    ru.AuthenticationHeader.UserName.XmlText = "myusername";
    ru.AuthenticationHeader.Password = XmlElemNew(ru,"
    http://www.mytesting.com/Webservices/ProductInfo","Password");
    ru.AuthenticationHeader.Password.XmlText = "mypassword";
    ws = CreateObject("webservice", "
    http://www.mytesting.com/Webservices/ProductInfo/Management.asmx?WSDL");
    addSOAPRequestHeader(ws, "
    http://www.mytesting.com/Webservices/ProductInfo",
    "AuthenticationHeader", ru.AuthenticationHeader, true);
    subbid = ws.GetProductInfo();
    </cfscript>
    MX6.1 code:
    <!--- get SOAP functions --->
    <cfinclude template="soap-udfs.cfm">
    <cfscript>
    ru = XmlNew();
    ru.AuthenticationHeader = XmlElemNew(ru, "
    http://www.mytesting.com/Webservices/ProductInfo","AuthenticationHeader");
    ru.AuthenticationHeader.UserName = XmlElemNew(ru,"
    http://www.mytesting.com/Webservices/ProductInfo","UserName");
    ru.AuthenticationHeader.UserName.XmlText = "myusername";
    ru.AuthenticationHeader.Password = XmlElemNew(ru,"
    http://www.mytesting.com/Webservices/ProductInfo","Password");
    ru.AuthenticationHeader.Password.XmlText = "mypassword";
    ws = CreateObject("webservice", "
    http://www.mytesting.com/Webservices/ProductInfo/Management.asmx?WSDL");
    addRequestHeader(ws, "AuthenticationHeader",
    ru.AuthenticationHeader, "
    http://www.mytesting.com/Webservices/ProductInfo",
    true);
    subbid = ws.GetProductInfo();
    </cfscript>
    Error message for MX6.1:
    Could not perform web service invocation "GetProductInfo"
    because AxisFault faultCode: {
    http://schemas.xmlsoap.org/soap/envelope/}Server.userException
    faultSubcode: faultString: java.io.IOException: No serializer found
    for class coldfusion.xml.XmlNodeList in registry
    org.apache.axis.encoding.TypeMappingImpl@19a61ad faultActor:
    faultNode: faultDetail: {
    http://xml.apache.org/axis/}stackTrace:
    java.io.IOException: No serializer found for class
    coldfusion.xml.XmlNodeList in registry
    org.apache.axis.encoding.TypeMappingImpl@19a61ad at
    org.apache.axis.encoding.SerializationContextImpl.serializeActual(SerializationContextImp l.java:1281)
    at
    org.apache.axis.encoding.SerializationContextImpl.serialize(SerializationContextImpl.java :795)
    at
    org.apache.axis.message.MessageElement.outputImpl(MessageElement.java:817)
    at
    org.apache.axis.message.SOAPHeaderElement.outputImpl(SOAPHeaderElement.java:250)
    at
    org.apache.axis.message.MessageElement.output(MessageElement.java:783)
    at
    org.apache.axis.message.SOAPHeader.outputImpl(SOAPHeader.java:342)
    at org.apache.ax...

    XML snippit
    <soapenv:Envelope
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:con="urn:crmondemand/ws/contact/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
    xmlns:con1="urn:/crmondemand/xml/contact">
    <soapenv:Header>
    <wsse:Security>
    <wsse:UsernameToken>
    <wsse:Username>your_site/your_login</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">your_password</wsse:Password>
    </wsse:UsernameToken>
    </wsse:Security>
    </soapenv:Header>
    This isn't exactly what you are looking for but you can use this to add a header to a axis web service call.
    SOAPHeaderElement header = new SOAPHeaderElement("http://your.xsd", "your tag");
    SOAPHeaderElement header1 = new SOAPHeaderElement("http://your other.xsd", "your other tag");
    header1.setAttribute("Id", "your value");
    header.addChild(header1);
    SOAPElement node = header1.addChildElement("more text");
    node.addTextNode("more text");
    SOAPElement nodepwd = header1.addChildElement("another tag");
    nodepwd.addTextNode("more text");
    nodepwd.setAttribute("Type", "http://another url");
    ((Stub)service2).setHeader(header);
    Hope this is more helpful than confusing.

Maybe you are looking for