Skip to Content
Author's profile photo Rodrigo Ferradas

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.

/wp-content/uploads/2013/07/1_248140.jpg

/wp-content/uploads/2013/07/2_248168.jpg

Procedure:


All the schemas must be imported under the same namespace to keep the reference amongst them.

/wp-content/uploads/2013/07/3_248169.jpg

Select the menu Tools > Import External Definitions… (We use the massive import tool).

/wp-content/uploads/2013/07/4_248170.jpg

This initializes a wizard

/wp-content/uploads/2013/07/5_248177.jpg

Select the Software Component Version and the Namesapace.

/wp-content/uploads/2013/07/6_248178.jpg

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.

/wp-content/uploads/2013/07/7_248179.jpg

Click ‘Continue’, the message ‘Generate proposals…’ appears.

/wp-content/uploads/2013/07/8_248186.jpg

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.

/wp-content/uploads/2013/07/9_248187.jpg

Sometimes it is necessary to modify a file name since PI doesn´t accept some characters.

/wp-content/uploads/2013/07/10_248188.jpg

At last click ‘Finish’.

/wp-content/uploads/2013/07/11_248192.jpg

E.g. UBLContractNotice main schema has reference to:

UBLCommonAggregateComponents

UBLCommonBasicComponents

UBLCommonExtensionsComponents

/wp-content/uploads/2013/07/12_248193.jpg

/wp-content/uploads/2013/07/13_248194.jpg

if some references are still missing, we will see fields in red on the message as shown in below example.

/wp-content/uploads/2013/07/14_248202.jpg

I hope you find useful this guide.


Assigned tags

      9 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Good work.

      Author's profile photo Former Member
      Former Member

      Thx for sharing such useful info..

      Author's profile photo Rodrigo Ferradas
      Rodrigo Ferradas
      Blog Post Author

      Thanks a lot Prabhat.

      Author's profile photo Suman Saha
      Suman Saha

      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

      Author's profile photo Rodrigo Ferradas
      Rodrigo Ferradas
      Blog Post Author

      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.

      Author's profile photo Arijit Mukherjee
      Arijit Mukherjee

      Thanks a lot for this and it was really helpful for users using UBL. Great work!!

      Author's profile photo Former Member
      Former Member

      Thank you, this  saved me!

      Author's profile photo Indu Khurana
      Indu Khurana

      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.

      Author's profile photo Arkesh Sharma
      Arkesh Sharma

      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