This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

Configure HTTP Basic authentication for webservice  RSS feed

 
venky chin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

I am generating webservice using axis commands. Below are the steps i am doing for publishing the webservice.

1) Create the java program(which has basic getter setter methods) and compile the same.
2) Generate the WSDL using eclipse for the program created in step1.
3) Generate the Server-side Wrapper Code and Stubs
java -classpath <CLASSPATH> org.apache.axis.wsdl.WSDL2Java -U TEST -P test123 -o . -d Session -s -p <Folder location> test.wsdl
4) compile the generated files in <Folder Location> ( stubs generated in step3)
5) create jar file
6) copy the wsdl file and jar file to the weblogic server /lib and /classes folder
7) restart the stack
8) deploy the service
java -classpath <CLASSPATH> org.apache.axis.client.AdminClient -lhttps://<host>:<port>/services <folder location>/deploy.wsdd

With these steps i am able to publish my webservice.

But the authentication doesnt work. This is implemented in step3 with options -U and -P

I am able to call service without username and password.

Can you please let me know ow we can acheive basic authenication using this axis approach.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
But the authentication doesnt work. This is implemented in step3 with options -U and -P

That username and password is just for accessing the WSDL -which, given that you're reading it from a local file- is not needed at all. You still need to alter the code to pass username and password. I bet if you observe your WS call in transit you'd notice that the call sends no Basic Auth info.
 
venky chin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi,

Can you please suggest the steps/code to implement basic authentication
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
I haven't done that in a while (I prefer to use WS-Security), but there was a discussion about that some years ago: http://www.coderanch.com/t/466674/Web-Services/java/Axis-BASIC-AUTHENTICATION
 
venky chin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Report post to moderator
Can you please suggest one sample java code for implementing security(webservice which requires user name and password for using the same).
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Report post to moderator
Closing this topic, as it's now a duplicate of this one.

Please do not post the same question to multiple forums.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!