Topic
6 replies Latest Post - ‏2013-07-16T13:19:25Z by harish8115
harish8115
harish8115
21 Posts
ACCEPTED ANSWER

Pinned topic DataPower xs:Date validation

‏2013-07-14T19:31:24Z |

I have a Web Service Proxy configured on DataPower XI50 appliance. One of the data elements that the service accepts is the date. This has been defined as xs:Date in the XSD file. While DataPower is allowing dates when submitted in format, 2013-07-14, it is throwing a schema validation error when date is submitted in format, 2013/07/14. The latter is a valid date format which the back end service is accepting when submitted directly (not through DataPower).

Please advise on how I can resolve this issue.

  • Rohit-Goyal
    Rohit-Goyal
    119 Posts
    ACCEPTED ANSWER

    Re: DataPower xs:Date validation

    ‏2013-07-15T04:35:17Z  in response to harish8115

    It is not DataPower issue. You need to change the XSD to allow required format you want.

    Rohit

  • David07
    David07
    73 Posts
    ACCEPTED ANSWER

    Re: DataPower xs:Date validation

    ‏2013-07-15T04:58:20Z  in response to harish8115

    Hi harish,

    As Rohit said the problem you are facing is not with the datapower. For XML Schema W3C recommended syntax is 'yyyy-mm-dd', since your backend will accept 'yyy/mm/dd' this format  you have to transform the date using styleshhet according to your backend needs.

    David

  • harish8115
    harish8115
    21 Posts
    ACCEPTED ANSWER

    Re: DataPower xs:Date validation

    ‏2013-07-15T15:29:14Z  in response to harish8115

    Rohit / David - Thank you for your response.

    I am planning on using the WebSphere Transformation Extender Design Studio for constructing the transformation rules. Is this a suited solution or are there other tools that I should consider?

    Please advise.

    • David07
      David07
      73 Posts
      ACCEPTED ANSWER

      Re: DataPower xs:Date validation

      ‏2013-07-16T04:56:37Z  in response to harish8115

      Hi Harish,

      Actually we prefer Websphere Transformation Extender Design Studio for Binary Transformation.For your scenario, you can use Extensible Stylesheet Language for the Date Transformation.

      David

      • HermannSW
        HermannSW
        4360 Posts
        ACCEPTED ANSWER

        Re: DataPower xs:Date validation

        ‏2013-07-16T07:37:51Z  in response to David07

        XPath translate() function is enough to correct date:

        $ echo "<d>2013-07-14</d>" | xpath++ "translate(., '-', '/')" -
        2013/07/14
        $ echo "<d>2013/07/14</d>" | xpath++ "translate(., '-', '/')" -
        2013/07/14
        $

         

        Hermann<myXsltBlog/> <myXsltTweets/> <myCE/>

        • harish8115
          harish8115
          21 Posts
          ACCEPTED ANSWER

          Re: DataPower xs:Date validation

          ‏2013-07-16T13:19:25Z  in response to HermannSW

          Thank you! I understand that the date translation is quite simple. I was looking to understand which is the preferred tool to use to build more complex transformation maps. Please advise.