File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Sockets and Internet Protocols and the fly likes sending xml over http - security issue Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "sending xml over http - security issue" Watch "sending xml over http - security issue" New topic

sending xml over http - security issue

e vanduffel

Joined: Nov 04, 2003
Posts: 12
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);
I agree. Here's the link:
subject: sending xml over http - security issue