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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:13:10+00:00 2026-05-25T23:13:10+00:00

Is there any way to consume a SOAP based Spring web service without generating

  • 0

Is there any way to consume a SOAP based Spring web service without generating stubs on the client (as suggested by umpteen threads pointing to JAX-WS)?

Here is my complete scenario:

I have 2 web applications, say APP1 & APP2, both of which have Spring support. APP2 exposes it’s APIs as Spring-WS that accept POJOs (Reqeust and Response objects) via. SOAP. Now, I want to call these web services from APP1, but would like to avoid having to create stubs using the WSDL frmo APP2. Is this possible?

For more detail, here is one of my web service’s operation:

@PayloadRoot(localPart = "CreateNewRequest", namespace = "myNameSpace")
public CreateNewReqResponse createNewRequest( CreateNewReqRequest requestObj ) throws Exception
{
    NewCase newCase = this.localSpringService.createNewCase( requestObj.getParam1(), requestObj.getParam2() );
    CreateNewReqResponse response = this.objectFactory.createCreateNewReqResponse();
    CreateNewReqResponseObject responseObject = this.objectFactory
            .createCreateNewReqResponseObject();
    if( null != newCase )
    {
        responseObject.setParam1( newCase.getParam1() );
        responseObject.setParam2( newCase.setParam2() );
        }
        responseObject.setCaseRequestedDate( caseRequestedDate );
    }
    response.setResponseObject( responseObject );
    return response;
}

Now, as you can see, the web service method accepts CreateNewReqRequest and returns CreateNewReqResponse. What I am trying to figure out is how can I call this web service from APP1, which does not have any clue about these classes – CreateNewReqRequest and CreateNewReqResponse? Is there no other way other than creating stubs in APP1 (from the WSDL) using JAX-WS?

Both the applications in question are our own (that is we have developed them) but run on different servers, because of which APP1 can not call the web service directly – cross-domain policy. Hence, I will writing a servlet in APP1 which will consume the web service exposed by APP2.

  • 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-25T23:13:10+00:00Added an answer on May 25, 2026 at 11:13 pm

    At the end of they day SOAP is simple a protocol on top of HTTP. So if you wish to forgo the usage of JAX-WS, you could start using raw http connections and hand code the SOAP requests and manually parse the SOAP Response on your own. This would simply mean you are re – inventing the wheel which is JAX-WS Client stubs.

    So If you absolutely want to avoid Stub creation, have a go it at with HTTP post and get Messages at the WSDL end point URL.

    What the client Stub does is simply abstract out that implementation for you. i.e. you will not have to deal with nitty gritty of SOAP/WSDL and http connection, you would be dealing with SOAP at a higher level, i.e through Java Objects.

    You could also look into other libraries such as Apache CXF or Axis, but even there you will have to generate client stubs.

    Thus the question you want to ask is, Do you want to really go in and manually muck around with http connections and SOAP XMLs or let the a framework take do that grunt work for you.

    Reply to Nitin’s comment follows below

    To answer your questions, 1. Yes you will have to re-create the stubs if the WSDL changes, if you are not using the stubs but parsing everything manually you will have to change that code. So effectively there is no difference between the two. Your program will have to change if the WSDL (i.e. the contract between client and service) changes. This would be same even for REST, i.e. if the contract published by the service changes(Maybe the parameters, or the action etc), you will have to Change your client code. There is no escaping that. Hopefully, the public Webservices would have been designed in such a way to allow future modification, and such modifications wouldn’t happen overnight thus giving you enough time to modify your code. This issue has nothing to do with how the web service has been implemented i.e. Spring Web Service has nothing to do with.

    You seem to be missing the point of the Client stubs that a SOAP framework like JAX-WS, Axis, CXF generate for you. The Client Stub is one way to talk to the Web service. It is not the only way. The Client stub is the preferred method, because it abstracts outout the nitty gritties of handling SOAP calls manually. So, rather then you re inventing the wheel and implementing a SOAP(XML) parsing library, you can concentrate your efforts on the actual application that you are writing. In your actual program you would only have to deal with POJOs and never have to worry about how the SOAP magic happens i.e. how to convert your data and package it up in a SOAP message, send that SOAP Message to the Service using a HTTP connection, handle the response, Parse the response SOAP Message and retrieve the data you care about. All of this you avoid by using the POJOs. You set the properties for request, make a method call to the client stub service method, and recieve an object, everything else is you don’t have to worry about (ideally).

    I hope this clear things up a bit.

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

Sidebar

Related Questions

Is there any way to check whether a file is locked without using a
Is there any easy/general way to clean an XML based data source prior to
how can I consume topics in ActiveMQ with VB6? Is there any other way
Is there any way to capture the MouseDown even from the .NET 2.0 TextBox
Is there any way to apply an attribute to a model file in ASP.NET
Is there any way, in any language, to hook my program when a user
Is there any way to have something that looks just like a file on
Is there any way to include the SVN repository revision number in the version
Is there any way to use inheritance in database (Specifically in SQL Server 2005)?
Is there any way to force a listview control to treat all clicks as

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.