views:

654

answers:

4

I am trying to create a simple axis web service.

I am using axis 1.2.1, JDK 6, Weblogic.

Everything seems to be fine except invoking the web service.

When I try to invoke the service it gives me an 'Unauthorized' error.

Any ideas of what am I doing wrong?

AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (401)Unauthorized faultActor:
faultNode: faultDetail: {}:return code: 401

{http://xml.apache.org/axis/}HttpErrorCode:401

(401)Unauthorized at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744) at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144) at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32) at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118) at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165) at org.apache.axis.client.Call.invokeEngine(Call.java:2765) at org.apache.axis.client.Call.invoke(Call.java:2748) at org.apache.axis.client.Call.invoke(Call.java:2424) at org.apache.axis.client.Call.invoke(Call.java:2347) at org.apache.axis.client.Call.invoke(Call.java:1804)

A: 

401 unauthorized indicates you need a username/password to access that web service. Are you setting these in your code before the Call.invoke?

JoseK
Hi josek,Thank you for the response.I sorted this out myself.It was due to some dependency which was inherited from other project.Thank you.
jani
A: 

Hi all,

I sorted this out myself.

It was due to some dependency which was inherited from other project.

Thank you.

jani
A: 

Hi...

Jani, could you please give us some more information on your dependecy issue? I'm facing the same problem here... And no idea of what's going on...

Thanks!

Roxu
A: 

If your service is protected ( i.e. Apache AuthType Basic ), you must call these two methods below :

call.setUsername("your login");
call.setPassword("you password");

where call is org.apache.axis.client.Call

STB Land