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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:50:23+00:00 2026-05-23T14:50:23+00:00

I can uses Web service client classes to obtain the result but instead of

  • 0

I can uses Web service client classes to obtain the result but instead of the text result i want complete SOAP message in my JavaSE program. How can I do that? Any Idea?

  • 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-23T14:50:24+00:00Added an answer on May 23, 2026 at 2:50 pm

    Yes there is.
    Use Dispatch<Source> to work on the SOAP message JAX-WS Dispatch.
    Example
    DISCLAIMER: Did not even attempt to compile the code:

        //xmlString has the xml message to send to the web service  
        StreamSource xmlMsg = new StreamSource(new StringReader(xmlString));   
        //Create URL of web service. Place your URL for WSDL
        URL wsdlURL = new URL("http://10.5.2.10:8080/path/service?wsdl");  
        QName serviceName = new QName("http://example.com",  "TrivialWebService");  
        Service s = Service.create(wsdlURL, serviceName);  
        QName portName = new QName("http://example.com", "TrivialWebServicePort");  
        //Service.Mode.MESSAGE works on SOAP msg (as opposed to Service.Mode.PAYLOAD)
        Dispatch<Source> dispatch = createDispatch(portName,  
                                                          Source.class,  
                                                          Service.Mode.MESSAGE);  
        //Send request
        Source reply = dispatch.invoke(xmlMsg);  
        DOMResult domResponse = new DOMResult();
        Transformer trans = TransformerFactory.newInstance().newTransformer();
        trans.transform(reply, domResponse); 
        //Now use DOM APIs
    

    You can also specify if you want to work on the HTTP payload (as XML) i.e. SOAP envelope or the SOAP payload i.e. the response.
    You will have write code to handle the raw XML (e.g. use DOM).
    You can use this api if you use JAX-WS or CXF.
    For AXIS2 it is possible to work on XML as well.Just will be some specific apis
    Of course there is also SAAJ you can use.

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

Sidebar

Related Questions

Looking around, I can't name a single web application (not web service) that uses
My company has developed a .NET web service and a client dll that uses
I have an asp.net site that uses Bing Translate Web service(http://api.microsofttranslator.com/V2/Soap.svc) The code that
I have Axis2 created web service client. This service uses both SSL and WS-Security
I have a web application that can load plugins through reflection. It currently uses
I have an ASP.NET application which talks to a third-party SOAP web service. My
I am trying to develop a client application that calls a RESTful web service.
I have an applications that connects to a web service that uses an Entrust
I'm creating a system that uses two web services and a client to provide
I have a PHP Code, that uses a web service to query some data.

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.