This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

(401)Unauthorized while invoking the webservice!!!!  RSS feed

 
Rajesh Unnithan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am facing an issue with my web service. I am trying to port my application from jboss to weblogic. I deployed the application in weblogic and tried to invoke the web service. But I am getting a 401 Un authorized error.
I am exposing a stateless session bean as web service. In the server-config.wsdd I have specified the authentication mechanism as “SimpleAuthenticationHandler”. Please see the code below.
<service name="XXXService" provider="java:EJB">
<parameter name="allowedMethods" value="MMMM,NNNN"/>
<parameter name="beanJndiName" value="XXXX"/>
<parameter name="homeInterfaceName" value="XXXXHome"/>
<requestFlow>
<handler type="javarg.apache.axis.handlers.SimpleAuthenticationHandler" />
</requestFlow>
</service>


And in my WEB-INF folder I have a users.lst file which specifies the UID/PWD which should be used for authentication.

When I tried to invoke the webservice using the end point URL I am able to access the web service. It is not even asking for UID/PWD to enter. I am not sure if it’s a default behavior or not. But If I try to access the service using a client programme. I am getting a 401Un authorized error. I am sure that I am passing the correct UID/PWD.

The following code explains how I am connecting to the web service via the client.
XXXStub abc = (XXXStub)factory.getMyService();
abc.setUsername(“username”);
abc.setPassword(“password”);
result = ((XXXStub)abc).MMMM();

I am getting the following error message when I invoke the webservice

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

(401)Unauthorized
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:732)

at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:143)
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)

When I remove the security code from the client & from the server-config.wsdd. It works fine. I am thinking the way that I am specifying the security information in server-config.wsdd is incorrect. I dont have any issue with this in jboss. its all appearing only in weblogic. I am using axis1.2 and weblogic10.

Please help me to resolve this issue?

Appreciate your help

Regards
Hari
 
lee bluse
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had the same problem . Can you tell me hao you resolve it ???
You can send e-mail to me , the address is : cool.tiancai@163.com
Wait your help!
Appreciate your help.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!