How to register a RealmAuthenticationAdapter when using Endpoint.publish()
For testing purposes I want to create my WS with Endpoint.publish() instead deploying it in a real container. But there is one problem now: how to register a own com.sun.xml.wss.RealmAuthenticationAdapter?
According the thread "JAAS integration with third party container" (see http://forums.java.net/node/663477) a RealmAuthenticationAdapter is done as follows:
1. Implement your own RealmAuthentication class that extends the RealmAuthenticationAdapter.
2. Package the implementation class inside your WAR File
3. Create a META-INF/services entry (inside the WAR) for your RealmAuthenticator. The services file should be named as : com.sun.xml.xwss.RealmAuthenticator and the contents of the file should be the fully qualified package name of your RealmAuthenticator class.
But how to proceed with Endpoint.publish()? Is there a way to register such an adapter dynamically besides adding a file META-INF/services/com.sun.xml.xwss.RealmAuthenticator to the classpath with the desired content?