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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:50:32+00:00 2026-06-02T19:50:32+00:00

How can I execute the soap webservices and how can I print the data?

  • 0

How can I execute the soap webservices and how can I print the data?

Currently I am using the following code

package com.appulento.pack;

import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;

public class SimpleHTTPRequest
{
  public static void main(String[] args) throws Exception {
    final String url =
        "http://**********:8000/sap/bc/srt/rfc/sap/zmaterials_details/" +
          "800/zmaterials_details/zmaterials_details_bind",
      soapAction ="urn:sap-com:document:sap:soap:functions:mc-style/ZMATERIALS_DETAILS",
      envelope1="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
        "<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"" +
          " xmlns:urn=\"urn:sap-com:document:sap:soap:functions:mc-style\">" +
        "<soapenv:Header>"+
        "<soapenv:Body>"+
        "<urn:ZMATERIALS_DETAILS>"+
        "<Language>D</Language>"+
        "<MaterialGroup>00208</MaterialGroup>"+
        "</urn:ZMATERIALS_DETAILS>"+
        "</soap:Body>"+
        "</soap:Envelope>" ;
    HttpURLConnection connection = null;
    try {
      final URL serverAddress = new URL("http://*********:8000/sap/bc/srt/wsdl/"+
          "srvc_14DAE9C8D79F1EE196F1FC6C6518A345/wsdl11/allinone/ws_policy/" +
          "document?sap-client=800&sap-user=************&sap-password=****");
      connection = (HttpURLConnection)serverAddress.openConnection();
      connection.setRequestProperty("SOAPAction", soapAction);
      connection.setRequestMethod("POST");
      connection.setDoOutput(true);
      final OutputStreamWriter writer = new OutputStreamWriter(connection.getOutputStream());
      writer.append(envelope1);
      writer.close();
      final BufferedReader rd =
          new BufferedReader(new InputStreamReader(connection.getInputStream()));
      String line;
      while ((line = rd.readLine()) != null) System.out.println(line);
    } finally { connection.disconnect(); }
  }
}

I want send xml as input request and I want to display in xml too.

  • 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-02T19:50:33+00:00Added an answer on June 2, 2026 at 7:50 pm

    Iit’s possible to sent HTTP request using httpConnection and parse response, like you do.
    But it is already written by other people, use wsimport tool with -keep option. It will generate for you Java artifacts for sending request using SOAP.

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

Sidebar

Related Questions

In object-oriented languages (C++) you can execute code before main() by using a global
In Perl, you can execute system commands using system() or `` (backticks). You can
What do you call a programming language that can execute its own code (passed
Are Activities in the background considered running (and can execute code) or are they
I've tried enclosing the following in an if statement so I can execute another
How I can execute a JavaScript function/piece of code in a specific context which
I can execute a terminal command using os.system() but I want to capture the
How can execute sql script stored in *.sql file using MySQLdb python driver. I
Is there some way I can execute code in the base function for all
Can I create an event so I can execute some javascript whenever an element

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.