IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.


#TechXchangePresenter
 View Only
  • 1.  Introspect internal Doc Type schema to extract constraint

    Posted Tue March 01, 2005 11:23 PM

    Hi all wM gurus - I am hoping someone has had this requirement and found an elegant solution.

    Let’s say I call pub.schema:validate and my “zipCode” field is invalid because it doesn’t comply to the internal Address document I’m validating against.

    Say my value is “1234567” and my schema constraint is that zipCode has to be 5 bytes long. So pub.schema:validate will exit with “isValid=false” and contain an “errors” Doc list with fields “pathName”, “errorCode” and “errorMessage”.

    The errorMessage will say something like “field is too long”. What I need to extract is the actual constraint value of that zipCode field (i.e., 5 bytes). I’m guessing that internally, this may be an attribute of the zipCode XML tag and so it must exist. I just don’t know how to get that constraint value.

    Any ideas on how this can be done via a Java API or other built-in service? One solution I came up with involves using a property file that contains these constraints but I want to avoid using an external file.

    • Rajesh

    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 2.  RE: Introspect internal Doc Type schema to extract constraint

    Posted Wed March 02, 2005 12:17 AM

    Rajesh,

    You have to add the constraint in the XML Schema itself,so that when you are validation xml document against the schema,it will throw the error like “field is too long” etc…

    HTH,
    RMG.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: Introspect internal Doc Type schema to extract constraint

    Posted Wed March 02, 2005 12:25 AM

    Hi RMG - Yes, I think we’re talking about the same thing. What you’re referring to as “XML Schema” is what I’m calling “Internal Address document”. So in the Address document, there is a string called zipCode with constraint of “totalDigits=5”.

    Then when I get a document with zipCode of “1234567” for example, the constraint is broken. What I need to extract is the constraint value (i.e., “totalDigits=5”).


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 4.  RE: Introspect internal Doc Type schema to extract constraint

    Posted Thu March 03, 2005 01:55 AM

    Ok, found a service that will give this:

    wm.server.ns:getNode in WmRoot package.


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 5.  RE: Introspect internal Doc Type schema to extract constraint

    Posted Thu March 03, 2005 02:16 AM

    great,but be aware of using WmRoot services which actually developed for internal webMethods server use.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods