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 8278267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:57:17+00:00 2026-06-08T08:57:17+00:00

I want to use JAX-WS API to create a WS-Addressing enabled web service client.

  • 0

I want to use JAX-WS API to create a WS-Addressing enabled web service client. I used wsimport to create the client stub from the WSDL file, and can enable/disable WS-Addressing by using the AddressingFeature, e.g.

Hello hello = service.getHelloSoap11(new AddressingFeature(true, true));

However, I cannot find any samples in web that customize the WS-Addressing ReplyTo/FaultTo endpoint reference. Basically I want to create a WS request like the following (see the wsa:ReplyTo element):

<soapenv:Envelope ...>
  <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:To soapenv:mustUnderstand="1">http://localhost:8080/poc/helloService/
    </wsa:To>
    <wsa:ReplyTo>
      <wsa:Address>http://mycompany.com/poc/reply</wsa:Address>
      <wsa:ReferenceParameters>
        <field1 xmlns="http://mycompany.com/poc/cust">some value1</field1>
        <field2 xmlns="http://mycompany.com/poc/cust">some value2</field2>
      </wsa:ReferenceParameters>
    </wsa:ReplyTo>
    <wsa:Action>http://mycompany.com/poc/sayHello</wsa:Action>
    <wsa:MessageID>urn:uuid:7849b04f-c74e-4836-99e4-8e25d2700fae
    </wsa:MessageID>
  </soapenv:Header>
  <soapenv:Body>
    ...
  </soapenv:Body>
</soapenv:Envelope>

I can add endpoint reference if using Spring Web Service client. However, I need to do it using JAX-WS. Any ideas?

  • 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-06-08T08:57:19+00:00Added an answer on June 8, 2026 at 8:57 am

    I answer my own question.

    It seems that the standard JAX-WS API does not provide a convenient way to customize the WS-Addressing From/ReplyTo/FaultTo endpoint references. However, each JAX-WS runtime may provide additional proprietary API to set the headers.

    For example, the IBM JAX-WS RI provides an EndpointReferenceManager SPI to create the endpoint reference:

        import com.ibm.wsspi.wsaddressing.EndpointReference;
        import com.ibm.wsspi.wsaddressing.EndpointReferenceManager;
        import com.ibm.wsspi.wsaddressing.WSAConstants;
    
        public void testWSAddressing () {
    
        // get the port
        Hello hello = service.getHelloSoap11();
    
        // build a EndpiontReference of <wsa:ReplyTo>
        BindingProvider bp = (BindingProvider) hello;
        EndpointReference epr = EndpointReferenceManager.createEndpointReference(new URI(
           "http://www.w3.org/2005/08/addressing/anonymous"));
        epr.setReferenceParameter(new QName("http://mycompany.com/test", "someRefParam"),
                    "12345678");
    
        ((BindingProvider) hello).getRequestContext()
                .put(WSAConstants.WSADDRESSING_REPLYTO_EPR, epr);
        ...
    
        HelloResponse response = hello.hello(request);
        }
    

    The above code, when running inside IBM Websphere, will produce a SOAP message like the following:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
      <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <wsa:To>http://localhost:8080/poc/helloService/</wsa:To>
        <wsa:ReplyTo>
          <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous
          </wsa:Address>
          <wsa:ReferenceParameters>
            <someRefParam xmlns="http://mycompany.com/test">12345678</someRefParam>
          </wsa:ReferenceParameters>
        </wsa:ReplyTo>
        <wsa:MessageID>urn:uuid:BE9E173A35BAB51CB31338454394298
        </wsa:MessageID>
        <wsa:Action>http://mycompany.com/Hello</wsa:Action>
      </soapenv:Header>
      <soapenv:Body>
        ...
      </soapenv:Body>
    </soapenv:Envelope >
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i want use some data from a website with web service. i have a
I have deployed a web service with Jax-ws that use a database for storing
I've created a jax-ws service endpoint and now I want to write a client.
I'm trying to make my first web service client for the eBay API using
In my Web service I use eclipse, java 1.5, spring. now I want to
For a new project, we want to build a web service in Java using
I am a newbie in web services. I have a JAX-WS service which I
I have hard times using maven to generate my web service client. So please
I am building a Java EE web application, which also has a JAX-RS API
I want to use to implement only REST service - a very simple one

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.