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.
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.
This is likely related to web/ejb projects and ervice-ref elements that should be configurable using sun-web.xml editor.
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.
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.
@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.
Doh! - that last sentence was supposed to read "... using an <injection-target> deployment descriptor entry ..."
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.
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.
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.