You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2013/10/04 23:51:42 UTC
[jira] [Resolved] (CXF-5194) SoapHeaderInterceptor fails to
validate SOAP header
[ https://issues.apache.org/jira/browse/CXF-5194?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Kulp resolved CXF-5194.
------------------------------
Resolution: Cannot Reproduce
Fix Version/s: (was: NeedMoreInfo)
Invalid
Assignee: Daniel Kulp
Could not reproduce and no further information provided for over a month.
> 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
> Assignee: Daniel Kulp
> Priority: Critical
> Fix For: Invalid
>
>
> Soap message includes a custom Header, let's call it "RequestHeader":
> {code:xml}
> <xs:complexType name="RequestHeader">
> <xs:sequence>
> <xs:element name="TimeStamp" type="xs:dateTime" />
> </xs:sequence>
> </xs:complexType>
> {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:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
> <soap:Body>
> <soap:Fault>
> <faultcode>soap:Client</faultcode>
> <faultstring>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'..</faultstring>
> </soap:Fault>
> </soap:Body>
> </soap:Envelope>
> {code}
> If more detailed info is needed, please advise.
> Regards
--
This message was sent by Atlassian JIRA
(v6.1#6144)