Return-Path: X-Original-To: apmail-cxf-issues-archive@www.apache.org Delivered-To: apmail-cxf-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 30CD5107EE for ; Wed, 14 Aug 2013 16:34:01 +0000 (UTC) Received: (qmail 1059 invoked by uid 500); 14 Aug 2013 16:34:00 -0000 Delivered-To: apmail-cxf-issues-archive@cxf.apache.org Received: (qmail 928 invoked by uid 500); 14 Aug 2013 16:33:58 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 161 invoked by uid 99); 14 Aug 2013 16:33:55 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Aug 2013 16:33:55 +0000 Date: Wed, 14 Aug 2013 16:33:55 +0000 (UTC) From: "Daniel Kulp (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-5194) SoapHeaderInterceptor fails to validate SOAP header MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CXF-5194?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13739844#comment-13739844 ] Daniel Kulp commented on CXF-5194: ---------------------------------- I'm not able to reproduce this. I updated one of our schema validation test cases to test a soap header (wsdl first) and the test properly validates the header on the incoming side. I'll likely need to see a full test case. HOWEVER: I did discover that we aren't validating soap headers on the OUTBOUND side at all. When writing the headers, we should also be validating them but we aren't. I'm as part of committing a test for this. > SoapHeaderInterceptor fails to validate SOAP header > --------------------------------------------------- > > Key: CXF-5194 > URL: https://issues.apache.org/jira/browse/CXF-5194 > Project: CXF > Issue Type: Bug > Components: Soap Binding > Affects Versions: 2.7.0, 2.7.6 > Environment: Windows/Solaris, JBoss, JavaSE-1.6 > Reporter: Filipe Amaral > Priority: Critical > > Soap message includes a custom Header, let's call it "RequestHeader": > {code:xml} > > > > > > {code} > A contract-first approach is done through wsdl2java. > Service endpoint is created through: > {code:title=TestWsService.java|borderStyle=solid} > ... > JaxWsServerFactoryBean factory = new JaxWsServerFactoryBean(); > final String wsdlLocation = (String) properties.get(WSDL_LOCATION_PROPERTY); > URL url = getClass().getResource(wsdlLocation); > if (url == null) { > throw new IOException("WSDL not found at bundle location " + wsdlLocation); //$NON-NLS-1$ > } > factory.setWsdlLocation(url.toString()); > factory.setAddress((String) properties.get(WS_ADDRESS_PROPERTY)); > factory.setServiceBean(new TestPortImpl()); > factory.setServiceClass(TestPortImpl.class); > factory.setEndpointName(new QName((String) properties.get(WS_NAMESPACE_PROPERTY), "TestPort")); //$NON-NLS-1$ > factory.setServiceName(new QName((String) properties.get(WS_NAMESPACE_PROPERTY), "TestService")); //$NON-NLS-1$ > // turn up schema validation (executes inbound and outbound validations) > factory.getProperties(Boolean.TRUE).put("schema-validation-enabled", Boolean.TRUE); //$NON-NLS-1$ > webService = factory.create(); > webService.start(); > ... > {code} > A SOAP request is made with an invalid timestamp. Validation doesn't occur and request traverses SoapHeaderInterceptor without even being validated. > After doing some debug inside the interceptor, problem relies on _validateHeader()_. > When _findHeader()_ is called inside _validateHeader()_ it simply returns null, although the SoapMessage is correct and apparently the MessagePartInfo too. > Inside _findHeader()_ the _mpi.getConcreteName()_ returns "RequestHeaderElement" as localPart where it should simply return "RequestHeader". > If _mpi.getConcreteName()_ return value is changed at runtime through live debug to "RequestHeader", validation is done successfully, failing with soapfault: > {code:xml} > > > > soap:Client > Could not validate soapheader caused by: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '2012-05-1T00:00:00' is not a valid value for 'dateTime'.. > > > > {code} > If more detailed info is needed, please advise. > Regards -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira