A complete stack trace is received as a response to a webservice call instead of a user defined fault for an invalid input field in the SOAP Header.

A complete stack trace is received as a response to a webservice call instead of a user defined fault for an invalid input field in the SOAP Header.

book

Article ID: KB0092407

calendar_today

Updated On:

Products Versions
TIBCO ActiveMatrix BusinessWorks -
Not Applicable -

Description

Description:
The stack trace will be similar to the following:

>>>>>>>>>>>>>>>

<faultstring xmlns="">Exception thrown while executing the mapper: validation error: data "]]2015-03-04T04:03:30" is not a valid dateTime.  A valid example is "1999-05-31T13:20:00-05:00".   ({com.tibco.xml.validation}SIMPLE_E_INVALID_VALUE_FOR_TYPE) at /{http://www.allstate.com/billing/billingInquiryService/v1}msgHeader[1]/header[1]/m:msgHeader[1]/m:msgDateTime[1]

com.tibco.xml.validation.exception.ValueParseException: data "]]2015-03-04T04:03:30" is not a valid dateTime.  A valid example is "1999-05-31T13:20:00-05:00".

            at com.tibco.xml.validation.state.glue.LegacySimpleValidator.typedValue(LegacySimpleValidator.java:77)

            at com.tibco.xml.validation.state.driver.ValidationJazz.text(ValidationJazz.java:1189)

            at com.tibco.xml.validation.state.glue.XmlContentValidationDriver.endElement(XmlContentValidationDriver.java:113)

            at com.tibco.xml.transform.impl.expr.h.endElement(XslConditioningFilter3.java:329)

            at com.tibco.xml.data.primitive.helpers.XmlTreeNodeSupport.a(XmlTreeNodeSupport.java:173)

            at com.tibco.xml.data.primitive.helpers.XmlTreeNodeSupport.a(XmlTreeNodeSupport.java:162)

            at com.tibco.xml.data.primitive.helpers.XmlTreeNodeSupport.deepCopy(XmlTreeNodeSupport.java:70)

            at com.tibco.xml.transform.impl.expr.aE.a(TmCopyOfExpr.java:184)

            at com.tibco.xml.transform.impl.expr.aE.execute(TmCopyOfExpr.java:107)

            at com.tibco.xml.transform.impl.expr.ac.execute(TmLiteralResultElementExpr.java:141)

            at com.tibco.xml.transform.impl.expr.ac.execute(TmLiteralResultElementExpr.java:141)

            at com.tibco.xml.transform.impl.expr.J.a(DefaultTemplateExpr.java:143)

            at com.tibco.xml.transform.impl.expr.u.a(DefaultModuleTransformExpr.java:289)

            at com.tibco.xml.transform.impl.expr.u.a(DefaultModuleTransformExpr.java:173)

            at com.tibco.xml.transform.trax.c.transform(TmTransformerImpl.java:318)

            at com.tibco.xml.xdata.bind.OnceOnlyBinding.stream(Unknown Source)

            at com.tibco.xml.xdata.bind.OnceOnlyBinding.getXiNode(Unknown Source)

            at com.tibco.bw.service.binding.soap.impl.XDataAdapterSoaplet.runMapper(Unknown Source)

            at com.tibco.bw.service.binding.soap.impl.XDataAdapterSoaplet.processBody(Unknown Source)

            at com.tibco.bw.service.binding.bwhttp.impl.DefaultSoapApplication.processMessage(Unknown Source)

            at com.tibco.bw.service.binding.soap.http.SoapHttpTransportApplication.dispatchMessage(Unknown Source)

            at com.tibco.bw.service.binding.soap.http.SoapHttpTransportApplication.if(Unknown Source)

>>>>>>>>>>>>>>>>>>>>>>>>

Issue/Introduction

A complete stack trace is received as a response to a webservice call instead of a user defined fault for an invalid input field in the SOAP Header.

Resolution

The stack trace is seen not because header fields are validated but because of trying to map the header to the Context Resource. If the Context Resource is not set, there will be no error stack trace for the header. See attached (Filename: Image1.jpg). If using the Context Resource to extract the request header, but an invalid field value is set, the mapping will break and the complete stack trace will be given as a response. To prevent the complete stack trace, follow the steps below.


1). Define a Context Resource with an option element. See the attached (Filename: Image2.jpg).

2). Render the header element in the mapping. See the attached (Filename: Image3.jpg).

3). Parse this against your header schema. See the attached (Filename: Image3.jpg).

4). If there is an error, catch it and send a user defined fault as a response.

Attachments

A complete stack trace is received as a response to a webservice call instead of a user defined fault for an invalid input field in the SOAP Header. get_app