473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to pass networkcredentials in java client code for .Net web service?

Hello All,

I want to invoke the .Net Based webservice from a java client code using axis api.

As we pass the credentials in .Net
"uin.Credentials = new NetworkCredential("administrator", "Tech1234", "WORKGROUP");"

I have to pass them in java code.

I have tried with
" System.setProperty("http.proxyUser","Administrator ");
System.setProperty("http.proxyPassword","Tech1234" );
"
But still I am getting 401 Unauthorized response.

How I can pass these credentials through a java code?

Thanks And Regards,
Amarja
Sep 2 '08 #1
3 12983
try this
Expand|Select|Wrap|Line Numbers
  1. HttpClient client = new HttpClient ();
  2. NTCredentials creds = new NTCredentials (user, password, machine, domain);
  3. client.getState().setProxyCredentials (AuthScope.ANY, creds);
  4. HostConfiguration config = new HostConfiguration ();
  5. config.setProxy (proxyHost, proxyPort);
  6. PostMethod post = new PostMethod (endPoint);
  7.  
it is not working in my case:( may be helpful to you...
Sep 22 '08 #2
numberwhun
3,509 Expert Mod 2GB
I believe this to actually be a Java question and not an Apache question. For that reason, I am moving this to the Java forum.

Regards,

Jeff
Sep 24 '08 #3
Nepomuk
3,112 Expert 2GB
Hi Techmighty!
Is there a good reason, why you have different capitalisation?
"uin.Credentials = new NetworkCredential("administrator", "Tech1234", "WORKGROUP");"
...
" System.setProperty("http.proxyUser","Administrator ");
System.setProperty("http.proxyPassword","Tech1234" );
"
("administrator" vs. "Administrator") That could be your Problem.

Greetings,
Nepomuk
Sep 24 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Paul Hutchinson | last post by:
All, I wonder if anyone can help/advise with the following interoperability issue we are encountering? We have a .NET web service that takes an abstract type as parameter. Using it from a...
2
by: B Deepak | last post by:
Hi, I have a c# developed web service deployed on IIS. and I am accessing it thorogh java client. Now the problem is whenever we call a web method with a parameter list from java client, web...
7
by: David Laub | last post by:
I've also posted this issue to a Sun/java formum, but since it appears to be an integration issue, this may be the better place to posr: I have written a dot net/c# Web Services doesn't fully...
1
by: Samudrala | last post by:
Hi, I have developed a web service developed in C#. the WSDL I gave is working fine with .net client. But when java client consumes it always raising exception. I have basic knowledge of java too...
0
by: Alexiel | last post by:
Hi, i have a problem, I have a Java Client and i call my webservice on ..NET. This run perfectly just except when i send parameters don't work fine. I send my code : This is my java...
0
by: Alexiel | last post by:
Hi, i have a problem, I have a Java Client and i call my webservice on ..NET. This run perfectly just except when i send parameters don't work fine. I send my code : This is my java...
2
by: maleone41 | last post by:
I have a C# web service running on a machine that I would like to connect to with a Java client. To verify the web service is working properly, i quickly made a C# client, added a web reference,...
5
by: Nick K. | last post by:
I use wsdl.exe to generate client code to call a web service. The actual web service is generated with the BizTalk Web Services Publishing Wizard. I'm not sure this is particular to the BizTalk...
0
by: Siyodia | last post by:
This is a java program which i need to run facing compilation error Its consuming a third party web service method I have the supported files(folder) which contain necessary class files...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.