Your jaxws:client configuration isn't getting picked up, as you're
missing a name attribute, e.g. in the security systest client.xml
<jaxws:client
name="{http://apache.org/hello_world_soap_http}TimestampSignEncryptPort"
createdFromAPI="true">
...
</jaxws:client>
Colm.
-----Original Message-----
From: Cencio [mailto:[EMAIL PROTECTED]
Sent: 15 May 2008 15:09
To: [email protected]
Subject: Re: WS-Security sample
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]
4f37
[java] May 15, 2008 4:04:39 PM
org.springframework.context.support.AbstractApplicationContext$BeanPostP
rocessorChecker
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$BeanPostP
rocessorChecker
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]
4f37:
defining beans
[cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bu
s.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManag
er,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.Bindin
gFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.a
pache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLMana
ger,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueue
Manager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.e
ndpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,or
g.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.h
ttp.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistr
y,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatal
ogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.ap
ache.cxf.binding.object.ObjectBindingFactory,org.apache.cxf.transport.lo
cal.LocalTransportFactory,org.apache.cxf.javascript.JavascriptQueryHandl
erRegistry,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf
.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEdi
torConfigurer,org.apache.cxf.transport.http.policy.HTTPClientAssertionBu
ilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,or
g.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cx
f.ws.policy.AssertionBuilderRegistry,org.apache.cxf.ws.policy.PolicyCons
tants,org.apache.cxf.ws.policy.PolicyInterceptorProviderRegistry,org.apa
che.cxf.ws.policy.attachment.external.DomainExpressionBuilderRegistry,or
g.apache.cxf.ws.policy.attachment.external.EndpointReferenceDomainExpres
sionBuilder,org.apache.cxf.ws.policy.PolicyBuilder,org.apache.cxf.ws.pol
icy.PolicyEngine,org.apache.cxf.ws.policy.attachment.wsdl11.Wsdl11Attach
mentPolicyProvider,org.apache.cxf.ws.policy.attachment.ServiceModelPolic
yProvider,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.WebServiceContext
ResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl,org.
apache.cxf.ws.addressing.policy.AddressingAssertionBuilder,org.apache.cx
f.ws.addressing.policy.AddressingPolicyInterceptorProvider,org.apache.cx
f.ws.addressing.policy.UsingAddressingAssertionBuilder,org.apache.cxf.bi
nding.xml.XMLBindingFactory,org.apache.cxf.management.jmx.Instrumentatio
nManagerImpl,org.apache.cxf.transport.http_jetty.JettyHTTPTransportFacto
ry,org.apache.cxf.ws.rm.RMManager,org.apache.cxf.ws.rm.policy.RMPolicyIn
terceptorProvider,org.apache.cxf.ws.rm.RMAssertionBuilder,org.apache.cxf
.transport.jms.JMSTransportFactory,org.apache.cxf.jaxrs.JAXRSBindingFact
ory,org.apache.cxf.binding.http.HttpBindingFactory,securityClient.jaxws-
client.proxyFactory,securityClient.jaxws-client,TimestampSignEncrypt_Req
uest];
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.handleM
essage(Soap11FaultInInterceptor.java:70)
[java] at
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleM
essage(Soap11FaultInInterceptor.java:35)
[java] at
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
hain.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/apa
che/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.
----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland