Check the actual Message. .NET is probably sending a wsu:Timestamp, as well , and the WSS4J processing code is "processing" it, causing the list of "actions" to differ from what you specified.

This is really an issue with the WSS4J code (and the fact that CXF uses it, at all). Could you please file a bug against this?

As a workaround, try adding "Timestamp" (whitespace separated) to the "action" entry in the configuration of your WSS4J interceptor.

On Sep 24, 2007, at 7:13 AM, <[EMAIL PROTECTED]> <[EMAIL PROTECTED]> wrote:

Hi All,

I got a problem when I wrote .net code to call cxf. Can anyone help me out? Thanks in advance.

Error stack:
joe
password11
2007-9-24 18:47:09 org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor handleMessage
警告: Security processing failed (actions mismatch)
2007-9-24 18:47:09 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
信息: Interceptor has thrown exception, unwinding now
org.apache.cxf.binding.soap.SoapFault: ACTION_MISMATCH
at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage (WSS4JInInterceptor.java:207) at org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor.handleMessage (WSS4JInInterceptor.java:59) at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept (PhaseInterceptorChain.java:207) at org.apache.cxf.transport.ChainInitiationObserver.onMessage (ChainInitiationObserver.java:73) at org.apache.cxf.transport.servlet.ServletDestination.doMessage (ServletDestination.java:78) at org.apache.cxf.transport.servlet.ServletController.invokeDestination (ServletController.java:231) at org.apache.cxf.transport.servlet.ServletController.invoke (ServletController.java:139) at org.apache.cxf.transport.servlet.CXFServlet.invoke (CXFServlet.java:271) at org.apache.cxf.transport.servlet.CXFServlet.doPost (CXFServlet.java:249)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper $ServletServiceAction.run(StubSecurityHelper.java:223) at weblogic.servlet.internal.StubSecurityHelper.invokeServlet (StubSecurityHelper.java:125) at weblogic.servlet.internal.ServletStubImpl.execute (ServletStubImpl.java:283) at weblogic.servlet.internal.ServletStubImpl.execute (ServletStubImpl.java:175) at weblogic.servlet.internal.WebAppServletContext $ServletInvocationAction.run(WebAppServletContext.java:3245) at weblogic.security.acl.internal.AuthenticatedSubject.doAs (AuthenticatedSubject.java:321) at weblogic.security.service.SecurityManager.runAs (SecurityManager.java:121) at weblogic.servlet.internal.WebAppServletContext.securedExecute (WebAppServletContext.java:2003) at weblogic.servlet.internal.WebAppServletContext.execute (WebAppServletContext.java:1909) at weblogic.servlet.internal.ServletRequestImpl.run (ServletRequestImpl.java:1359)
 at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
 at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)

jaxws config:
<jaxws:endpoint id="helloWorld" implementor="demo.spring.HelloWorldImpl" address="/HelloWorld">
  <jaxws:inInterceptors>
   <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
   <bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
    <constructor-arg>
     <map>
      <entry key="action" value="UsernameToken" />
      <entry key="passwordType" value="PasswordText" />
<entry key="passwordCallbackClass" value="demo.spring.AuthenticationCallbackHandler" />
     </map>
    </constructor-arg>
   </bean>
  </jaxws:inInterceptors>
 </jaxws:endpoint>


.NET client code:
localhost.HelloWorldImplServiceWse service = new CXFTest.localhost.HelloWorldImplServiceWse(); service.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;

UsernameToken token = new UsernameToken("joe", "password", PasswordOption.SendPlainText);
            service.SetClientCredential<UsernameToken>(token);
            service.SetPolicy("ClientPolicy");

            sayHi hi = new sayHi();
            hi.arg0 = "test";
            service.sayHi(hi);


Thanks,
Mark

Reply via email to