Hi. I've spent a few days googling for this, and haven't found it, but I
apologize if I'm rehashing an old question. We're using CXF 2.0.8.
I've successfully built a CXF client to my server, using the following outProps:
outProps.put(WSHandlerConstants.ACTION,
WSHandlerConstants.USERNAME_TOKEN);
// Specify our username
outProps.put(WSHandlerConstants.USER, username);
// Password type : plain text
outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
// Callback used to retrieve password for given user.
outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS,
ClientPasswordCallback.class.getName());
WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
cxfEndpoint.getOutInterceptors().add(wssOut);
cxfEndpoint.getOutInterceptors().add(new SAAJOutInterceptor()); //
2.0.x only; not needed in 2.1+
List<Project> projects = pa.getProjectsByUser(username);
I'm now tasked with establishing a connection to the same CXF-based web
services using a C# client, built in VS2008. If I use the wizard to created a
reference, and run it, all I get is an exception, saying there's an error
processing the wsse:security headers. I've been reading a lot about having to
manually change the app.config settings around the service references, but so
far, none have gotten me a connection. Some throw the same error, some throw
different errors. Here's the code setting up the C# client, and the exception
is thrown on the last line:
ProjectService.ProjectApiClient projectService = new
ProjectService.ProjectApiClient();
Console.Write(projectService.Endpoint.Address.Uri);
projectService.ClientCredentials.UserName.UserName = txtUser.Text;
projectService.ClientCredentials.UserName.Password =
txtPassword.Text;
ProjectService.project p = projectService.getProjectByName("116MB");