• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Server returned HTTP response code: 405 for URL

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a httpURLconnection class, if i try to call the method conn.getInputStream() it returns
"Server returned HTTP response code: 405 for URL"
Please let me know the solution,
code is given below.
Pavan

String url="http://www.flash-b.com/services/ws/siteInspect.wsdl";
URL target=new URL(url);
conn = (HttpURLConnection)target.openConnection();
conn.setRequestProperty("Proxy-Authorization", auth);
conn.setAllowUserInteraction(true);
conn.setRequestProperty("content-type","text/xml");
conn.setDoInput(true);
conn.setDoOutput(true);
conn.setUseCaches (false);
conn.setDefaultUseCaches (false);
conn.setRequestMethod("GET");
PrintWriter out = new PrintWriter(conn.getOutputStream());
StringBuffer sc = new StringBuffer();
String line = null;
conn.getInputStream();
 
author
Posts: 3252
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Code 405 means "HTTP method not allowed". In this case the method is GET, which is a bit odd. All I can think of is that either the service is not supporting GET, or your proxy is trying to do clever stuff that the web server doesn't like.
Any more thoughts?
- Peter
 
reply
    Bookmark Topic Watch Topic
  • New Topic