This week's book giveaway is in the Security forum.
We're giving away four copies of Penetration Testing Basics and have Ric Messier on-line!
See this thread for details.
Win a copy of Penetration Testing Basics this week in the Security forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

sending xml over http - security issue

e vanduffel
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all,
I am trying to send an XML file over HTTP by using a java program
(to a webmethods integration server).
but i get the following warning :
[WARN] HttpMethodBase - -No credentials available for the 'webMethods' authentication realm at host
the return code i get is 401 , acces denied...
What do I do wrong?
Can anybody help me on this? Code is listed below
File input = new File("C:\Data\javamail\example.xml");
HttpClient httpclient = new HttpClient();
// Execute request
httpclient.getState().setCredentials( "webMethods","http://host",new UsernamePasswordCredentials("user", "paswd"));
PostMethod post = new PostMethod("http://host/invoke/service");
// Request content will be retrieved directly
// from the input stream
post.setRequestBody(new FileInputStream(input));
if (input.length() < Integer.MAX_VALUE) {
} else {
post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
int result = httpclient.executeMethod(post);
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic