This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 94887 - RFE: Enable security features for Java 5 web service clients
Summary: RFE: Enable security features for Java 5 web service clients
Status: NEW
Alias: None
Product: soa
Classification: Unclassified
Component: Composite Application (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Roderico Cruz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-02-07 20:12 UTC by rdelaplante
Modified: 2007-03-23 05:07 UTC (History)
6 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rdelaplante 2007-02-07 20:12:26 UTC
After creating a web service client, right click and select "Edit Web Service
Attributes".  When using Java 1.4 projects, you can enable security to access
secured services.  When using Java 1.5 projects, you cannot use secured web
services.
Comment 1 Milan Kuchtiak 2007-02-08 15:03:49 UTC
This is likely related to web/ejb  projects and ervice-ref elements that should
be configurable using sun-web.xml editor.
Comment 2 artibee 2007-02-08 22:35:12 UTC
Per http://www.netbeans.org/servlets/ReadMsg?list=nbusers&msgNo=84629
Vidhya wrote:
  I think the problem you face is probably due to the difference between 
j2ee 1.4 and java ee 5 web service clients. The stock client works the 
way it works because it is a jax-rpc (j2ee 1.4) based project. In the 
case of jaxws (java ee 5) clients, you have to perform one additional 
step. After you create the client reference node pls make sure you use 
the client in one of the servlets. Once you drag and drop the client 
node in your servlet you will see it adds a @WebServiceRef annotation 
which is what is detected by the Security tab to have it enabled.
Comment 3 rdelaplante 2007-02-09 02:42:15 UTC
Excellent!!  I recommend that the security tab's "Project not supported" text be
changed to explain why the it is not available, and what can be done to make it
available. 

I also noticed that when I drag/drop a web service method into the code window
of a class that is not a servlet, the @WebServiceRef is not inserted at the top
of the class.  I think it should not matter what type of class you are dropping
the web service method into, it should always insert the @WebServiceRef if it
does not  already exist. I'm using the web service from a DAO class, not a servlet. 
Comment 4 _ pcw 2007-02-09 02:51:31 UTC
@WebServiceRef is an injection qualified annotation and can only be used in
files supported by JavaEE resource injection (e.g. non static fields in Servlets
and EJB, and a few other types of java files, plus static fields in the Main
class for an app client.)

In particular, resource injection is not available in any DAO classes AFAIK.  I
can't remember if you can get past this by using the <injection-target>
annotation to inject specific resources, but you might be able to.
Comment 5 _ pcw 2007-02-09 02:52:38 UTC
Doh! - that last sentence was supposed to read "... using an <injection-target>
deployment descriptor entry ..."
Comment 6 rdelaplante 2007-02-09 04:04:11 UTC
Interesting... since I'm using Visual Web Pack, I haven't created any servlets.
 The only place in the whole program that needs to use a web service is a DAO
pojo that I created.  I'll have to give this a bit more thought.  Anyway, after
pasting the @WebServiceRef into my DAO class and deleting the servlet, the "Edit
Web Service Attributes" screen's security tab still displays the security settings. 
Comment 7 _ pcw 2007-02-10 04:09:26 UTC
Keep in mind you can always explicitly declare a client service-ref in
web.xml/sun-web.xml and load it via jndi instead of resource injection -- this
will work in any class in the web app.  I do not know if the VWP experience
could have been more seamless, but at a strictly spec level + NetBeans web
project, there are many ways to solve this problem.
Comment 8 rdelaplante 2007-03-23 05:07:32 UTC
The two work items for this ticket are:

1) After pasting @WebServiceRef into my DAO class and deleting the servlet, the
"Edit Web Service Attributes" screen's security tab still displays the security
settings.  @WebServiceRef is only valid for servlets.

2) The security tab's "Project not supported" text should be changed to explain
why it is not available, and what can be done to make it available.