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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:02:18+00:00 2026-05-29T09:02:18+00:00

I am having trouble creating a Web Service in Java that contains two methods

  • 0

I am having trouble creating a Web Service in Java that contains two methods that are parameterless. It’s simple to create a single one, but I have not figured out how to get it to work with more than one:

<message name="messageOneRequest" />
<message name="messageOneResponse" />

Would lead to

public void messageOne() { }

But adding

<message name="messageTwoRequest" />
<message name="messageTwoResponse" />

Leads to a “signature” collision. I know the cause of the signature collision, and it’s because JAX-WS/JAX-RI are trying to be more efficient with the parameterless method by simply leaving an empty SOAP Body for the incoming message, thus representing a single, parameterless method. As a side note, I am using Document and not RPC.

Is there a way to allow this? Am I simply missing an attribute?

  • 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-29T09:02:19+00:00Added an answer on May 29, 2026 at 9:02 am

    The goal of my question was to achieve parameterless methods like the following:

    int someMethod();
    ArbitraryObject someOtherMethod();
    

    Even though the two methods do not share the same name, they have a conflicting SOAP body because the incoming SOAP body would be technically identical (most engines seem to supply a blank body for efficiency when there are no arguments, rather than something like <someMethod /> inside of the SOAP body).

    To make a long story short, there are two simple ways to fix this problem when using Document/Literal. The simplest way to work around this issue is to simply give them different parameters. I originally just supplied a dummy, no-op parameter (called “IgnoredParameter“) to differentiate the two. The other way is to provide a unique value for the SOAP Action of each operation that has non-unique parameters. In the case of using wsimport to generate, you also need to supply “-extension” to have it use that feature, or it will simply error out and ignore the presence of the SOAP action.

    The drawback to the second approach is that SOAP Action is highly coupled with HTTP (it’s used as an HTTP Header). In my case, that was not a problem. But, obviously that is not always the case especially given that SOAP is meant to be generic.

    An example binding with this in use (note the actually supplied soapAction versus being commonly blank):

    <operation name="someOtherMethod">
        <wsdlsoap:operation soapAction="urn:someOtherMethod"/>
        <input name="someOtherMethodRequest">
            <wsdlsoap:body use="literal"/>
        </input>
        <output name="someOtherMethodResponse">
            <wsdlsoap:body use="literal"/>
        </output>
    </operation>
    

    The other, non-conflicted operations/methods can still use soapAction="".

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

Sidebar

Related Questions

I am having trouble creating an XML document that contains a default namespace and
I am having trouble creating a simple mixin that i plan to use on
I'm having trouble creating a mouseover function with an NSTableView. The idea is that
I am creating a Stratego Game and am having trouble creating an algorithm that
I'm having trouble creating multiple xml requests using php's curl_multi_exec. The problem is that
I am creating a simple SOAP web service using a SLSB and JAX-WS annotations.
I'm pretty new with JQuery and I'm having trouble creating a behaviour that would
I have a web service with two methods: RetrieveFirstLevelOptions() and RetrieveSecondLevelOptions(int levelOneOption). The GUI
I'm creating a web site and I'm having trouble getting Firefox to ask me
I am not really a web person and am having trouble creating a cascading

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.