Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6576711
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:32:48+00:00 2026-05-25T15:32:48+00:00

Basically I made a Webservice using JAXWS. It uses SOAP and works. However on

  • 0

Basically I made a Webservice using JAXWS. It uses SOAP and works. However on some request some clients crash/error, it seems to be linked to the fact the JAXWS webservice does not send the content-length header. Is there a way to add it?

Using: openjdk-6 (6b20)

My class looks like this:

import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;
import javax.xml.ws.Endpoint;

@WebService
public class SOAP {
public static void main(String[] args) {
    try {
        SOAP server = new SOAP();
        Endpoint endpoint = Endpoint.publish('localhost:1234', server);
    } catch (Exception e) {
                Utils.getLog("SOAP").fatal("General Error", e);
    }
}
}

Using tcpdump confirms there is no content-length in the response:

0x0000:  4500 00b0 4da5 4000 4006 20d5 5cf3 1021  E...M.@.@...\..!
0x0010:  5cf3 01c7 13b2 bcea a9be 716e 14c3 16a1  \.........qn....
0x0020:  8018 006c cc70 0000 0101 080a 2e1b 3ccc  ...l.p........<.
0x0030:  2e18 23a2 4854 5450 2f31 2e31 2032 3030  ..#.HTTP/1.1.200
0x0040:  204f 4b0d 0a54 7261 6e73 6665 722d 656e  .OK..Transfer-en
0x0050:  636f 6469 6e67 3a20 6368 756e 6b65 640d  coding:.chunked.
0x0060:  0a43 6f6e 7465 6e74 2d74 7970 653a 2074  .Content-type:.t
0x0070:  6578 742f 786d 6c3b 6368 6172 7365 743d  ext/xml;charset=
0x0080:  2275 7466 2d38 220d 0a44 6174 653a 2053  "utf-8"..Date:.S
0x0090:  6174 2c20 3137 2053 6570 2032 3031 3120  at,.17.Sep.2011.
0x00a0:  3134 3a31 393a 3337 2047 4d54 0d0a 0d0a  14:19:37.GMT....

So my question is, is there a way to tell the webservice to send the content-length along with the reply? Or a way to append it before the reply is sent?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:32:48+00:00Added an answer on May 25, 2026 at 3:32 pm

    You can add HTTP headers to the outgoing response by writing a handler. Your handler will extend the standard JAX-WS handler and use the MessageContext in the handleMessage(C context) method to modify the HTTP_RESPONSE_HEADER property (actually a key in the map). So for example your handler will be:

    public class MyHandler<SOAPMessageContext> implements Handler {
    
        public boolean handleMessage(SOAPMessageContext c) {
            if((Boolean)c.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY)) {
                c.put(SOAPMessageContext.HTTP_RESPONSE_HEADERS,"your header stuff here");
                return true;
            }
        }
     }
    

    You will need to create a handler-chain file and add an annotation pointing to that file in your endpoint class. The annotation is @HandlerChain(file=”…”);

    Once you do this you should be able to modify HTTP headers on in and outbound. HTH.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, I'm doing some sort of image processing using a screen-sized rectangle made of
Basically I made console app that performs some task that takes a few minutes.
I made a small script which basically uses jQuery uplodify to upload files to
hi i'm using a script made by http://snook.ca/archives/javascript/simplest-jquery-slideshow so basically the code i have
I am using the GD library with PHP. Basically, I've made a design change
I've basically made a simple text editor with a JTextPane and some styling options
Basically there seems to be a problem when a list of lists is made
I made a particle class following a tutorial a while ago. Basically it uses
I made a table using SQLAlchemy and forgot to add a column. I basically
Hi I've made my igoogle app simple though it is basically using an xml/php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.