Hello All, I' trying to call a .net web service with spring - cxf configuration. I getting the following exception:
General security error (WSEncryptBody/WSSignEnvelope: Element to encrypt/sign not found: http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd, Timestamp) (the same with Body part). The error is clear.. but I call the same service with soapUI and it works with timestamp and body in the Parts configuration. Then, I suppose that timestamp and body will be there (signatureParts). My client-beans.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://cxf.apache.org/policy" xmlns:cxf="http://cxf.apache.org/core" xmlns:wsa="http://cxf.apache.org/ws/addressing" xmlns:http="http://cxf.apache.org/transports/http/configuration" 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 http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd "> <import resource="classpath:META-INF/cxf/cxf.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-http.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-http-binding.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-policy.xml" /> <import resource="classpath:META-INF/cxf/cxf-extension-ws-security.xml" /> <cxf:bus> <cxf:features> <p:policies /> <cxf:logging /> <wsa:addressing /> </cxf:features> </cxf:bus> <http:conduit name="http://wss.aduanas.gub.uy/.*"> <http:client Connection="Keep-Alive" AllowChunking="false" ConnectionTimeout="120000" ReceiveTimeout="120000" ContentType="application/soap+xml;charset=UTF-8"/> </http:conduit> <bean id="wsclient" class="org.tempuri.IStock" factory-bean="wsFactory" factory-method="create" /> <bean id="wsFactory" class="org.apache.cxf.jaxws.JaxWsProxyFactoryBean"> <property name="serviceClass" value="org.tempuri.IStock" /> <property name="address" value=" http://wss.aduanas.gub.uy/LuciaWsSecurity/Stock.svc" /> <property name="outInterceptors"> <list> <bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" /> <ref bean="wss4jOutInterceptor" /> </list> </property> </bean> <bean id="wss4jOutInterceptor" class="org.apache.cxf.ws.security.wss4j.WSS4JOutInterceptor"> <constructor-arg> <map> <entry key="action" value="Signature" /> <entry key="signaturePropFile" value="Client_Sign.properties" /> <entry key="user" value="le-60dca1be-5393-48b3-bbc3-0dfb1ab40d25" /> <entry key="passwordType" value="PasswordDigest" /> <entry key="mustUnderstand" value="false" /> <entry key="signatureKeyIdentifier" value="DirectReference" /> <entry key="passwordCallbackRef"> <ref bean="signaturePwdCallback" /> </entry> <entry key="signatureParts" value="{Element}{ http://www.w3.org/2005/08/addressing}Action;{Element}{http://www.w3.org/2005/08/addressing}ReplyTo;{Element}{http://www.w3.org/2005/08/addressing}MessageID;{Element}{http://www.w3.org/2005/08/addressing}To;{Element}{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd}Timestamp;{Content}{http://www.w3.org/2003/05/soap-envelope}Body" /> </map> </constructor-arg> </bean> <bean id="signaturePwdCallback" class="org.jpp.ws.client.ClientCallback" /> </beans> The wsdl: <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions name="MenStock" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu=" http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd " xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsam=" http://www.w3.org/2007/05/addressing/metadata" xmlns:tns="http://tempuri.org/" xmlns:wsa=" http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap=" http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc=" http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12=" http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx=" http://schemas.xmlsoap.org/ws/2004/09/mex"> <wsp:Policy wsu:Id="CustomBinding_IStock_policy"> <wsp:ExactlyOne> <wsp:All> <sp:AsymmetricBinding xmlns:sp=" http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:Policy> <sp:InitiatorToken> <wsp:Policy> <sp:X509Token sp:IncludeToken=" http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient "> <wsp:Policy> <sp:WssX509V3Token10 /> </wsp:Policy> </sp:X509Token> </wsp:Policy> </sp:InitiatorToken> <sp:RecipientToken> <wsp:Policy> <sp:X509Token sp:IncludeToken=" http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never"> <wsp:Policy> <sp:WssX509V3Token10 /> </wsp:Policy> </sp:X509Token> </wsp:Policy> </sp:RecipientToken> <sp:AlgorithmSuite> <wsp:Policy> <sp:Basic256 /> </wsp:Policy> </sp:AlgorithmSuite> <sp:Layout> <wsp:Policy> <sp:Lax /> </wsp:Policy> </sp:Layout> <sp:IncludeTimestamp /> <sp:OnlySignEntireHeadersAndBody /> </wsp:Policy> </sp:AsymmetricBinding> <sp:Wss10 xmlns:sp=" http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:Policy> <sp:MustSupportRefKeyIdentifier /> <sp:MustSupportRefIssuerSerial /> </wsp:Policy> </sp:Wss10> <sp:Trust10 xmlns:sp=" http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <wsp:Policy> <sp:MustSupportIssuedTokens /> <sp:RequireClientEntropy /> <sp:RequireServerEntropy /> </wsp:Policy> </sp:Trust10> <wsaw:UsingAddressing /> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <wsp:Policy wsu:Id="CustomBinding_IStock_MensajeStock_Input_policy"> <wsp:ExactlyOne> <wsp:All> <sp:SignedParts xmlns:sp=" http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <sp:Body /> <sp:Header Name="To" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="From" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="FaultTo" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="ReplyTo" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="MessageID" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="RelatesTo" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="Action" Namespace=" http://www.w3.org/2005/08/addressing" /> </sp:SignedParts> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <wsp:Policy wsu:Id="CustomBinding_IStock_MensajeStock_output_policy"> <wsp:ExactlyOne> <wsp:All> <sp:SignedParts xmlns:sp=" http://schemas.xmlsoap.org/ws/2005/07/securitypolicy"> <sp:Body /> <sp:Header Name="To" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="From" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="FaultTo" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="ReplyTo" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="MessageID" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="RelatesTo" Namespace=" http://www.w3.org/2005/08/addressing" /> <sp:Header Name="Action" Namespace=" http://www.w3.org/2005/08/addressing" /> </sp:SignedParts> </wsp:All> </wsp:ExactlyOne> </wsp:Policy> <wsdl:types> <xsd:schema targetNamespace="http://tempuri.org/Imports"> <xsd:import schemaLocation=" http://wss.aduanas.gub.uy/LuciaWsSecurity/Stock.svc?xsd=xsd0" namespace="http://tempuri.org/" /> <xsd:import schemaLocation=" http://wss.aduanas.gub.uy/LuciaWsSecurity/Stock.svc?xsd=xsd1" namespace=" http://schemas.microsoft.com/2003/10/Serialization/" /> <xsd:import schemaLocation=" http://wss.aduanas.gub.uy/LuciaWsSecurity/Stock.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/WCF_Stock" /> </xsd:schema> </wsdl:types> <wsdl:message name="IStock_MensajeStock_InputMessage"> <wsdl:part name="parameters" element="tns:MensajeStock" /> </wsdl:message> <wsdl:message name="IStock_MensajeStock_OutputMessage"> <wsdl:part name="parameters" element="tns:MensajeStockResponse" /> </wsdl:message> <wsdl:portType name="IStock"> <wsdl:operation name="MensajeStock"> <wsdl:input wsaw:Action="http://tempuri.org/IStock/MensajeStock" message="tns:IStock_MensajeStock_InputMessage" /> <wsdl:output wsaw:Action=" http://tempuri.org/IStock/MensajeStockResponse" message="tns:IStock_MensajeStock_OutputMessage" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="CustomBinding_IStock" type="tns:IStock"> <wsp:PolicyReference URI="#CustomBinding_IStock_policy" /> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="MensajeStock"> <soap12:operation soapAction=" http://tempuri.org/IStock/MensajeStock" style="document" /> <wsdl:input> <wsp:PolicyReference URI="#CustomBinding_IStock_MensajeStock_Input_policy" /> <soap12:body use="literal" /> </wsdl:input> <wsdl:output> <wsp:PolicyReference URI="#CustomBinding_IStock_MensajeStock_output_policy" /> <soap12:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="MenStock"> <wsdl:port name="CustomBinding_IStock" binding="tns:CustomBinding_IStock"> <soap12:address location=" http://wss.aduanas.gub.uy/LuciaWsSecurity/Stock.svc" /> <wsa10:EndpointReference> <wsa10:Address> http://wss.aduanas.gub.uy/LuciaWsSecurity/Stock.svc</wsa10:Address> <Identity xmlns=" http://schemas.xmlsoap.org/ws/2006/02/addressingidentity"> <Dns>wss.aduanas.gub.uy</Dns> </Identity> </wsa10:EndpointReference> </wsdl:port> </wsdl:service> </wsdl:definitions> Any suggestion or link to avoid my error? Thanks!
