I have some problems:

i start trying to add a simple timestamp, but the client don't add it:

this is the client config (it's very similar to the test's one):


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans";
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
       xmlns:jaxws="http://cxf.apache.org/jaxws";
       xsi:schemaLocation="
          http://www.springframework.org/schema/beans          
http://www.springframework.org/schema/beans/spring-beans.xsd
          http://cxf.apache.org/jaxws                          
http://cxf.apache.org/schemas/jaxws.xsd
          ">

    <jaxws:client id="securityClient" createdFromAPI="true">
        <jaxws:outInterceptors>
            <bean
class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor"/>
            <ref bean="TimestampSignEncrypt_Request"/>
        </jaxws:outInterceptors>
    </jaxws:client>
    <bean
        class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor"
        id="TimestampSignEncrypt_Request">
        <constructor-arg>
            <map>
                <entry key="action" value="Timestamp"/>
            </map>
        </constructor-arg>
    </bean>
</beans>



But SOAP messages received by server don't have the WSS header...


This is the Client log.. seems that it only check if there is the WSS
header, what i miss?



[java] May 15, 2008 4:04:38 PM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
     [java] INFO: Loading XML bean definitions from URL
[file:/home/examples/ws-sec-encrypt/client.xml]
     [java] May 15, 2008 4:04:38 PM
org.springframework.context.support.AbstractApplicationContext
obtainFreshBeanFactory
     [java] INFO: Bean factory for application context
[EMAIL PROTECTED]:
[EMAIL PROTECTED]
     [java] May 15, 2008 4:04:39 PM
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
     [java] INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor'
is not eligible for getting processed by all BeanPostProcessors (for
example: not eligible for auto-proxying)
     [java] May 15, 2008 4:04:39 PM
org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker
postProcessAfterInitialization
     [java] INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor'
is not eligible for getting processed by all BeanPostProcessors (for
example: not eligible for auto-proxying)
     [java] May 15, 2008 4:04:39 PM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
     [java] INFO: Pre-instantiating singletons in
[EMAIL PROTECTED]:
defining beans
[cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.object.ObjectBindingFactory,org.apache.cxf.transport.local.LocalTransportFactory,org.apache.cxf.javascript.JavascriptQueryHandlerRegistry,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.ws.policy.AssertionBuilderRegistry,org.apache.cxf.ws.policy.PolicyConstants,org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry,org.apache.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry,org.apache.cxf.ws.policy.attachment.external.EndpointReferenceDomainExpressionBuilder,org.apache.cxf.ws.policy.PolicyBuilder,org.apache.cxf.ws.policy.PolicyEngine,org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11AttachmentPolicyProvider,org.apache.cxf.ws.policy.attachment.ServiceModelPolicyProvider,org.apache.cxf.ws.policy.mtom.MTOMAssertionBuilder,org.apache.cxf.ws.policy.mtom.MTOMPolicyInterceptorProvider,org.apache.cxf.binding.corba.CorbaBindingFactory,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,org.apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cxf.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cxf.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.management.jmx.InstrumentationManagerImpl,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFactory,org.apache.cxf.ws.rm.RMManager,org.apache.cxf.ws.rm.policy.RMPolicyInterceptorProvider,org.apache.cxf.ws.rm.RMAssertionBuilder,org.apache.cxf.transport.jms.JMSTransportFactory,org.apache.cxf.jaxrs.JAXRSBindingFactory,org.apache.cxf.binding.http.HttpBindingFactory,securityClient.jaxws-client.proxyFactory,securityClient.jaxws-client,TimestampSignEncrypt_Request];
root of factory hierarchy
     [java] Configurazione caricata
     [java] May 15, 2008 4:04:42 PM
org.apache.cxf.service.factory.ReflectionServiceFactoryBean
buildServiceFromWSDL
     [java] INFO: Creating Service
{http://www.rivenditore.org/Ordine}OrdineService from WSDL:
file:WEB-INF/ordini.wsdl
     [java] Exception in thread "main" javax.xml.ws.soap.SOAPFaultException:
Request does not contain required Security header.
     [java]     at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:218)
     [java]     at $Proxy25.submitOrdine(Unknown Source)
     [java]     at isi.esercitazione.ese8.client.Client.main(Client.java:94)
     [java] Caused by: org.apache.cxf.binding.soap.SoapFault: Request does
not contain required Security header.
     [java]     at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70)
     [java]     at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
     [java]     at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:220)







dkulp wrote:
> 
> 
> 
> Probably not the best answer, but you could possibly take a look at  
> our system test code at:
> http://svn.apache.org/repos/asf/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/ws/security/
> as an example for how to configure things.
> 
> 
> Dan
> 
> 
> 
> On May 14, 2008, at 11:33 AM, Cencio wrote:
> 
>>
>> Hi all,
>>
>> i'm trying to set up a sample with WS-Security encrypt and/or sign.  
>> (didn't
>> found crypt in samples or userguide)
>>
>> let's suppose i create the certificate following the steps in the  
>> userguide:
>>
>> keytool -genkey -alias myAlias -keypass myAliasPassword -keystore
>> privatestore.jks  -storepass keyStorePassword -dname "cn=myAlias" - 
>> keyalg
>> RSA
>> keytool -selfcert -alias myAlias -keystore privatestore.jks -storepass
>> keyStorePassword -keypass myAliasPassword
>> keytool -export -alias myAlias -file key.rsa -keystore  
>> privatestore.jks
>> -storepass keyStorePassword
>> keytool -import -alias myAlias  -file key.rsa -keystore  
>> publicstore.jks
>> -storepass keyStorePassword
>>
>> How should be the client/server spring config to encrypt messages?
>>
>> Thx,
>> Lorenzo
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/WS-Security-sample-tp17233988p17233988.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
> 
> ---
> Daniel Kulp
> [EMAIL PROTECTED]
> http://www.dankulp.com/blog
> 
> 
> 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/WS-Security-sample-tp17233988p17254067.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to