Skip to main content

Create WebService server using Metro with UsernameToken security

Please note these forums are being decommissioned and use the new and improved forums at
2 replies [Last post]
Joined: 2011-10-20

Hi everybody,

I'm here because I have some trouble deploying a WebService (server) and I need your help, I can't find anything on google.

I'm using NetBeans 7.0.1, GlassFish 3.1.1 (with JaxWs 2.2 and Metro 2.1.1-b09) and developping WebService in "java-first" style.

I have succesfully deployed my WebService without security but when I try to add some security using NetBeans GUI, that doesn't work for me

Here my (very simple) WebService : (just a simple "hello world").

And I try to add UsernameToken Security by modifying (via Netbeans) the properties of my WebService :

"Secure Service" -> "Message Authentication over SSL" ("Username", "1.1", "Basic 128bit", "Lax")

Then I deployed my WebService on GlassFish witch recognised JSR109 annotations and create the WebService, here the WSDL generated :

But when I try to consume the WebService, there is no security and I can't see any headers security in SOAP messages.

There is a WSIT generated also, but my guess is that "policies" aren't added to the WSDL when it's generated.

Do you have any idea ? Maybe I'm doing something wrong ?

Thanks all, in advance.

PS: I also try to use sun-jaxws.xml and WS context Servlet, but it was the same result...


Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Joined: 2011-10-20

It's because I created a "maven" project.

I try with a normal project, and the WSDL was generated correctly with all policies rules in it.

Maybe we have to configure something in Maven. If you have informations about it, thanks to answer me.


Joined: 2005-01-14