This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes securing web service developed as an EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "securing web service developed as an EJB " Watch "securing web service developed as an EJB " New topic
Author

securing web service developed as an EJB

anas alsarairah
Greenhorn

Joined: Sep 27, 2007
Posts: 28
Hello All

i am tryieng to secure a web service that is developed as an EJB 3.1 , here is the code for the service



also here is the deployment descripter i am using



and here is my sun-web.xml




i have also created a user of group ecs in the application server and by the way i am using glassfish application server v3.1 , now whwen try to test this service using Soap UI and providing the user that i have created for group ecs i get the following error

[b]java.lang.Exception: Client not authorized for invocation of public com.ans.TestResponse com.ans.Anas.sayAnas(com.ans.TestRequest)[/b]
ramesh kancherla
Ranch Hand

Joined: May 01, 2008
Posts: 124
Hi anas,

recently i got same problem. & i solved my problem as

username and password are configure in Glashfish server for that role ecs.

I have given that username and password in Soup ui request properties.

I got solve my problem.

I think it is help full for you.

Regards
Ramesh



[Thumbnail for soupui_requestproperties.JPG]

anas alsarairah
Greenhorn

Joined: Sep 27, 2007
Posts: 28
hi
thanks for your reply .. i am already putting the user name and password in soap UI but the same ... so can you please post your code example here if possible

thank you
ramesh kancherla
Ranch Hand

Joined: May 01, 2008
Posts: 124
http://jee-bpel-soa.blogspot.com/2009/03/securing-web-services-with-http-basic.html

i followed this article


Regards
Ramesh
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Please UseCodeTags when posting code. It will highlight your code and make it much easier to read. It probably will also increase the number of people helping you. I've added them for you since you are new so that you can see the difference.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: securing web service developed as an EJB