Importing XSD’s Schema With External References (step-by-step guide)
The goal of this guide is to provide a detailed step by step to import XSD´s schema with external references by using SAP PI tool “Import External Definitions…”
In my case I have worked with a customer who uses OASIS UBL 2.1 as standard to Exchange messages (https://www.oasis-open.org/).
First, customer provides me the XSD nested structure in a zipped file.
Procedure:
All the schemas must be imported under the same namespace to keep the reference amongst them.
Select the menu Tools > Import External Definitions… (We use the massive import tool).
This initializes a wizard
Select the Software Component Version and the Namesapace.
Choose all the XSD files to import, in this step is important to select the option ‘Import All References‘, so it will automatically reference the XSD’s.
Click ‘Continue’, the message ‘Generate proposals…’ appears.
Finally it show the list of files to import, in the column name ‘Source’ you can see those who has reference to other XSD file.
Sometimes it is necessary to modify a file name since PI doesn´t accept some characters.
At last click ‘Finish’.
E.g. UBLContractNotice main schema has reference to:
UBLCommonAggregateComponents
UBLCommonBasicComponents
UBLCommonExtensionsComponents
if some references are still missing, we will see fields in red on the message as shown in below example.
I hope you find useful this guide.
Good work.
Thx for sharing such useful info..
Thanks a lot Prabhat.
Hi Rodrigo,
Thanks for your input.
We are having a requirement where we need to import an WSDL which refers to an XSD from intranet(accessible from PI server).We have given the full path of that XSD as the schemaLocation in WSDL file. But in PI can't find the location of that XSD file whereas if we paste the location in browser, the XSD structure is visible.
Please suggest what else should we do?
Regards,
Suman
Hi Suman,
Sorry for the delay, what I would do will be download the XSD from intranet and import it in the same namespace than the WSDL, and then check if the flap "External References" has the column "Source" and "Name" complete, this means that the reference with the XSD schema is good, If not please refer to the following link where I explain what to do.
http://scn.sap.com/thread/3611445
I have a query, the WSDL has the "SchemaLocation" tag complete or you have to complete manually? because I think you have to do this with an application to créate WSDLs like XML Spy, I remembered one time i did it manually and when I imported the WSDL did not appear the reference so I had to use the App I mentioned to créate the WSDL.
I hope this help you.
Best regards,
Rodrigo.
Thanks a lot for this and it was really helpful for users using UBL. Great work!!
Thank you, this saved me!
Hello Rodrigo,
Thank you for your wonderful blog.
I tried importing XSDs in same way but it is not picking the name from source in case of mutiple xsds at one source.
As a result I have consolidated all the xsds in one and uploaded.Few data types are still red and I am getting error while generating proxy:
Recursions must be eliminated (Podpozycja -> TKwotyPozycjiSprawozdania)
and
In the WSDL document the object "TKwotyPozycjiSprawozdania"from the namespace "http://bio-rad.com/RTR/PolandFSV_ETD" was defined.However, this refers (directly or indirectly) to itself.
Now, I am clueless,
Please advise.
Thanks,
Indu Khurana.
Hi Rodrigo,
I have to transport the External Definition with references to the QA environment. How can I do that? Is there a way the dependencies are transported with it?
Regards,
Arkesh