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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T10:34:19+00:00 2026-06-11T10:34:19+00:00

I am reading data from a webservice. The issue if I put the link

  • 0

I am reading data from a webservice. The issue if I put the link on the browser it works fine. When I run like this give me error. I am suspecting is it due to the way how I send my parameters. My paramater list has this dID=1,5,7,11,14,18,26&FromDate=18 Sep 2012 00:00 am&ToDate=18 Sep 2012 10:00 am. Do I need to do some encoding here?

URL xmlURLDM = new URL(urlDM);
InputStream xml2 = xmlURLDM.openStream();

I get this error

java.io.IOException: Server returned HTTP response code: 400 for URL: 
 at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1612)
        at java.net.URL.openStream(URL.java:1035)
        at xmlreader.main(xmlreader.java:172)
  • 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-11T10:34:20+00:00Added an answer on June 11, 2026 at 10:34 am

    You do need encoding, most likley it is the spaces in your URL that is causing the trouble.
    Use Javas built in url-encoding. eg:

    String encoded = URLEncoder.encode(myUrl, "UTF-8");
    

    …
    call web service with encoded as URL

    There can be other reasons for the status code being 400, but this encoding issue is probably your first stumbling block.

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

Sidebar

Related Questions

I am reading data from XML like this: (Contacts.xml) <?xml version=1.0 encoding=utf-8 standalone=yes?> <!--LINQ
I'm reading JSON from a WebService and put my data in a list of
I'm reading data from a webservice that returns html friendly ascii codes instead of
I am reading data from a Comma-separated Value (CSV) document and saving its contents
I am reading data from an Excel worksheet. Some of the data is percent
I'm reading data from a file -> saving into DB -> Loading my Custom
I am reading data from multiple serial ports. At present I am using a
I'm reading data from a serial port using an event listener from the SerialPort
I'm reading data from a stream into a char array of a given length,
I am reading data from a file that has, unfortunately, two types of character

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.