cancel
Showing results for 
Search instead for 
Did you mean: 

XML Validation with multiple XSD files (referenced)

Former Member
0 Kudos

Hello,

I know that XML validation with version 7.1 is possible now. However I was provided with a set of XSD files that have references to each other and need to be placed in a hierachical file system order so that references can be resolved.

An element <xsl:include schemaLocation="../../baseSchemas/baseSchema.xsd" /> is used for example. How can I handle that for XSD validation in PI? Can I create the same folder structure or do I need to put all XSD files in one directory and change the import manually?

But most important question: Is it possible it all to use more than one XSD for schema validation?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Florian,

I had encountered such case in a project.

I was given 3 files. One main file and 2 others called Schema1.xsd and Schema2.xsd.

This happens because your data type is not in single namespace, but is being referred across namespaces and software components.

I am assuming that you have read the How to Guide for XML validations on PI 7.1

Best way to do this quickly is as follows.

1. Enable XML validation at adapter engine in the sender agreement.

2. Post a message using HTTP post. (http://sappihttpclient.codeplex.com)

3. Check communication channel in runtime workbench. There will be an error saying which is missing at what path.

4. Create the path mentioned and place the file at that path.

5. Repeat steps 2,3,4 for all the files.

When you are done with this, you will get a proper validation error in case XML file is not correct. And remember to generate XSD from message type and not data type.

Regards,

Vikas

Edited by: Vikas Aggarwal on Sep 2, 2009 8:45 PM

Edited by: Vikas Aggarwal on Sep 2, 2009 8:48 PM

Former Member
0 Kudos

Hello, thank yu very much for this helpful answers.

However my XSDs that I have imported as external definition are not placed in different namespaces / SWCV but are all in the same. I just got them in a zip file by the external partner and they were placed in different directories.

I have read the documentation, but there is only the include namespace described, but not the references of XSDs that are in the same namespace.

Do you think it is possible anyhow?

Former Member
0 Kudos

When you must have imported the XSD's in ESR, have you imported the zip file directly and used in service interface?

Did you try enabling XSD validation and posting a message, what error do you get?

Former Member
0 Kudos

Hello,

not I could not test is so far as RFC connection have to be set up first.

However I merged all XSD files into a single one to be on the safe side.

Do you think it is also possible just to upload the zip file?

Of course I will give you feedback on the outcome of the test.

Former Member
0 Kudos

Hi Florian,

I was assuming that you have already imported the ZIP as External definition.

You can try uploading the ZIP directly first and then testing.

Regards,

Vikas

Former Member
0 Kudos

Hi,

as I have merged all XSDs in once we will go for the solution with only one xsd file.

former_member190389
Active Contributor
0 Kudos

Hi,

For this place all the xsd files in the folder server0 of XI installation on server.

This was the case for PI 7.0 .. hope it works with PI 7.1 also

Also please change the references in the xsd to exclude all the subdirectory references.

e.g folder1/folder2/abc.xsd shud become abc.xsd only

Edited by: Progirl Progirl on Sep 2, 2009 6:14 PM

Former Member
0 Kudos

Hello!

Yes I will try to do it and give you feedback. Of course I will change references beforehand.

Just another question: I will send the message to be validated using an Integration Process send step (asynchronous mode). Do I get a validation error back that can be handled in the integration process with details on what went wrong?

And what is the exact difference on integration server or adapter engine validation? Which one would I choose in which case???

Edited by: Florian Guppenberger on Sep 2, 2009 2:53 PM

prateek
Active Contributor
0 Kudos

Do I get a validation error back that can be handled in the integration process with details on what went wrong?

If you use Adapter Engine validation, then there would be a sync response to the sender right away. It won't anyhow enter BPM. This is called backward error handling as error is sent back to sender. If you use Integration Engine schema validation, the it would be forward error handling where error can be propagated further as per your requirement.

And what is the exact difference on integration server or adapter engine validation? Which one would I choose in which case???

Validation of schema when message enters PI using adapter engine would be performed using adapter engine validation.

Integration Engine related validations could be made both on sender and receiver. But for adapter engine, only sender side validation is logical. At the receiver side, the validation at Integration Engine suffice the purpose.

Regards,

Prateek

Former Member
0 Kudos

Hello,

I adjusted the references in the import statement and removed the path to the referenced schemas so that I can place all of the schemas in the same directory.

However now I have another problem: If all of the schemas are in the same directory how does the Validation Step know WHICH one to take for validation (the main schema, that is not referenced but just has references to other schemas). Do you know that? Or do I need to create subdirectories and change the references to that subdirectory so that only ONE schema is presend in the directory?

former_member190389
Active Contributor
0 Kudos

I guess you will not have to create any subdirectories since the main will automatically reference the other xsds. So keeping it in the same directory will not harm.

I have tried this in PI7.0 (with too many referenced xsds in the same directory and it works fine )