views:

1090

answers:

0

I am writing a Java console client app for an existing web service with Metro. The classes are generated with wsimport, and I have a small test program that instantiates a service and a port, executes the following code, and calls the service.

((BindingProvider) port).getRequestContext().put(
    BindingProvider.USERNAME_PROPERTY, "some_random_username");
((BindingProvider) port).getRequestContext().put(
    BindingProvider.PASSWORD_PROPERTY, "some_random_password");
((BindingProvider) port).getRequestContext().put(
    BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
    "some_random_url");

When the service is invoked, I get this error:

Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
Missing <wsse:Security> in SOAP Header

I think I'm missing a way to set up the java.net.Authenticator, but I have no idea where to start. Who has pointers to documentation for whatever I'm missing?