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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T10:47:00+00:00 2026-06-06T10:47:00+00:00

I have a bunch of generated SOAP client stubs that differ between WSDL versions.

  • 0

I have a bunch of generated SOAP client stubs that differ between WSDL versions. This happens because SOAP servers have different version of their web services.

Stubs for the web service version 1 are packed in soap.stubs.version1 and stubs for version 2 under soap.stubs.version2.

This means that MyStub in version 1 of the WSDL can be different from MyStub in version 2. As such if I call a SOAP method that returns version 2 of MyStub and hold the value in version 1 of MyStub It will “break”, as the xml response can’t be properly mapped to the stub’s attributes.

Because of this I need to associate class types with SOAP Servers.

Replicating logic for each version would be simply impossible:

if(SoapServer.version==1)
{
   soap.subts.version1.MyStub result = SoapServer.getFoo();
   /* rest of the logic using result of type soap.subts.version1.MyStub */ 
}
else if(SoapServer.version==2)
{
   soap.subts.version2.MyStub result = SoapServer.getFoo();
   /* rest of the logic using result of type soap.subts.version2.MyStub */
}

Every time I’d generate stubs for a newer version I would need to replicate all the logic to use the new stubs. Sometimes the only thing that changes is an attribute.

As such how can I use the proper stubs depending on the SOAP Server without having to re-implement all the logic for that “class”?

I thought about using Object but that would require allot of if instanceof and casts.

  • 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-06T10:47:02+00:00Added an answer on June 6, 2026 at 10:47 am

    I’ve managed to resolve this issue with a misck of Java reflection and URLClassLoader. What I basicly did was:

    • Depending on the Server version I define the package name from where to fetch the subts
    • Using URLClassLoader I load the correct .class files
    • Using reflection I invoke the correct methods

    This has the great advantage of Plug And Play SOAP Servers even with different stub versions. The only thing that must be constant between versions are the methods names so it’s possible to fetch them through Class.getMethod.

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

Sidebar

Related Questions

I have a class generated from a WSDL that has a bunch of public
I have a bunch of PHP code that is auto-generated and it puts all
I have a bunch of objects that inherit abstracts interfaces generated from an idl
I have a bunch of HTML that is generated by a daemon using C,
Duplicate of 249087 I have a bunch of user generated addresses that may contain
I have a bunch of C files that are generated by a collection of
I have a bunch of queries that are generated by a shell script on
I have a bunch of frames (generated by a function) that I want to
I have a .NET web-service client that has been autogenerated from a wsdl-file using
I have a bunch of generated functions from a supplier's tool are required to

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.