Hi Jim, I think the new client should be using the same context as the original one, as the newly created one is logically still part of the original one. But I'm not sure if all the context needs to be copied into the new one.
I noticed this behavior some months ago (something was not set in those RM control messages and that was causing some interop issue but I don't remember exactly what it was) and wanted to copy the context property responsible for this behavior to the RMclient to solve this issue (but I don't remember why I didn't do this ;-( ) regards, aki 2014-04-24 8:40 GMT+02:00 Jim Ma <[email protected]>: > Hi All, > When I tried to put all the security configuration properties in the > requestContext and call a service with both RM and security policy > enabled(like the service in WSRMWithWSSecurityPolicyTest) : > bp.getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, new > KeystorePasswordCallback()); > bp.getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,, > getResource("/META-INF/security-client.properties")); > .... > This doesn't work as expected and there is exception thrown: > Failed to send RM protocol message { > http://schemas.xmlsoap.org/ws/2005/02/rm}CreateSequence.: > org.apache.cxf.interceptor.Fault: Security configuration could not be > detected. Potential cause: Make sure jaxws:client element with name > attribute value matching endpoint port is defined as well as a > ws-security.signature.properties element within it. > > After I investigated the code, I saw all these ws-scurity configuration > properties are not copied into the new created message by RMClient which > initialized by RM interceptor. > That's the root cause for this failure. > I went back to look at jaxws spec about BindingProvider's requestContext > and it's scope. There isn't clue and detail to say if these properties > should be copied into the new created message like RM message from the > message which send out the real payload with user's setting though > requestContext. > Do you think we should copy them ? or What can do to support this easily? > Thanks in advance. > > Jim
