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

  • SEARCH
  • Home
  • 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 6867551
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:19:25+00:00 2026-05-27T03:19:25+00:00

I am creating a client using jax-ws generated code. The WSDLs used specify a

  • 0

I am creating a client using jax-ws generated code. The WSDLs used specify a number of header elements like so, within the binding element:

<wsdl:operation name="operation">
    <wsoap12:operation soapActionRequired="false" style="document"/>
    <wsdl:input>
        <wsoap12:header message="tns:InMsg" part="header1" use="literal"/>
        <wsoap12:header message="tns:InMsg" part="header2" use="literal"/>
        <wsoap12:header message="tns:InMsg" part="header3" use="literal"/>
        <wsoap12:header message="tns:InMsg" part="header4" use="literal"/>     
        <wsoap12:header message="tns:InMsg" part="header5" use="literal"/>
        <wsoap12:body parts="request" use="literal"/>
    </wsdl:input>
    <wsdl:output>
        <wsoap12:header message="tns:OutMsg" part="header1" use="literal"/>
            <wsoap12:header message="tns:OutMsg" part="header2" use="literal"/>
            <wsoap12:body parts="response" use="literal"/>
    </wsdl:output>
    <wsdl:fault name="standardError">
        <wsoap12:fault name="standardError" use="literal"/>
    </wsdl:fault>
</wsdl:operation>

My question centres around, for the sake of argument, header5. According to specifications I am working from, this is an optional value. As such, I generate my client using JAX-WS and either have to pass null (to simulate a value not specified) or valid header value as the operation parameter for the header5 value to be added in to the request. This would subsequently create a <header5> element with no child elements. The problem I then encounter is that the consuming service appears to do some sort of validation on that header element and determines it to be malformed as it would normally contain a few different child elements.

As such, is there a way, using JAX-WS, to essentially meet this optional header requirement by excluding the header element altogther from the SOAP request? There seems to be some contention among my colleagues as to whether this would violate the contract defined by the WSDL and cause the service to return an error. There is a claim that .Net clients allow you to exclude the header from the request, simply by specifiying it as null.

  • 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-27T03:19:26+00:00Added an answer on May 27, 2026 at 3:19 am

    After digging further and talking to a few people, I’ve managed to answer my own question. Using a SOAP message handler, I am able to pass in a list of header names to remove and they are stripped out of the request if present. This site was invaluable in getting me on the right track:

    http://technology.amis.nl/blog/12004/how-to-remove-unwanted-soap-header-elements-in-jax-ws

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

Sidebar

Related Questions

I am creating Email client using JavaMail API. Everything is working fine like I
When creating a TCP client using the socket API, a port is used on
I plan to start developing web-service client using Delphi XE. It looks like creating
I am having problems creating WCF client proxy for service code like in this
I am creating a web based email client using c# asp.net. What is confusing
I am using creating a server/client style program, and it uses tcp connections. Now,
I have some web services and I am creating a web client using ws-import.
I am creating a small TFTP client server app where server is developed using
I created a callback when creating a new Client object instead of using the
I am creating twitter client for android using twitter 4j,Oauth protocol.when i am connecting

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.