Validating XSD Schema against an XML

Hi,

I am using Business Connector 4.6 and I don’t know why BC does not perform correct validation on my XML against an XSD schema I created. Attached please find a sample XSD that I created. I created a Record in BC, which I named myPO, based on the XSD and BC also automatically creates the schema named schema_myPO.

Sample XSD file
myPO.xsd (1.0 k)

Then I created a flow with the following sequence of commands:

1.) MAP

  • I created a record reference to myPO and set the following values to the fields: orderDate = ‘2005-05-06’, shipTo/country = ‘US’, shipTo/name = ‘Someone’, shipTo/street = ‘street’, shipTo/city = ‘city’, shipTo/state = ‘state’ and zip = ‘1234’, fields in billTo = same as shipTo except that zip is set to ‘hello’ and comment = ‘my comment’.

2.) recordToDocument

  • I mapped myPO to boundNode, generateRequiredTags is set to true and this outputs an xmldata

3.) stringToDocument

  • I mapped xmldata to the xmldata service in parameter and this outputs a node

4.) validate

  • I mapped the node to the object service in parameter, set conformsTo = <interface>.<subinterface>:schema_myPO, ignoreContent = false and set failIfInvalid to true.

When I run this service I am expecting an error to be raised by the validate service because billTo/zip is set to ‘hello’ when in the XSD it is defined as a decimal. However, it is not raising an error. Can somebody help me?

Thanks in advance for your help.

RMG can you help me?

Thanks,
Elbert

Hi,

I have the same problem because I want to validate xml to xsd, I created two docs types docXML and docXSD then I created a service which use the following services :

pub.file:getFile
pub.xml:xmlStringToXMLNode
pub.xml:xmlNodeToDocument
MAP

??? pub.schema:validate ?? I want to use validate in order to return two values success and failed then I don’t know how do to develop the validation process? Could help me?

Thanks!!!

Yes if you use schema:validate service it does validate any incoming XML node against the DTD or XML Schema and returns the validation errors based on the inputs you pass it in the validate service.

Did you test any of the above like?

Also please review the built in services guide for the public services and it covers some basic explanation of how the service works.

HTH,
RMG