473,804 Members | 3,797 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

1 New Member
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.Credential s = new NetworkCredenti al("administrat or", "Tech1234", "WORKGROUP" );"

I have to pass them in java code.

I have tried with
" System.setPrope rty("http.proxy User","Administ rator");
System.setPrope rty("http.proxy Password","Tech 1234");
"
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 13035
abhishekbrave
79 New Member
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 Recognized Expert Moderator Specialist
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 Recognized Expert Specialist
Hi Techmighty!
Is there a good reason, why you have different capitalisation?
"uin.Credential s = new NetworkCredenti al("administrat or", "Tech1234", "WORKGROUP" );"
...
" System.setPrope rty("http.proxy User","Administ rator");
System.setPrope rty("http.proxy Password","Tech 1234");
"
("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
4465
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 .net client works OK. However calling the method from a java client (Websphere 5.0) we see the following error being thrown on the call to the method.
2
2201
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 service recieves this parameter as null. Waiting for a solution........... Thanks, Deepak
7
7118
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 work with J2ME client a) c# web service works with c# WIndows Client (local & remote web service) b) c# web service works with J2ME client - when the Web Service is local c) c# web service fails with J2ME client - when the Web Service is remote ...
1
8130
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 but never worked on consuming/producing web services. can any body send sample source code for java client so that i can test my web service in java client. thanx in advance samudrala
0
2237
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 client.......... import java.io.*; import java.util.*;
0
1607
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 client..........
2
1765
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, and connected to the web service no problem. My problem is developing the Java client. I'm creating a socket and then just sending the soap requests through out.println() to the web service, but it's not working at all. Any advice?
5
4981
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 code but the calls to web methods pass parameters by ref so that I have to call it like: XmlDocument doc = new XmlDocument(); doc.LoadXml(message);
0
2445
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 org/apache/axis The following is what i need to do but am unable to do //////////////////////////////////////////////////////////////////////////////////////////// set classpath where the below jars are located.... axis.jar commons-discovery.jar
0
9589
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10593
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4304
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.