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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:21:11+00:00 2026-06-16T03:21:11+00:00

<env:Envelope xmlns:env=http://schemas.xmlsoap.org/soap/envelope/^M xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance^M xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/^M xmlns:xsd=http://www.w3.org/2001/XMLSchema^M xmlns:wsse=http://schemas.xmlsoap.org/ws/2002/07/secext>^M <env:Header>^M <wsse:Security>^M <wsse:UsernameToken>^M <wsse:Username>user</wsse:Username>^M <wsse:Password>pass</wsse:Password>^M </wsse:UsernameToken>^M </wsse:Security> ^M

  • 0
<env:Envelope  xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"^M
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"^M
  xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"^M
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"^M
  xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">^M
 <env:Header>^M
         <wsse:Security>^M
                 <wsse:UsernameToken>^M
                         <wsse:Username>user</wsse:Username>^M
                         <wsse:Password>pass</wsse:Password>^M
                 </wsse:UsernameToken>^M
         </wsse:Security> ^M
 </env:Header>

I have been told to post this xml to: https://www.abc.com
I am also given the following method:

public int sendPostRequest(String url, String content, String contentType)
            throws Exception {
        PostMethod post = new PostMethod(url);
        post.setRequestEntity(new StringRequestEntity(content, contentType,
                null));
        boolean success = false;
        String responseBody = null;
        int statusCode;

        try {
            getHttpClient().executeMethod(post);
            success = true;
            statusCode = post.getStatusCode();
            responseBody = post.getResponseBodyAsString();
        } catch (Exception ex) {
            log.error("Marhsalling exception : " + ex.getMessage());
            throw new InvalidRequestException("Marhsalling exception :"
                    + ex.getMessage());
        } finally {
            post.releaseConnection();
        }   

        if ((statusCode != HttpStatus.SC_OK) &&
                (statusCode != HttpStatus.SC_NO_CONTENT)) {
            String error = "Got Bad Http Status - <" + statusCode
                    + "> Info : " + responseBody;
            log.error(error);
            throw new InvalidRequestException(error);
        } else {
            log.debug("Success - " + responseBody);
        }
        return statusCode;
    }

private String footer = "</env:Envelope>";
    private String message = "<InstallService><NewAccount></NewAccount></InstallService>";
    private String payload = header + message + footer;

header I have been told is the XML that I have posted. I am not sure about the content type, it was suggested that it could be XML. The project type should be the dynamic web project using the Tomcat server. I was also told to grab org.apache.commons.httpclient library.

I have been trying to put the pieces together but I’m failing to. I get error at: getHttpClient(), saying that the method could not be resolved. It is same for log and InvalidRequestException could not be resolved. It seems that I have to extend my class to another class which would contain these three methods. Which class could it be? What jars could I be missing? A simple main method which calls the above method and passes the required arguments would work?

  • 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-16T03:21:12+00:00Added an answer on June 16, 2026 at 3:21 am
    /*
         * soapXMLtoEndpoint sends the soapXMLFileLocation to the endpointURL
         */
        public void soapXMLtoEndpoint(String endpointURL, String soapXMLFileLocation) throws SOAPException {
            SOAPConnection connection = SOAPConnectionFactory.newInstance().createConnection();
            SOAPMessage response = connection.call(xmlStringToSOAPMessage(soapXMLFileLocation), endpointURL);
            connection.close();
            SOAPBody responseBody = response.getSOAPBody();
            SOAPBodyElement responseElement = (SOAPBodyElement) responseBody.getChildElements().next();
            SOAPElement returnElement = (SOAPElement) responseElement.getChildElements().next();
            if (responseBody.getFault() != null) {
                System.out.println("fault != null");
                System.out.println(returnElement.getValue() + " " + responseBody.getFault().getFaultString());
            } else {
                serverResponse = returnElement.getValue();
                System.out.println(serverResponse);
                System.out.println("\nfault == null, got the response properly.\n");
            }
        }
    

    Using file in this case, but it can be a simple string. You would have to create a soapmessage out of that string.

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

Sidebar

Related Questions

I'm unmarshalling a response for soap message like the following <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema>
<?xml version=1.0 ?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/ xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance> <SOAP-ENV:Body> <ns1:getCountriesResponse xmlns:ns1=SoapQrcode> <return SOAP-ENC:arrayType=:[8]
For example, In this document < ?xml version=1.0 ? > < SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/
I've a SOAP response in a var $soap_response like this: <SOAP-ENV:Envelope SOAP-ENV:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/ xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd=http://www.w3.org/2001/XMLSchema
Hello i have following XML <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:SOAP-ENC=http://schemas.xmlsoap.org/soap/encoding/ ... someID=ID123> <SOAP-ENV:Header xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/><endpoints> ... Let's
My input XML is as follows: <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/> <SOAP-ENV:Header> <ns0:PartyInfo xmlns:ns0=http://www.google.com/> <name xmlns=>John</name> </ns0:PartyInfo>
how to parse soap response data <?xml version=1.0 encoding=utf-8 ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:sqltypes= http://schemas.microsoft.com/SQLServer/2001/12/SOAP/types
I have the following xml; <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header> <mm7:TransactionID xmlns:mm7='http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-6-MM7-1-4' env:mustUnderstand='1'>6797324d</mm7:TransactionID> </env:Header> <env:Body> <DeliveryReportReq
I'm using the an API, and I get this kind of response: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
I have a soap request returning a response like below: <SOAP-ENV:Envelope xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/ xmlns:xsd=http://www.w3.org/2001/XMLSchema xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance

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.