By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,269 Members | 1,507 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,269 IT Pros & Developers. It's quick & easy.

401-Access Denied error when Axis client calling .Net service

P: n/a
Hi,

I'm using the following Axis java client to invoke a .Net web service hosted
my localhost. Although the username and password is set on the "call", client
gets (401) Access Denied" exception.

private static void testTest() {
try {
String endpoint = "http://localhost/WebService1/Service1.asmx";
String method = "Test";
String serviceName = "Service1";

Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress(new java.net.URL(endpoint));
//call.setOperationName(new QName(serviceName, method));
call.setOperationName( method );
call.setReturnType(XMLType.XSD_STRING);
call.setUsername("DOMAIN_NAME\\username");
call.setPassword("password");

String ret = (String) call.invoke( new Object [] { });

log.info("Got result : " + ret);
} catch (Exception e) {
log.error("testTest: " + e);
}

I can invoke the "Test" methods fine with IE brower. Note .Net web service
was installed and configured by someone else who isn't available.

Any suggestion is welcomed, as I'm .Net guy.

Thanks
Scott
Jun 6 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
I'm not a .Net guy.

"Scott Yen" wrote:
Hi,

I'm using the following Axis java client to invoke a .Net web service hosted
my localhost. Although the username and password is set on the "call", client
gets (401) Access Denied" exception.

private static void testTest() {
try {
String endpoint = "http://localhost/WebService1/Service1.asmx";
String method = "Test";
String serviceName = "Service1";

Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress(new java.net.URL(endpoint));
//call.setOperationName(new QName(serviceName, method));
call.setOperationName( method );
call.setReturnType(XMLType.XSD_STRING);
call.setUsername("DOMAIN_NAME\\username");
call.setPassword("password");

String ret = (String) call.invoke( new Object [] { });

log.info("Got result : " + ret);
} catch (Exception e) {
log.error("testTest: " + e);
}

I can invoke the "Test" methods fine with IE brower. Note .Net web service
was installed and configured by someone else who isn't available.

Any suggestion is welcomed, as I'm .Net guy.

Thanks
Scott

Jun 6 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.